Today, my goal was to integrate Seam functionality into my group’s jsf project. The easiest way seemed to be to create a new project and gradually copy and paste code over to the old project. This would allow us to remove unnecessary or inefficient code that Seam would take care of for us and would let us better learn Seam. Unfortunately, setting up Seam was no walk in the park. Rather than go through every agonizing step that I took to get to an empty Seam project running, I’ll just list some pitfalls and workarounds.
Pitfall #1: Most of the contents of JBossTools 2.1 is incompatible with Eclipse Ganymede 3.4.
- Workaround: Use JBossTools 3.0 or downgrade to Eclipse Europa 3.3
Pitfall #2: Bad JBossTools 3.0 mirror. This was unbearably frustrating because I didn’t even think that that could have been a problem. I ended up installing a slightly newer version of Eclipse 3.4 (SR1) and getting it to install there before reading a note that said that the error I got was most likely due to a bad mirror.
Pitfall #3: java.lang.IllegalStateException: No phase id bound to current thread (make sure you do not have two SeamPhaseListener instances installed) when trying to run a new, empty Seam project. Note that everything is pretty much out-of-the-box at this point. Why didn’t it work?! Seam 2.1.1 (or maybe just 2.1) is sometimes incompatible with JBoss AS 4.2.3.
- Workarounds: Build and use JSF 1.2_10, use JBoss AS 4.2.2, remove jboss-seam from MANIFEST.MF and add it to project classpath manually (doesn’t work, despite what some forums say), download specially modified jsf jars
Pitfall #4: Make sure there is cheap web hosting for the version of JBoss that you select. e.g. JBoss 5.0 is not yet widely supported; better to stick with 4.2 to make sure the code will work for a likely web host.
After about 4 hours of troubleshooting, problem solving, and scouring the web for information, I managed to get an empty Seam project running, using Seam 2.1.1, JBoss 4.2.2, JBossTools 3.0, JSF 1.2_09, and Eclipse 3.4 SR1. It should not take that long. Common mistakes and pitfalls should be well documented on the JBoss and Seam website, especially Pitfall #3.
Now, I can begin the task of moving code over to the new project. Joy of joys.