JBoss 6.0.0.M4 released – Good News for Weld/CDI Developers

The latest milestone release, M4 of JBoss AS 6 has been released and can be downloaded from the usual place.

This new release adds some important Java EE 6 functionality and fixes a very important bug, JBAS-8024, which effectively stops you from deploying Weld applications to the server.  Weld deployments worked in M2, but stopped working in M3 meaning you had to either use a development snapshot or revert back to M2.

Full release notes for this version are available here.

Post to Twitter Post to Yahoo Buzz Post to Delicious Post to Facebook Post to Reddit

Posted in Java | Tagged , , | Leave a comment

Upgrading RichFaces 4.0.0.A2 to 4.0.0.M1

Last week RichFaces 4.0.0.M1 was released.  If you are using Maven, then its relatively easy to upgrade from Alpha2 to M1. If you’ve not started using RichFaces 4 yet in your applications, then full details of how to install RichFaces in a Maven application are provided on the JBoss Wiki.

To upgrade from A2 to M1, should just be a matter of upgrading the version number in your pom.xml file, cleaning and building your project.  The main thing to note however is that the version number is “4.0.0.20100715-M1″ rather than simply “4.0.0.M1″ as would have been expected. An upgraded version property would therefore read as:

<properties>
  <org.richfaces.ui.version>4.0.0.20100715-M1</org.richfaces.ui.version>
</properties>

After upgrading the version of RichFaces however, I found a problem in that dependencies on org.w3c.css.sac and net.sourceforge.cssparser.cssparser are not properly discovered. Without these additional Jars, the following exception is thrown at runtime:

java.lang.NoClassDefFoundError: org/w3c/css/sac/ErrorHandler
 org.richfaces.resource.ResourceHandlerImpl.createResource
  (ResourceHandlerImpl.java:460)
 org.richfaces.resource.ResourceHandlerImpl.createResource
  (ResourceHandlerImpl.java:483)
 com.sun.faces.renderkit.html_basic.StylesheetRenderer.encodeEnd
  (StylesheetRenderer.java:91)
 javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)
 javax.faces.component.UIComponent.encodeAll(UIComponent.java:1620)
 com.sun.faces.renderkit.html_basic.HeadRenderer.encodeEnd(HeadRenderer.java:93)
 javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)
 javax.faces.component.UIComponent.encodeAll(UIComponent.java:1620)
 javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
 com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView
   (FaceletViewHandlingStrategy.java:380)
 com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
 javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
 com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
 com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
 com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
 javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
 org.jboss.weld.servlet.ConversationPropagationFilter.doFilter
  (ConversationPropagationFilter.java:68)

This can be fixed easily however, by adding the following dependencies into your POM file.

 <dependency>
   <groupId>org.w3c.css</groupId>
   <artifactId>sac</artifactId>
   <version>1.3</version>
 </dependency>
 <dependency>
   <groupId>net.sourceforge.cssparser</groupId>
   <artifactId>cssparser</artifactId>
   <version>0.9.5</version>
 </dependency>

Post to Twitter Post to Yahoo Buzz Post to Delicious Post to Facebook Post to Reddit

Posted in Java | Tagged | Leave a comment

Running JBoss Tools in Eclipse 3.6, Helios

With the release of a new version of Eclipse, its natural to download it and start using it straight away.  One of the main problems doing this however, is that plugins aren’t always guaranteed to work with the new version of Eclipse. This is the case with JBoss Tools.

Fortunately however, you can install the JBoss Tools nightly builds as these are now compatible with Eclipse Helios. The easiest way to install JBoss Tools Nightly on Helios is via the update center at:

http://downloads.jboss.org/jbosstools/nightly/trunk/

When I first attempted to install JBoss Tools on Helios though I got the following error:

An error occurred while installing the items

session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Install, operand=null –> [R]org.mozilla.xpcom 1.9.1.2a, action=org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions.InstallBundleAction).

The artifact file for osgi.bundle,org.mozilla.xpcom,1.9.1.2a was not found.

Eclipse was complaining that xulrunner could not be found.  Unfortunately this is not available for the 64-bit version of Eclipse on Windows, so the simple solution is to download the 32-bit version of Helios and use that instead. When I did this, JBoss Tools installed correctly with no problems.

