Migrating a Java EE 6 app from GlassFish v3 to JBoss 6.0-M5
agoncal Oct 16, 2010 10:07 AMHi,
I've develop a small application that uses most of the Java EE 6 specifications : JPA 2.0, Managed Bean 1.0, Servlet 3.0, EJB 3.1 (with Stateless, Singleton), JAX-RS 1.1, Interceptor 1.1, JSF 2.0 (with composite components) and CDI with @Inject. So, as you can see, even if the application is simple, it uses plenty of Java EE 6 technologies. The code is packaged into a war and deploys on GlassFish 3.0.1 and works well.
As an exercise I now want to see if this code can run on JBoss 6.0-M5 without too many changes (to check portability). I have two problems :
@ApplicationPath with JAX-RS doesn't seem to work
I try to avoid XML as much as I can. So, to have access to my REST resources, I use the following code :
@ApplicationPath("rs")
public class ApplicationConfig extends Application {
}
This way, any URL with rs/* will be interpreted as a RESTful resource. Again, this works fine with GlassFish, but with JBoss I have the following exception :
15:51:09,578 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] deploy, ctxPath=/demo15
15:51:09,593 ERROR [org.apache.catalina.core.StandardContext] Context [/demo15] startup failed due to previous errors: java.lang.IllegalArgumentException: Invalid <url-pattern> rs/* in filter mapping
at org.apache.catalina.core.StandardContext.validateFilterMap(StandardContext.java:2033) [:6.0.0.20100911-M5]
at org.apache.catalina.core.StandardContext.addFilterMap(StandardContext.java:1973) [:6.0.0.20100911-M5]
at org.jboss.web.tomcat.service.deployers.JBossContextConfig.processWebMetaData(JBossContextConfig.java:328) [:6.0.0.20100911-M5]
at org.jboss.web.tomcat.service.deployers.JBossContextConfig.applicationWebConfig(JBossContextConfig.java:211) [:6.0.0.20100911-M5]
at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:409) [:6.0.0.20100911-M5]
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:182) [:6.0.0.20100911-M5]
at org.jboss.web.tomcat.service.deployers.JBossContextConfig.lifecycleEvent(JBossContextConfig.java:206) [:6.0.0.20100911-M5]
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:115) [:6.0.0.20100911-M5]
at org.apache.catalina.core.StandardContext.start(StandardContext.java:3773) [:6.0.0.20100911-M5]
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeployInternal(TomcatDeployment.java:299) [:6.0.0.20100911-M5]
at org.jboss.web.tomcat.service.deployers.TomcatDeployment.performDeploy(TomcatDeployment.java:138) [:6.0.0.20100911-M5]
at org.jboss.web.deployers.AbstractWarDeployment.start(AbstractWarDeployment.java:461) [:6.0.0.20100911-M5]
at org.jboss.web.deployers.WebModule.startModule(WebModule.java:118) [:6.0.0.20100911-M5]
at org.jboss.web.deployers.WebModule.start(WebModule.java:95) [:6.0.0.20100911-M5]
JSF pages are not displayed
Again, without any web.xml, I rely on the defaults, so I use the *.faces extension for my JSF pages. When I hit the url of my page (localhost:8080/demo15/newBook.faces) I have a 404. I've tried several extensions (*.jsf) or path (/faces/*) but I have a 404. In the JSF 2.0 spec (paragraph 11.1.2) it's written that url-patterns /faces/* and *.faces are recommended, but not required. So I'm wondering if this is the case with JBoss or if I need to configure the FacesServlet in a web.xml file
Thanks,
Antonio