0 Replies Latest reply on May 7, 2014 11:06 PM by Ruben Trancoso

    Integrate MyFaces 2.0.20 with JBoss 6 EAP / AS 7

    Ruben Trancoso Newbie

      Trying to make a legacy app with MyFaces + Tomahawk work on JBoss 6 EAP but after setup I get **An error occured while initializing MyFaces: path can not be null**

       

          22:39:14,021 SEVERE [org.apache.myfaces.webapp.AbstractFacesInitializer] (ServerService Thread Pool -- 52) An error occured while initializing MyFaces: path can not be null.: java.lang.NullPointerException: path can not be null.

          at org.apache.myfaces.context.servlet.ServletExternalContextImplBase.checkNull(ServletExternalContextImplBase.java:167) [myfaces-impl-2.0.20.jar:2.0.20]

       

      I expent something about 15 hours with this and going almost crazy with dead lines.... had different result. In this case looks like that neihter tomahawk is loading....

       

      does anyone know how to integrate MyFaces on JB 6 EAP that could help?

       

      will show my setup and full stack from here:

       

      app.ear/EarContent/META-INF/jboss-deployment-structure.xml

       

          <?xml version="1.0" encoding="UTF-8"?>  
          <jboss-deployment-structure>
           <sub-deployment name="sipcs.cobranca.cod.war">
            <dependencies>
             <module name="javax.faces.api" slot="myfaces-2.0.2" />
             <module name="org.apache.myfaces" slot="myfaces-2.0.2" />
             <module name="org.jboss.as.jsf-injection" slot="myfaces-2.0.2" />
            </dependencies>
            <exclusions>
             <module name="javax.faces.api" slot="main" />
             <module name="com.sun.jsf-impl" slot="main" />
             <module name="org.jboss.as.jsf-injection" slot="main" />
            </exclusions>
           </sub-deployment>
          </jboss-deployment-structure>
      

       

       

      D:\Env\jboss-eap-6.1\modules\system\layers\base\javax\faces\api\myfaces-2.0.2\module.xml

       

       

          <module xmlns="urn:jboss:module:1.1" name="javax.faces.api" slot="myfaces-2.0.2" >
           <properties>  
            <property name="jboss.api" value="private"/>  
           </properties> 
         
           <dependencies>
            <module name="javax.el.api" export="true"/>
            <module name="javax.servlet.api" export="true"/>
            <module name="javax.servlet.jsp.api" export="true"/>
            <module name="javax.servlet.jstl.api" export="true"/>
            <module name="javax.validation.api" export="true"/>
           </dependencies>
          
           <resources>
            <resource-root path="myfaces-api-2.0.20.jar"/>
           </resources>
          </module>
      

       

      D:\Env\jboss-eap-6.1\modules\system\layers\base\org\apache\myfaces\myfaces-2.0.2\module.xml

       

       

      <?xml version="1.0" encoding="UTF-8"?>
          <module xmlns="urn:jboss:module:1.1" name="org.apache.myfaces" slot="myfaces-2.0.2" >
           <properties>  
            <property name="jboss.api" value="private"/>  
           </properties>  
          <dependencies>  
           <module name="javax.faces.api" slot="myfaces-2.0.2"/>  
           <module name="javaee.api"/>  
           <module name="javax.servlet.jstl.api"/>
           <module name="org.apache.xerces" services="import"/>  
           <module name="org.apache.xalan" services="import"/> 
           <module name="org.apache.commons.collections"/>  
           <module name="org.apache.commons.codec"/>  
           <module name="org.apache.commons.beanutils"/>  
           <module name="org.apache.commons.digester"/> 
           <module name="org.apache.log4j"/>
          </dependencies> 
          <resources>
           <resource-root path="myfaces-impl-2.0.20.jar"/>
           <resource-root path="tomahawk20-1.1.10.jar"/>
           <resource-root path="tomahawk-sandbox-1.1.6.jar"/>
           <resource-root path="commons-logging-1.1.1.jar"/>
          </resources>
          </module> 
      

       

       

      D:\Env\jboss-eap-6.1\modules\system\layers\base\org\jboss\as\jsf-injection\myfaces-2.0.2\module.xml

       

       

          <?xml version="1.0" encoding="UTF-8"?>  
          
          <module xmlns="urn:jboss:module:1.1" name="org.jboss.as.jsf-injection" slot="myfaces-2.0.2">  
          <properties>  
          <property name="jboss.api" value="private"/>  
          </properties>  
          
          <resources>  
          <!-- Insert resources here -->  
          </resources>  
          
          <dependencies>  
          <module name="org.apache.myfaces" slot="myfaces-2.0.2"/>  
          <module name="javax.api"/>  
          <module name="org.jboss.as.web"/>  
          <module name="javax.servlet.api"/>  
          <module name="org.jboss.logging"/>  
          <module name="javax.faces.api" slot="myfaces-2.0.2"/>  
          </dependencies>  
          </module>  
      

       

       

      Startup log

       

       

          22:39:02,299 INFO  [org.jboss.modules] (main) JBoss Modules version 1.2.0.Final-redhat-1

          22:39:02,478 INFO  [org.jboss.msc] (main) JBoss MSC version 1.0.4.GA-redhat-1

          22:39:02,558 INFO  [org.jboss.as] (MSC service thread 1-8) JBAS015899: Iniciando JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8)

          22:39:03,625 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Encontrado tório da implantação. Crie um arquivo chamado app.ear.ear.dodeploy para aplicar o trigger na implantação

          22:39:03,675 INFO  [org.xnio] (MSC service thread 1-2) XNIO Version 3.0.7.GA-redhat-1

          22:39:03,686 INFO  [org.xnio.nio] (MSC service thread 1-2) XNIO NIO Implementation Version 3.0.7.GA-redhat-1

          22:39:03,697 INFO  [org.jboss.remoting] (MSC service thread 1-2) JBoss Remoting version 3.2.16.GA-redhat-1

          22:39:03,718 INFO  [org.jboss.as.server] (Controller Boot Thread) JBAS015888: Criação de serviço de gerenciamento http usando o socket-binding (management-http)

          22:39:03,881 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 29) JBAS010280: Ativação do subsistema Infinispan.

          22:39:03,976 INFO  [org.jboss.as.jsf] (ServerService Thread Pool -- 35) JBAS012605: As seguintes implantações JSF foram ativadas: [main, 1.2]

          22:39:03,994 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 37) JBAS011800: Ativação do Subsistema de Nomeação

          22:39:04,052 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 42) JBAS013171: Ativação do Subsistema de Segurança

          22:39:04,091 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 46) JBAS015537: Ativação da Extensão WebServices

          22:39:04,095 INFO  [org.jboss.as.security] (MSC service thread 1-2) JBAS013170: Versão =4.0.17.Final-redhat-1 PicketBox Atual

          22:39:04,216 INFO  [org.jboss.as.connector.logging] (MSC service thread 1-3) JBAS010408: Inicialização JCA do Subsistema (IronJacamar 1.0.17.Final-redhat-1)

          22:39:04,291 INFO  [org.jboss.as.naming] (MSC service thread 1-1) JBAS011802: Iniciando o Serviço de Nomeação

          22:39:04,305 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-2) JBAS015400: Sessão de correio limitado [java:jboss/mail/Default]

          22:39:04,403 INFO  [org.jboss.ws.common.management] (MSC service thread 1-6) JBWS022052: Starting JBoss Web Services - Stack CXF Server 4.1.3.Final-redhat-3

          22:39:04,526 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 25) JBAS010403: Implantação do driver compatível-JDBC class org.h2.Driver (versão 1.3)

          22:39:04,869 INFO  [org.apache.coyote.http11] (MSC service thread 1-6) JBWEB003001: Coyote HTTP/1.1 initializing on : http-/0.0.0.0:8080

          22:39:04,933 INFO  [org.apache.coyote.http11] (MSC service thread 1-6) JBWEB003000: Coyote HTTP/1.1 starting on: http-/0.0.0.0:8080

          22:39:05,074 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-1) JBAS015012: Foi iniciado o FileSystemDeploymentService para o diretório D:\Env\jboss-eap-6.1\standalone\deployments

          22:39:05,103 INFO  [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Escutando no 0.0.0.0:4447

          22:39:05,103 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Escutando no 127.0.0.1:9999

          22:39:05,104 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-5) JBAS015876: Iniciando a implantação do "app.ear.ear" (runtime-name: "app.ear.ear")

          22:39:05,209 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015876: Iniciando a implantação do "null" (runtime-name: "app.war")

          22:39:05,306 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Limite da fonte de dados [java:jboss/datasources/ExampleDS]

          22:39:09,768 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: A implantação "deployment.app.ear.ear.app.war" está usando um módulo privado ("javax.faces.api:myfaces-2.0.2") que pode ser alteradp ou removido em versões futuras sem nenhum aviso.

          22:39:09,768 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: A implantação "deployment.app.ear.ear.app.war" está usando um módulo privado ("javax.faces.api:myfaces-2.0.2") que pode ser alteradp ou removido em versões futuras sem nenhum aviso.

          22:39:09,781 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: A implantação "deployment.app.ear.ear.app.war" está usando um módulo privado ("org.apache.myfaces:myfaces-2.0.2") que pode ser alteradp ou removido em versões futuras sem nenhum aviso.

          22:39:09,781 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: A implantação "deployment.app.ear.ear.app.war" está usando um módulo privado ("org.apache.myfaces:myfaces-2.0.2") que pode ser alteradp ou removido em versões futuras sem nenhum aviso.

          22:39:09,783 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: A implantação "deployment.app.ear.ear.app.war" está usando um módulo privado ("org.jboss.as.jsf-injection:myfaces-2.0.2") que pode ser alteradp ou removido em versões futuras sem nenhum aviso.

          22:39:09,784 WARN  [org.jboss.as.dependency.private] (MSC service thread 1-8) JBAS018567: A implantação "deployment.app.ear.ear.app.war" está usando um módulo privado ("org.jboss.as.jsf-injection:myfaces-2.0.2") que pode ser alteradp ou removido em versões futuras sem nenhum aviso.

          22:39:10,859 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-8) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)

          22:39:10,947 INFO  [org.jboss.web] (ServerService Thread Pool -- 52) JBAS018210: Registra o contexto da web: /cobranca

          22:39:10,962 INFO  [org.apache.catalina.core] (ServerService Thread Pool -- 52) JBWEB001093: The listener org.apache.myfaces.webapp.StartupServletContextListener is already configured for this context, the duplicate definition has been ignored

          22:39:11,058 INFO  [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 52) Reading standard config META-INF/standard-faces-config.xml

          22:39:13,661 INFO  [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 52) Reading config : vfs:/D:/Env/jboss-eap-6.1/standalone/deployments/app.ear.ear/app.war/WEB-INF/lib/tomahawk-sandbox-1.1.6.jar/META-INF/faces-config.xml

          22:39:13,683 INFO  [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 52) Reading config : vfs:/D:/Env/jboss-eap-6.1/standalone/deployments/app.ear.ear/app.war/WEB-INF/lib/tomahawk20-1.1.10.jar/META-INF/faces-config.xml

          22:39:13,695 INFO  [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 52) Reading config /WEB-INF/faces-config-beans.xml

          22:39:13,696 INFO  [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 52) Reading config /WEB-INF/faces-config-aplication.xml

          22:39:13,700 INFO  [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 52) Reading config /WEB-INF/faces-config-navigation.xml

          22:39:13,704 INFO  [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 52) Reading config /WEB-INF/faces-config-validation.xml

          22:39:13,707 INFO  [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 52) Reading config /extension/WEB-INF/faces-config-aplication.xml

          22:39:13,712 INFO  [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 52) Reading config /extension/WEB-INF/faces-config-navigation-cobranca.xml

          22:39:13,717 INFO  [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 52) Reading config /extension/WEB-INF/faces-config-navigation-backoffice.xml

          22:39:13,719 INFO  [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 52) Reading config /extension/WEB-INF/faces-config-navigation-atendimento.xml

          22:39:13,721 INFO  [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 52) Reading config /extension/WEB-INF/faces-config-navigation-administration.xml

          22:39:13,723 INFO  [org.apache.myfaces.config.DefaultFacesConfigurationProvider] (ServerService Thread Pool -- 52) Reading config /extension/WEB-INF/faces-config-validation.xml

          22:39:13,791 INFO  [org.hibernate.validator.internal.util.Version] (ServerService Thread Pool -- 52) HV000001: Hibernate Validator 4.3.1.Final-redhat-1

          22:39:13,830 INFO  [org.apache.myfaces.util.ExternalSpecifications] (ServerService Thread Pool -- 52) MyFaces Bean Validation support enabled

          22:39:14,016 INFO  [org.apache.myfaces.config.FacesConfigurator] (ServerService Thread Pool -- 52) Serialization provider : class org.apache.myfaces.shared_impl.util.serial.DefaultSerialFactory

          22:39:14,019 INFO  [org.apache.myfaces.config.annotation.DefaultLifecycleProviderFactory] (ServerService Thread Pool -- 52) Using LifecycleProvider org.apache.myfaces.config.annotation.Tomcat7AnnotationLifecycleProvider

          22:39:14,021 SEVERE [org.apache.myfaces.webapp.AbstractFacesInitializer] (ServerService Thread Pool -- 52) An error occured while initializing MyFaces: path can not be null.: java.lang.NullPointerException: path can not be null.

          at org.apache.myfaces.context.servlet.ServletExternalContextImplBase.checkNull(ServletExternalContextImplBase.java:167) [myfaces-impl-2.0.20.jar:2.0.20]

          at org.apache.myfaces.context.servlet.ServletExternalContextImplBase.getResource(ServletExternalContextImplBase.java:120) [myfaces-impl-2.0.20.jar:2.0.20]

          at org.apache.myfaces.config.FacesConfigValidator.validateNavRule(FacesConfigValidator.java:104) [myfaces-impl-2.0.20.jar:2.0.20]

          at org.apache.myfaces.config.FacesConfigValidator.validateNavRules(FacesConfigValidator.java:94) [myfaces-impl-2.0.20.jar:2.0.20]

          at org.apache.myfaces.config.FacesConfigValidator.validate(FacesConfigValidator.java:84) [myfaces-impl-2.0.20.jar:2.0.20]

          at org.apache.myfaces.config.FacesConfigValidator.validate(FacesConfigValidator.java:67) [myfaces-impl-2.0.20.jar:2.0.20]

          at org.apache.myfaces.webapp.AbstractFacesInitializer.validateFacesConfig(AbstractFacesInitializer.java:382) [myfaces-impl-2.0.20.jar:2.0.20]

          at org.apache.myfaces.webapp.AbstractFacesInitializer.buildConfiguration(AbstractFacesInitializer.java:372) [myfaces-impl-2.0.20.jar:2.0.20]

          at org.apache.myfaces.webapp.Jsp21FacesInitializer.initContainerIntegration(Jsp21FacesInitializer.java:73) [myfaces-impl-2.0.20.jar:2.0.20]

          at org.apache.myfaces.webapp.AbstractFacesInitializer.initFaces(AbstractFacesInitializer.java:143) [myfaces-impl-2.0.20.jar:2.0.20]

          at org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized(StartupServletContextListener.java:117) [myfaces-impl-2.0.20.jar:2.0.20]

          at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3339) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

          at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.0.Final-redhat-1.jar:7.2.0.Final-redhat-1]

          at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

          at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

          at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.2.0.Final-redhat-8.jar:7.2.0.Final-redhat-8]

          at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:439) [rt.jar:1.6.0_45]

          at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303) [rt.jar:1.6.0_45]

          at java.util.concurrent.FutureTask.run(FutureTask.java:138) [rt.jar:1.6.0_45]

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895) [rt.jar:1.6.0_45]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918) [rt.jar:1.6.0_45]

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_45]

          at org.jboss.threads.JBossThread.run(JBossThread.java:122)

         

          22:39:15,130 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 26) JBAS018559: Implantado "app.ear.ear" (runtime-name: "app.ear.ear")

          22:39:15,150 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015961: A interface do gerenciamento ouvindo no http://127.0.0.1:9990/management

          22:39:15,150 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015951: O console de administração ouvindo no http://127.0.0.1:9990

          22:39:15,151 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss EAP 6.1.0.GA (AS 7.2.0.Final-redhat-8) iniciado em 13270ms - Iniciado 773 de serviços 836 (os serviços 62 são passivos ou em demanda)

       

      references:

      - https://community.jboss.org/wiki/HackJBossAS7720FinalToAddMyfaces-2112AsDefaultJsfImplementation

      - http://www.mastertheboss.com/jsf/installing-jsf-22-on-jboss-as-7