According to Max Andersen, the JBoss Tools team are going to make installing xulrunner optional (at the expense of the visual page editor), in which case it would be possible to install on a 64-bit JVM.

Post to Twitter Post to Yahoo Buzz Post to Delicious Post to Facebook Post to Reddit

Posted in Java | Tagged , | Leave a comment

Book Review: GlassFish Security by Masoud Kalali

I’ve just posted a review of “GlassFish Security” by Masoud Kalali over on developinjava.com

If you’re interested in security and/or GlassFish, I’d recommend this book.  Check out the review here.

Post to Twitter Post to Yahoo Buzz Post to Delicious Post to Facebook Post to Reddit

Posted in Java | Tagged , | Leave a comment

Developing SOA Composite Applications using POJOs

I’ve just had an article published on the Packt Article Network entitled Developing SOA Applications Using POJOs.  In the article I discuss how to use the POJO Service Engine in GlassFish ESB / OpenESB when creating Composite Applications in NetBeans .

PoJos – Plain Old Java Objects, are, as the name describes, simple, ordinary Java objects. They do not have to be derived from a specific class, nor do they have to implement any specific interfaces. In the modern world of Java EE development where the latest frameworks have made enterprise development easier, wouldn’t it be good if we could develop SOA based applications using PoJos? Fortunately, GlassFish ESB (OpenESB) allows us to do this using the PoJo Service Engine.

In the article I discuss:

  • GlassFish ESB
  • Creating a PoJo and Deploying to GlassFish ESB
  • Creating A SOAP Binding for PoJos
  • Testing the Composite Application

Post to Twitter Post to Yahoo Buzz Post to Delicious Post to Facebook Post to Reddit

Posted in Java | Tagged , , , | Leave a comment

Book Review: Apache MyFaces Trinidad 1.2

I posted a review of Apache MyFaces Trinidad 1.2 over on developinjava.com a few days ago.

I liked this book, in particular how it describes how you can use Trinidad with Seam applications. I summarized the book as:

This book is a good introduction to Apache MyFaces Trinidad 1.2. Packt Publishing describe the book as being written for “Java Developers who are beginners at JSF and experienced web developers who are looking for an introduction into the world of open source JSF technology”. I would agree with this sentiment, but would also recommend prospective readers have at least a basic knowledge of Facelets and Seam before enjoying the book.

You can read the whole review here.

Post to Twitter Post to Yahoo Buzz Post to Delicious Post to Facebook Post to Reddit

Posted in Java | Tagged , , | Leave a comment

EJB 3.1 Support in JBoss 6.0M2 – Building JBoss

JBoss recently announced that initial support for EJB 3.1 will be available in the upcoming JBoss 6.0 M2 application server.

At present, the EJB 3.1 functionality supported is:

  • developing EJBs without declaring interfaces; and
  • deploying EJBs in WAR files

Since JBoss AS 6.0 M2 isn’t currently available, the best way to get it to try out this new finctionality is to check the source out from the JBoss Subversion repository and build the application server.

Building JBoss AS 6.0 from the trunk is very straightforward to build. To checkout and build the code, you need to have Subversion and Maven installed on your development system.

The code can be checked out from the anonymous JBoss Subversion repository:

svn co http://anonsvn.jboss.org/repos/jbossas/trunk

After checking out (which may take up to an hour or more), the source can be built using the build/build.bat (build/build.sh) command or by using Maven.

> cd trunk\build
> mvn clean install

After about 10 minutes or so, you should have a snapshot build of the upcoming JBoss 6.0. The distrbution is placed in the build\target\jboss-6.0.0-SNAPSHOT directory.

> cd target\jboss-6.0.0-SNAPSHOT\bin
> run.bat
Calling E:\Develop\jboss6\trunk\build\target\jboss-6.0.0-SNAPSHOT\bin\run.conf.bat
===============================================================================

JBoss Bootstrap Environment

JBOSS_HOME: E:\Develop\jboss6\trunk\build\target\jboss-6.0.0-SNAPSHOT

JAVA: C:\Program Files\Java\jdk1.6.0_18\bin\java

JAVA_OPTS: -Dprogram.name=run.bat -Xms128M -Xmx512M -XX:MaxPermSize=256M -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Dorg.jboss.resolver.warning=true -server

