So, in Cay's article, his complaint is the lack of EL and CDI support in Tomcat 6.
Tomcat 7 supports EL 2.2 out of the box, and to use CDI, you simple get the weld-servlet.jar from seam:
The CDI Reference Implementation from JBoss Seam: weld-servlet.jar
That doesn't seem like an overly restrictive requirement to use Tomcat 7 and JSF 2.0?
Just as a side note, I added the above entry to my faces-config.xml file, and got the following runtime error:
Unable to find BeanManager for org.apache.catalina.core.ApplicationContextFacad
Stupid me. The entry is supposed to go in the
web.xml file,
not the
faces-config.xml file. Silly me.
Also, when I tried to use the weld framework without a beans.xml file, I got this error:
java.lang.NullPointerException
org.jboss.weld.context.ForwardingContextual.toString(ForwardingContextual.java:53)
Similarly, without a beans.xml file, I more often than not saw this error too:
Target Unreachable, identifier resolved to null
So, just by putting a blank beans.xml file into the WEB-INF folder seemed to fix it.
By the way, one other problem I had was constantly getting a 404 error message when I ran the program. A few weird things happened. First off, I didn't make my POJO serializable, so make sure your JavaBean implements java.io.Serializable.
I also had a Named and SessionScope class files compiled, created and placed in my classes directory. I have no idea what happened, but I deleted them. After deleting them and implementing java.io.Serializable, things worked. Strange.