Good evening everyone,
I have a Seam 2.0.2 prototype app in which I'm trying to dynamically add functionality at run-time. I wanted to do this by deploying multiple EARs containing EJBs, and looking them up from a host EAR.
To get around the need for serialization, I have each EAR running in the same classloader under JBoss using jboss-app.xml.
However, on startup of each EAR this causes the warning:
2008-09-23 23:35:12,218 WARN [org.jboss.seam.jsf.SeamPhaseListener] There should only be one Seam phase listener per application
Later, this will cause an error when an event is handled
2008-09-23 23:35:20,000 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/protohost]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
...
Caused by: javax.naming.NameNotFoundException: IncludeEJB2 not bound
I believe this is because the host EAR is receiving an event from the included EAR, and is trying to lookup the EJB using the JNDI mapping in components.xml:
<core:init debug="true" jndi-pattern="protohost/#{ejbName}/local"/>
Since the EJB is not from the host EAR, it is using the wrong mapping.
This would still be a warning, but the exception propagates all the way up causing JBoss not to load the host EAR at all.
I believe the warning is more a full blown error, and I see at least one other person has a similar issue with multiple phase listeners causing problems. In that case, it was two Seam WARs in one EAR.
I tried a custom deployment of Seam 2.0.2 for each secondary EAR by not having a WAR in them at all, and using interceptors defined in ejb-jar.xml. Certainly I can imagine Seam being useful even without a WAR. Unfortunately the examples for configuring ejb-jar.xml in the documentation are not working for me - perhaps the 'interceptors' element is illegal under JBoss?
At this point, I am close to giving up on the idea of deploying multiple Seam-enabled EARs into the same ClassLoader. If anyone has any thoughts on the matter, I'd love to hear them.
Thanks!