CLASSPATH: C:\Program Files\Java\jdk1.6.0_18\lib\tools.jar;E:\Develop\jboss6\trunk\build\target\jboss-6.0.0-SNAPSHOT\bin\run.jar

===============================================================================

19:46:47,792 INFO [AbstractJBossASServerBase] Server Configuration:

JBOSS_HOME URL: file:/E:/Develop/jboss6/trunk/build/target/jboss-6.0.0-SNAPSHOT/
Bootstrap: $JBOSS_HOME\server/default/conf/bootstrap.xml
Common Base: $JBOSS_HOME\common/
Common Library: $JBOSS_HOME\common/lib/
Server Name: default
Server Base: $JBOSS_HOME\server/
Server Library: $JBOSS_HOME\server/default/lib/
Server Config: $JBOSS_HOME\server/default/conf/
Server Home: $JBOSS_HOME\server/default/
Server Data: $JBOSS_HOME\server/default/data
Server Log: $JBOSS_HOME\server/default/log/
Server Temp: $JBOSS_HOME\server/default/tmp

19:46:47,855 INFO [AbstractServer] Starting: JBossAS [6.0.0.SNAPSHOT (build: SVNTag=JBoss_6.0.0-SNAPSHOT date=r99956)]

Post to Twitter Post to Yahoo Buzz Post to Delicious Post to Facebook Post to Reddit

Posted in Java | Tagged , , | 4 Comments

Book Review of “JBoss RichFaces 3.3″

Yesterday I posted a review of JBoss RichFaces 3.3 by Demetrio Filocamo. Head on over to developinjava.com to read the full review.

In summary, I liked the book and would recommend it for developers using RichFaces.

Post to Twitter Post to Yahoo Buzz Post to Delicious Post to Facebook Post to Reddit

Posted in Java | Tagged , , | Leave a comment

DZone CDI / Weld Reference Card

It’s good to see that DZone has released another new Refcard, this time on Contexts and Dependency Injection (CDI) and Weld – the CDI reference implementation.

If you’re looking at CDI or Java EE 6, then its worth downloading this Refcard.

Post to Twitter Post to Yahoo Buzz Post to Delicious Post to Facebook Post to Reddit

Posted in Java | Tagged , | Leave a comment

Creating a Weld Project using Maven and NetBeans

Now that the Beta Maven archetypes for Weld (the reference implementation of JSR 299 – Java Contexts and Dependency Injection) have been published in the Maven Central Repository, its easy to create Weld projects using Maven and NetBeans.

Assuming you have NetBeans 6.8 set up with GlassFish v3 server and the Maven plugin, use the following steps to create a new project.

1. Create a new Maven project.

Select “File | New Project” and then choose Maven as the category and “Maven Project” as the project type.

2. Add the Weld Maven Archetypes

On the Maven Archetype screen, press the “Add…” button. This will cause the “Specify archetype details” screen to be displayed. On this screen we can add details of the different Maven archetypes that are currently available for Weld.


There are currently 3 Maven archetypes defined in the catalog.

Artifact Id Description
weld-jsf-servlet-minimal Weld archetype for creating an application using JSF 2.0 and CDI 1.0 for Servlet Containers (Tomcat 6 / Jetty 6)
weld-jsf-jee-minimal Weld archetype for creating a minimal Java EE 6 application using JSF 2.0, CDI 1.0 and EJB 3.1 (persistence unit not included)
weld-jsf-jee Weld archetype for creating a Java EE 6 application using JSF 2.0, CDI 1.0, EJB 3.1 and JPA 2.0 (persistence unit included)

For this example, I’m using weld-jsf-servlet-minimal. Enter the details of the archetype from the catalog into the dialog and press “OK”.

On the following screen, select the archetype you’ve just added and press the “Next” button.

3. Select Project Details
On the final page of the create project wizard, enter the project name, location and base package name for the project and press the “Finish” button.

4. Run the project
Now that we’ve created a sample project, it can easily be executed by right clicking on the project node and selecting the “Run” option. This will open a dialog asking for the default deployment server – select a GlassFish v3 server and press “OK”.

If all is successful, the project should now build and be opened in the default browser.

Post to Twitter Post to Yahoo Buzz Post to Delicious Post to Facebook Post to Reddit

Posted in Java | Tagged , , , , | Leave a comment