1 Reply Latest reply on Dec 23, 2013 11:42 AM by luiz_gustavo

    JSF Modularization Fails on JBoss 6.1.0 Final but works on JBoss 7.1.2

    luiz_gustavo

      Hi Guys,

       

      I'd like to start this post apologizing if my problem is a too simple one, but I've read many posts and tutorials til I get here and stuck in a point from where I can't get out.

      My problem started when I tried to deploy a modularized JSF app, as described here: Modular Web Apps with JSF2

      As you can see in the comments (the last ones) of the refered post, I had some problems, but those one were solved. I could make a simple example of a modularized app based on the concept exposed on the refered post, but it only works on JBoss 7.1.2, not in JBoss 6.1.0. So I'm discarding a problem in the application and assuming the problem is in JBoss 6.1.0.

      As long as JBoss 6 already supports JSF 2 (it uses by default 2.0.3) the example should work, am I wrong?.

      I read about a bug that was noticed in Mojarra 2.0.3, and updated the JBoss implementation of Mojarra, as detailed here (Jboss 6 upgrading JSF): http://entjavastuff.blogspot.com.br/2010/07/migrating-to-jboss-51-from-jboss-42x.html. I used Mojarra 2.1.9. Even with this update it doesn't work properly.

       

      I attached the exemple projects. Here you can see the projects:

       

      mainapp.png

       

      modules.png

       

       

      When the main application is executed on JBoss 6.1.0 I get this exception when trying to access the modules pages:

       

       

      com.sun.faces.context.FacesFileNotFoundException: /modulo1.xhtml Not Found in ExternalContext as a Resource

      com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:232)

      com.sun.faces.facelets.impl.DefaultFaceletFactory.resolveURL(DefaultFaceletFactory.java:273)

      com.sun.faces.facelets.impl.DefaultFaceletFactory.getMetadataFacelet(DefaultFaceletFactory.java:209)

      com.sun.faces.application.view.ViewMetadataImpl.createMetadataView(ViewMetadataImpl.java:114)

      com.sun.faces.lifecycle.RestoreViewPhase.execute(RestoreViewPhase.java:233)

      com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)

      com.sun.faces.lifecycle.RestoreViewPhase.doPhase(RestoreViewPhase.java:116)

      com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)

      javax.faces.webapp.FacesServlet.service(FacesServlet.java:593)

       

       

      I'd really like to continue using JBoss 6.1.0, 'cause moving to JBoss 7 now would require a time I don't have at the moment.

       

      Any ideas of what's going wrong? Any help is appreciated.

        • 1. Re: JSF Modularization Fails on JBoss 6.1.0 Final but works on JBoss 7.1.2
          luiz_gustavo

          Hi!

           

          As suggested in this post I created a class that extends ResourceResolver in the main application, and configured it as a FACELETS_RESOURCE_RESOLVER in the web.xml file. Now the whole example works on JBoss 6.1.0. I didn't even need to update JBoss' JSF implementation to 2.1.9, so the example is runing on 2.0.3:

           

           

          14:33:06 INFO  (StdSchedulerFactory.java:1275) Quartz scheduler 'JBossQuartzScheduler' initialized from an externally opened InputStream.

          14:33:06 INFO  (StdSchedulerFactory.java:1279) Quartz scheduler version: 1.8.3

          14:33:06 INFO  (QuartzScheduler.java:497) Scheduler JBossQuartzScheduler_$_NON_CLUSTERED started.

          14:33:06 INFO  (ConnectionFactoryBindingService.java:160) Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=DefaultDS' to JNDI name 'java:DefaultDS'

          14:33:06 INFO  (ConnectionFactoryBindingService.java:160) Bound ConnectionManager 'jboss.jca:service=ConnectionFactoryBinding,name=JmsXA' to JNDI name 'java:JmsXA'

          14:33:06 INFO  (org.jboss.xnio.Xnio:94) XNIO Version 2.1.0.CR2

          14:33:06 INFO  (NioXnio.java:94) XNIO NIO Implementation Version 2.1.0.CR2

          14:33:07 INFO  (EndpointImpl.java:73) JBoss Remoting version 3.1.0.Beta2

          14:33:07 INFO  (TomcatDeployment.java:160) deploy, ctxPath=/

          14:33:07 INFO  (TomcatDeployment.java:160) deploy, ctxPath=/modularapp

          14:33:07 INFO  (ConfigureListener.java:202) Inicializando Mojarra 2.0.3 ( b05) para o contexto '/modularapp'

          14:33:08 INFO  (JULLogDelegate.java:83) trying to deploy queue jms.queue.DLQ

          14:33:08 INFO  (JULLogDelegate.java:83) trying to deploy queue jms.queue.ExpiryQueue

          14:33:08 INFO  (LogService.java:47) Removing bootstrap log handlers

          14:33:09,032 45    INFO  [org.jboss.bootstrap.impl.base.server.AbstractServer] (AbstractServer.java:423) JBossAS [6.1.0.Final "Neo"] Started in 16s:992ms

           

          In the same post is stated that "since Servlet 3.0 and newer JBoss/JSF 2.0 versions, the whole ResourceResolver approach is not necessary if you keep the files in /META-INF/resources folder. The above ResourceResolver is only mandatory in Servlet 2.5 or older JBoss/JSF versions because they've bugs in META-INF resource resolving".

           

          So, as long as I can see, JBoss 6.1.0 version is still suffering of this bug, and it is not related just with Mojarra's version, since the error still happened when I was running it with Mojarra 2.1.9.