Friday, July 06, 2007

Serious Problems with JBoss Seam 1.2.1 and JBoss 4.2.0 GA a workaround

Ok, so you must be reading this or searching for articles like this because at that point you will be a bit - at least annoyed. You have read about JBoss Seam, you like JBoss, you think Seam is really great so you gather all your enthousiasm and try to migrate your app or start your new app.So...

JBoss Application Server : 4.2.0 GA
JBoss Seam Version : 1.2.1 GA

If you by accident haven't googled it, so I have to tell, no the combination above wont work!Yeap!It wont.

If by accident you have bought the excellent book by M.Yuan, then go to page 314 and read all the related info regarding deploying a new Seam enabled application.

I used seam-gen to create a new application, everything worked great, copie the jdbc drivers,created a new project (netbeans compatible), everything was there! I tried to explode or ear deployed and I failed! So i red page 314 or this post on M.Yuan's blog. Fixed faces-config xml, removed the el-api.jar , commented out MyFaces listener . Again explode...and.sorry nothing!

Now new messages regarding classloading, various commons.util classes were missing for example
Exception sending context initialized event to listener instance of class org.jboss.web.jsf.integration.config.JBossJSFConfigureListener
java.lang.NoClassDefFoundError: org/apache/commons/digester/Digester

if you browse through the Jboss JIRA site, you will notice that there is some sort of problem regarding classloading and really the problem is supposed to be fixed on minor updata 4.2.1 GA (this is what I understood). So..what we do!

I dont know if this workaround is the best after a couple of hours after my initial try to explode nice and clean with Seam, I have the first page up and running!
So apart from all the hints on the blog post above by M.Yuan I added the following libraries to the my war folder using the war ant target - i have included

< name="commons-beanutils-1.7.0.jar">
< name="commons-codec-1.3.jar">
< name="commons-collections-3.1.jar">
< name="commons-digester-1.6.jar">
< name="commons-el-1.0.jar">
< name="commons-jci-core-1.0-406301.jar">
< name="commons-jci-janino-2.4.3.jar">
< name="commons-lang-2.1.jar">
Not the commons-logging one!And worked! Probably some of the above are not needed but after a couple of hours Seam and JBoss throwing exceptions in my face, i was a bit tired,when I saw that adding one lib was causing a ClassNotFound on another lib, I though..lets add them all! After some seconds I managed to have Seam intro page with my test application!

I have to admit that is really annoying especially for a new Framework that is tryint to establish it self, lots of people can get really dissapointed by such behaviour. At the same time, downgrading back to JBoss 4.05 it was not an option - I would rather go back to plan B using Struts 1.x.

1)Aaah yeah after lots of exceptions, all of you who develop on a Mac, DONT PANIC when you do the http://localhost:8080/yourAppName/ping.seam eventually ping is not implented properly on the Mac-Mach Java port so..when you invoke this action, you will see on your screen SCARY messages from the underlying java process, indicating some memory address and and C header files. Bliaaaaaaah!

2)There is still a bug in Seam with some facelets and tag libraries system.err messages being logged as ERROR , as I red in some Seam forums they should be logged as INFO.

Anyway I hope my future with seam will be brighter.enough exceptions for today....hope so!

1 comment:

  1. I can understand your frustration man...I just went through the same steps. I was able to reach the main page of the booking application and was able to register, but when I try to login, I get the following ...

    SEVERE: Error Rendering View[/main.xhtml]
    javax.faces.FacesException: javax.el.ELException: /main.xhtml @23,94 value="#{ho
    telSearch.searchString}": Error reading 'searchString' on type org.javassist.tmp
    at javax.faces.component.UIOutput.getValue(

    I was really looking forward to a framework that could unify so many frameworks floating around.