Wednesday, July 1, 2009

JBoss Seam Archetype - now with ICEfaces

Last week I visited Jazoon - and had a great opportunity to see several impressive demos of ICEfaces! Of course I had to immediately get my hands on it, and started to integrate ICEfaces in the JBoss Seam Maven archetype (as described in my previous post).

You can give it a spin by starting a shell and running Maven with the Archetype plugin:

>mvn archetype:generate -DarchetypeCatalog= -DajaxLibrary=icefaces
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
Choose archetype:
1: -> jboss-seam-archetype (Archetype for JBoss Seam Projects)
Choose a number: (1): 1
Define value for serverDir: : [your JBoss 5 server location]
Define value for groupId: : [your groupId]
Define value for artifactId: : [your artifactId]
Define value for version: 1.0-SNAPSHOT: : [your version]
Define value for package: : [your package]
Confirm properties configuration:
serverType: jboss5
ajaxLibrary: icefaces
Y: : y
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------

Make sure you don't misspell "icefaces", this will otherwise screw up the application. No input validation in Maven Archetype yet, but I started looking into it ;-)

Again, change to the project directory and build the project:

>mvn package

Now this also executes a sample unit test (fingers crossed it works this time ;-) - thanks to Oscar for the feedback!

Have fun with it! Anybody mind contributing a decent layout template?


micha said...

I assume you attended one of my talks about ICEfaces at Jazoon, right? If so... thanks for the feedback... :-)

Thomas said...

Sal├╝ Micha! Actually I attended both talks ;-) - great stuff, indeed!

Balz said...

I can only confirm that the ICEfaces architecture fully convinced me when I was at JavaOne... More to come from our side :-)

Tom Sawyer said...

Thanks for the great job posted here.

Have you ever tried DBUnit and MySQL in the application? please advise how to do it. According to my testing, MySQL cannot be configured in the Bootstrap and there is few info. in seam forum.

As for DBUnit, I use the DBUnit version 2.2 provided in seam examples, it does not work either: BinaryUri cannot be initiated.

Thomas said...

Is this a general problem with Seam (does it work with a seam-gen project) or just related to this setup? I haven't tried DBUnit so far, I usually run an in-memory HSQLDB in combination with import.sql.

For a general problem, the Seam forum might be the better place to ask.

Derrick said...

Hey all, I've tried running this and when I get to the mvn package step I get an error when building the webapp because of a failure to read an artifact descriptor due to an access denied to "". Any thoughts on how to resolve this problem? Also, can this be run with richfaces instead of icefaces?

Thomas said...

Hmm, this is quite an old version. We have switched to Seam 3 and JBoss Forge in the meantime.

Looking at the latest Seam 2.3 source, it seems to me that they have changed to Maven now. I'd recommend to checkout the examples - and copying one that fits your needs.

Also, the error you see is releated to the embedded JBoss for testing, which is now replaced with Arquillian:

Derrick said...

Hey Thomas,
Thanks for the quick reply. The reason I had those problems was because the library was deprecated and needed to be switched. However, I am running into 1 other issue. When the project is deploying an error is returned stating the following:

Running TestSuite
java.lang.RuntimeException: Could not create Component:
at org.jboss.seam.init.Initialization.addComponent(
at org.jboss.seam.init.Initialization.installComponents(
at org.jboss.seam.init.Initialization.init(
at org.jboss.seam.mock.AbstractSeamTest.startSeam(
at org.jboss.seam.mock.SeamTest.startSeam(
at mdh.AuthenticatorTest.startSeam(
Caused by: java.lang.IllegalArgumentException: No converter for type: org.drools.RuleBase
at org.jboss.seam.util.Conversions.getConverter(
at org.jboss.seam.Component$ConstantInitialValue.<.init.>(
at org.jboss.seam.Component.getInitialValue(
at org.jboss.seam.Component.getInitialValueHonoringExceptions(
at org.jboss.seam.Component.initInitializers(
at org.jboss.seam.Component.<.init.>(
at org.jboss.seam.Component.<.init.>(
at org.jboss.seam.init.Initialization.addComponent(
... 27 more
Tests run: 7, Failures: 1, Errors: 0, Skipped: 6, Time elapsed: 9.969 sec <<< FAILURE!

Results :

Failed tests:

I saw a similar comment about this issue in the original post; however, they didn't provide instructions on a fix. Thoughts?

Also, please understand the reason I am still using this is because my project is strictly tied to Seam 2.2.1, Maven 3 and Jboss-as 5.1. So far, this has been the closest I have got to getting all three working together. Please email me a response at if you could. Thanks for your help.

Thomas said...

Hi Derrick,

Looks like there is a problem with Drools. If you don't need the rule based security, I'd remove it. AFAIR the reference to Drools can be removed by just deleting the appropriate tag in components.xml.

BTW to your question in the first comment, the archetype uses RichFaces by default if you skip the icefaces parameter.