Red Hat

In Relation To JBoss AS

In Relation To JBoss AS

JBossAS6.0.0.Final released

Posted by    |       |    Tagged as JBoss AS

JBoss6 is out! :-)

All of the Microcontainer libs were updated to 2.2..

JSF got super cool integration: http://jsfunit.blogspot.com/2010/12/jsf-on-jboss-as6-final.html

Any many more ...

Anyway, happy MMXI ... onward to Weld!

AS 7.0.0.Alpha1 released!

Posted by    |       |    Tagged as JBoss AS

As AS6 has been getting closer to CR, we have recently started working on our new next generation application server. Last week, we just released an early alpha of this work, 7.0.0.Alpha1, code named Halloween.

I am putting links first, in case you don't feel like reading my long post:

You can download the release in the usual place here:

http://jboss.org/jbossas/downloads

There is some basic user instructions here:

http://community.jboss.org/wiki/JBossAS7UserGuide

Also, Brian, one of our core devs hacked together a quick late-night (yet very nice) demo covering the new powerful management capabilities:

As you can see, the biggest change in AS7 is that we are treating administrators with the same love that we have always shown developers. In particular, we have been doing a lot of thinking about how to make their lives easier when it comes to managing small to very large environments. This is a very important part of a bigger effort you may have heard us reference called "Andiamo", a major focus on improving the usability of JBoss projects and products.

In AS7, configuration is now centralized and presented in a user-friendly manner. So instead of searching for one of our beans.xml files to change some settings for a specific subsystem, you now know exactly where to look. Also the configuration can now describe an entire domain. This means any number of servers, and groupings thereof can be controlled in one place.

For those that don't want to run in a more complex domain topology, we have a simpler more traditional mode you can run JBoss AS in called standalone. The configuration is largely the same, but is slightly simplified, so you still benefit from user-friendly configuration all in one place.

AS7 isn't just about administrators, we are also aiming to make life better for developers as well. One big change we are making is moving to a "pure" modular class-loading environment that will allow us to finally hide our implementation classes from application deployments. In other words, if we decide to use foobar.jar, version 1.1, your application won't see those classes, so it can happily use foobar 2.2.

Another big change on the developer front is that the AS7 service container is fully concurrent, which takes advantage of modern cpus. This among other changes leads to a much improved boot time.

Note that this release just offers a glimpse into the management model and server environment we are working on. EE capabilities will be added as they are developed in subsequent releases.

If you are interested in contributing, check out our Hacking on AS7 page.

Thanks!

AS 6.0.0.M3 released!

Posted by    |       |    Tagged as JBoss AS

Last week we released the third milestone for AS6. One major improvement this release brings is a completely new high performance messaging implementation. HornetQ is available out of the box, all you have to do is setup your queues/topics and deploy any EE app using JMS. You can read more about this on Clebert's blog .

Another major feature this release includes is support for EJB 3.1 singleton beans, and container managed concurrency. For those that aren't familiar with singleton beans, they are essentially a stateless bean that can be used similar to the "servlet" model, where you can have multiple concurrent requests on the same instance. Traditional stateless session beans can never allow multiple threads to execute on the same instance. This means the container must pool a collection of instances to be ready to process your request load. The obvious advantage this brings is that it simplifies the bean implementation; however, for some applications the pooling, especially when left untuned, can be counter-productive. Singletons are a way to achieve greater control by allowing the application to implement any concurrency/locking model of its choosing.

If you have an application that that follows a common read/write locking pattern, then a singleton can optionally use container managed concurrency by annotating methods with the @Lock(READ) and @Lock(Write) annotations. This gives you the additional control but takes some of the burden of lock management away.

Another notable addition to the M3 release, is a new OSGI profile that can be triggered using the -c option:

./run.sh -c osgi

This will start a number of OSGi services, as well as the ability to directly deploy bundles. You can find out more on how to use this new profile by checking out the JBoss OSGI project docs.

