-
1. Re: Deploying the Servlet Module in an EAR
pgmjsd Jun 21, 2011 12:09 PM (in response to pgmjsd)Hm... interesting. I copied the stuff in web-fragment.xml into my web.xml, and Seam Servlet started working:
<listener> <display-name>Servlet Event Bridge Listener</display-name> <listener-class>org.jboss.seam.servlet.event.ServletEventBridgeListener</listener-class> </listener> <servlet> <display-name>Servlet Event Bridge Servlet</display-name> <servlet-name>Servlet Event Bridge Servlet</servlet-name> <servlet-class>org.jboss.seam.servlet.event.ServletEventBridgeServlet</servlet-class> <load-on-startup>99999</load-on-startup> </servlet> <filter> <display-name>Servlet Event Bridge Filter</display-name> <filter-name>Servlet Event Bridge Filter</filter-name> <filter-class>org.jboss.seam.servlet.event.ServletEventBridgeFilter</filter-class> </filter> <filter-mapping> <filter-name>Servlet Event Bridge Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <filter> <filter-name>Catch Exception Filter</filter-name> <filter-class>org.jboss.seam.servlet.exception.CatchExceptionFilter</filter-class> </filter> <filter-mapping> <filter-name>Catch Exception Filter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
The EAR contains seam-solder.jar and seam-servlet.jar in it's root directory, and the application.xml looks like this:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd"> <application> <display-name>my-ear</display-name> <description>My Application</description> <module> <java>seam-solder.jar</java> </module> <module> <java>seam-servlet.jar</java> </module> <module> <ejb>my-ejbs.jar</ejb> </module> <module> <web> ... yadda yadda ... </web> </module> </application>
Is this how these modules are supposed to be deployed in an EAR?
-
-
3. Re: Deploying the Servlet Module in an EAR
lightguard Jun 21, 2011 5:49 PM (in response to pgmjsd)Having not tried deployment within an EAR (I see EAR deployments becoming less and less these days anyway) I really can't say. Thank you, though, for doing some research about this. Would you mind if we use this in some documentation?
-
4. Re: Deploying the Servlet Module in an EAR
pgmjsd Jun 21, 2011 10:47 PM (in response to pgmjsd)Sure, go right ahead.
EAR deployment does have some advantage, e.g. JMS destination deployment and app specific logging... Now if I could only get app specific logging in JBoss AS 6 working!
-
5. Re: Deploying the Servlet Module in an EAR
jharting Jun 22, 2011 9:38 AM (in response to pgmjsd)You have run into AS7-623
There's another known workaround (disabling WarClassLoaderDeployer) -
6. Re: Deploying the Servlet Module in an EAR
pgmjsd Jun 22, 2011 10:31 AM (in response to pgmjsd)
Jozef Hartinger wrote on Jun 22, 2011 09:38:
You have run into AS7-623
There's another known workaround (disabling WarClassLoaderDeployer)Aha! Thanks for that. Here's the link to actual workaround. I think I like the second approach better, as it doesn't involve global changes to the JBoss AS deployers.
-
7. Re: Deploying the Servlet Module in an EAR
pgmjsd Jun 22, 2011 2:29 PM (in response to pgmjsd)I tried disabling WarClassLoaderDeployer. The server starts, but the web-fragment.xml resources are still not discovered.
-
8. Re: Deploying the Servlet Module in an EAR
pgmjsd Jun 23, 2011 10:30 AM (in response to pgmjsd)Update: If I keep the EAR/WAR packaging and deploy the seam-servlet and seam-solder modules in WEB-INF/lib (and not in the EAR as Java modules), then I get an exception on startup:
10:13:49,768 ERROR [org.jboss.kernel.plugins.dependency.AbstractKernelController] Error installing to Start: name=vfs:///home/josh/jboss/server/default/deploy/myapp.ear_WeldBootstrapBean state=Create: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [ServletExtension] with qualifiers [@Default] at injection point [[parameter 2] of [method] @Produces @TypedParamValue protected org.jboss.seam.servlet.http.CookieParamProducer.getTypedParamValue(InjectionPoint, ServletExtension)] at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:305) [:6.0.0.Final] at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:139) [:6.0.0.Final] at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:162) [:6.0.0.Final] at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:377) [:6.0.0.Final] at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:363) [:6.0.0.Final] at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:388) [:6.0.0.Final]
If I comment out WarClassLoaderDeployer as per option 1 on this page, then it works fine. The Servlet Module web-fragment.xml is processed.
So basically it looks like there are two workarounds:
- Deploy the Seam modules as <javaModule>s in the EAR. Put the web-fragment.xml content in web.xml.
- Deploy everything in the WAR inside the EAR. Include the Seam modules in WEB-INF/lib. Comment out the WarClassLoaderDeployer.
Added this to my wiki page