There are of course many other improvements too numerous to mention. To get the complete list of features, changes, and fixes that made this release, take a look at the full release notes, available here.

As always, you can download all AS releases on the AS download page.

AS 6.0.0.M2 is here!

Posted by    |       |    Tagged as JBoss AS

JBoss AS 6.0.0.M2 has just been released. A major highlight is that this release delivers three more key EE6 capabilities:

  • JPA 2
  • Servlet 3
  • JAX-RS (RESTful services).

You can read all about it in Brian's official announcement here.

Get it now!

MC 2.2 series and new JBossAS6_M2

Posted by    |       |    Tagged as JBoss AS

We just released new JBossAS6 milestone - M2.

With this one we start off a new Microcontainer 2.2.x version series:

  • VFS 2.2.0.Alpha2 -- minor bug fixes and a few hack removals
  • Reflect 2.2.0.Alpha2 -- first one to include new Classpool project [1]
  • MDR 2.2.0.Alpha1 -- down the optimization road, metadata annotations lookup
  • Kernel 2.2.0.Alpha6 -- includes JMX [2], new Weld-int, asynchronous mode [3], ...
  • CL 2.2.0.Alpha2 -- system resources are still visible at shutdown, lifecycle callbacks, shutdown mode, ...
  • Deployers 2.2.0.Alpha1 -- deployers sorting fix, modification check based on known files, includes JMX, ...
  • McAnn 1.0.0.Alpha1 -- extracted scanning; to-be even more generalized (McScan project)

Explaining the [x] in a bit more details:

  1. Classpool is a project that will let us properly use Javassist based Reflect in JBossAS/MC
  2. JMX impl used to be part of AS; extracted and split into 3 sub-projects: JMX-Kernel, JMX-Deployers, JBossMX
  3. you can declare <bean name=Foo class=org.acme.Bar mode=Asynchronous> and its install will happen in a new thread

A lot of work in Kernel was done to support our new OSGi+MC facade and its transparent service/component mix.

Another big chunk of work in Kernel was also spent on optimizations, where Kabir did most of the heavy lifting, hence I'll let him talk about it. :-)

We're off to changing VFS with new v3 implementation!

Getting started with Weld and JBoss AS 6

Posted by    |       |    Tagged as JBoss AS Seam Weld

I just updated the Examples Guide for Weld 1.0 on the newly released JBoss AS 6.0.0.M1, including how to load the projects into Eclipse.

Enjoy!

Introducing JBoss AS 6.0.0.M1

Posted by    |       |    Tagged as Java EE JBoss AS Seam

How do you follow the fantastic news of the week with the Java EE6 platform and CDI getting final approval ? How about a JBoss AS release that includes support for three key EE6 features: CDI, Bean Validation, and JSF 2?

Done!

For those that aren't familiar with these technologies, each offers significant improvements to EE application development.

CDI (or Contexts and Dependency Injection) brings real context management and DI to the EE platform, and simplifies the integration of EE services with your application. Not only does it have innovative features that make life easier, but everything it does is completely type-safe, and easily extensible. Check out Gavin's interview with DZone for more information. Also check out the Weld page (our implementation and also the RI for CDI).

Bean Validation solves one of the biggest problems developers face daily, ensuring their data model is validated consistently and correctly as it progresses through each layer of an application. Instead of the common current cut-and-paste practice that is difficult to maintain and error prone, Bean Validation allows you to put all of your validation rules where they belong, the data model itself. Since JSF 2 and JPA 2 integrate with Bean Validation, all layers of your application will enforce those rules. This reduces errors, simplifies development, and saves time (and your C and V keys). For more information see Emmanuel's blog on Hibernate Validator 4 (our implementation of Bean Validation). Stay tuned for more info on how to integrate Bean Validation in your EE applications.

For those of you running in high availability environments, we have also included a brand new intelligent load balancing module called mod_cluster. You can read all about that in Brian's blog.

Note that in this release we are switching to a milestone based versioning scheme. The primary reason for this change is to provide a way to get completed features to the community as soon as they are ready. This is quite a bit different from a normal Alpha/Beta scheme which typically results in many incomplete capabilities in raw fashion, that slowly become complete towards the end of the release lifespan. The milestone model instead focuses on time constrained releases that each provide a small set of completed features. As an example, the M1 release actually includes Weld 1.0.0, which is a stable final release of Weld. If you are thinking of targeting your application on AS 6.0.0, you will be able to start with M1, and progress to future milestones as we add features and improvements.

You can find the full release notes for the release here, and the official download location is here.

As always, have a great open source day!

Now that Bean Validation is officially part of Java EE 6 and that Java EE6 is officially voted YES, let's see how Bean Validation integrates with the rest of the eco system.

What is Bean Validation

It's goal is to let application developers declare their data constraints once by annotating their model and make sure these constraints are validated by the different layers of the application in a consistent manner. Without Bean Validation, people have to write their validation rules in their favorite presentation framework, then in their business layer, then in their persistent layer, to some degree in the database schema and keep all of them synchronized.

Here is how this centralized constraint declaration looks like:

class User {
  @NotEmpty @Size(max=100)
  String getLogin() { ... }

  @NotEmpty @Size(max=100)
  String getFirstname() { ... }
  
  @Email @Size(max=250)
  String getEmail() { ... }
  ...
}

There are many more features like constraint composition, grouping but let's focus on how Bean Validation integrates with the EE 6 stack.

So what do I have to do to make it work in Java EE 6

The short answer is nothing. Not even an XML configuration trick.

Simply add your constraints on your domain model and the platform does the rest for you.

JSF and how to expose constraint violations to the user

In JSF, you bind form inputs to properties of your domain model. JSF 2 and Bean Validation smartly figure out which property you are binding to and execute the constraints associated to it.

<h:form id="register">
    <div style="color: red">
        <h:messages id="messages" globalOnly="true"/>
    </div>

    <div>
        Login:
        <h:inputText id="login" value="#{identifier.user.login}"/>
        <h:message style="color: red" for="login"/>
        <br/>
        Password:
        <h:inputSecret id="password" value="#{identifier.user.password}"/>
        <h:message style="color: red" for="password"/>
        <br/>
        Firstname:
        <h:inputText id="firstname" value="#{identifier.user.firstname}"/>
        <h:message style="color: red" for="firstname"/>
        <br/>
        Email:
        <h:inputText id="email" value="#{identifier.user.email}"/>
        <h:message style="color: red" for="email"/>
        <br/>

        <h:commandButton id="Login" value="Login" action="#{identifier.register}"/>
        <br/>
        <h:button id="cancel" value="Cancel" outcome="/home.xhtml"/>
    </div>
</h:form>

If the email, for example is malformed and the first name is left empty, Bean Validation will return the constraint violations to JSF 2 that will expose them to the user in a localized error message. By default, it just works and you don't even have to think about it.

For more advanced use cases, like disabling constraint validation for one or several fields or using a specific group or set of groups instead of the default one, you can use the <f:validateBean/> tag (check line 8 and 20 in the following example).

<h:form id="register">
    <div style="color: red">
        <h:messages id="messages" globalOnly="true"/>
    </div>

    <div>
        <!-- ***** use a specific group ***** -->
        <f:validateBean validationGroups="${identifier.validationGroups}">
            Login:
            <h:inputText id="login" value="#{identifier.user.login}"/>
            <h:message style="color: red" for="login"/>
            <br/>
            Password:
            <h:inputSecret id="password" value="#{identifier.user.password}"/>
            <h:message style="color: red" for="password"/>
            <br/>
            Firstname:
            <!-- ***** disable validation for firstname ***** -->
            <h:inputText id="firstname" value="#{identifier.user.firstname}">
                <f:validateBean disabled="true"/>
            </h:inputText>
            <h:message style="color: red" for="firstname"/>
            <br/>
            Email:
            <h:inputText id="email" value="#{identifier.user.email}"/>
            <h:message style="color: red" for="email"/>
            <br/>

            <h:commandButton id="Login" value="Login" action="#{identifier.register}"/>
            <br/>
            <h:button id="cancel" value="Cancel" outcome="/home.xhtml"/>
        </f:validateBean>
    </div>
</h:form>

In the future, we want to work with RichFaces so that the constraints declared on the object model are validated in the JSF components on the client side. This is something we had prototyped already and that Pete, Dan and I proposed to the JSF 2 expert group initially but we had to scale down our ambitions :) Expect some innovations from us in this area.

But not all your data comes from the presentation layer.

JPA 2: last line of defense

Again, by default, your JPA 2 provider runs Bean Validation on the entities you are about to persist or update. You are then guaranteed to not put invalid data in your database and thus increasing the quality of your data overall. Oh, and these are the same constraints you would have validated in JSF 2.0.

You can disable validation in JPA 2 using the validation-mode element in persistence.xml or the javax.persistence.validation.mode property and set them to none. More interestingly, you can chose which group will be validated upon entity persist, update and even delete operations. By default, the Default group is validated when you persist or update entities. Use any one of these properties to adjust that.

<property name="javax.persistence.validation.group.pre-persist" 
        value"javax.validation.groups.Default, com.acme.model.Structural"/>
<property name="javax.persistence.validation.group.pre-update" 
        value"javax.validation.groups.Default, com.acme.model.Structural"/>

<property name="javax.persistence.validation.group.pre-delete" 
        value"com.acme.model.SafeDestruct"/>

Hibernate Core and Hibernate Validator go a bit beyond that and propagate the constraints to the database schema (provided that you let Hibernate Core generate or update the schema for you). Simply set the hibernate.hbm2ddl.auto property to create, update or create-drop.

How about my service layer

You can inject a Validator or ValidatorFactory instance in any injectable POJO in Java EE 6.

class SalesService {
  @Inject Validator validator;
  @Inject @Current User user;

  public boolean canBuyInOneClick() {
    return validator.validate(user, BuyInOneClick.class).size() == 0;
  }

Where can I try it?

All of this is now available in JBoss AS 6 M1 that have just been released. Enjoy!

JBossAS5.1.0.GA released

Posted by    |       |    Tagged as JBoss AS

In case you missed the announcement, which is highly possible as I think the main voice behind AS, Dimitris, is driving with his motorcycle across Europe and the US team is enjoying a day off with national holiday.

So, the make the long story short, here is your latest and greatest, JBossAS 5.1.0.GA.

Enjoy!

Fresh 1.0.0.Alpha1 - CLI for JBossAS

Posted by    |       |    Tagged as JBoss AS

I'm proud to present the initial version of Fresh, CLI for JBossAS.

This is definitely not the only CLI developed under our roof (see adminclient repository) but it brings a ton of interesting stuff developed by the people who donated it, my friends from Parsek company, Tomaz Cerar and Marko Strukelj (yes, the one who's responsible for vfszip :-)).

This is the JIRA release issue, where you can learn more about it, download the deployable artifact, etc

A simple user guide can be found here

Any additional ideas can be published here:

Basically the idea is to drop in the jboss-fresh.jar into deploy/ and then connect to it via ssh, port 2022. Currently there is no user/pass, simply press Enter.

Fresh is installed On_Demand, only ssh server deamon is fully installed at the beginning, the rest kicks in when you first connect (thanks Bela for the tip).

Marko and Tomaz already have plans to make this even better, and I'll be there to help with some fancy MC tricks. :-)

Enjoy, any feedback is welcome.

ps: this was also posted on the jboss-dev mailing list, so we can easily continue the discussion there

back to top