Error installing a war on jboss eap 6.2 with myfaces jsf 1.1

1

The error below occurs when installing the application in jboss. I know it's due to jboss having an implementation of javaserver faces.

11:15:04,601 INFO  [org.apache.catalina.core] (ServerService Thread Pool -- 182) JBWEB001093: The listener org.apache.myfaces.webapp.StartupServletContextListener is already configured for this context, the duplicate definition has been ignored
11:15:04,625 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/myapp]] (ServerService Thread Pool -- 182) JBWEB000285: Error configuring application listener of class com.sun.faces.config.ConfigureListener: java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener from [Module "deployment.MyApp.war:main" from Service Module Loader]
    at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:197) [jboss-modules.jar:1.3.0.Final-redhat-2]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:443) [jboss-modules.jar:1.3.0.Final-redhat-2]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:431) [jboss-modules.jar:1.3.0.Final-redhat-2]
    at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:373) [jboss-modules.jar:1.3.0.Final-redhat-2]
    at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:118) [jboss-modules.jar:1.3.0.Final-redhat-2]
    at org.jboss.as.web.deployment.WebInjectionContainer.newInstance(WebInjectionContainer.java:74) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
    at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3294) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3777) [jbossweb-7.2.2.Final-redhat-1.jar:7.2.2.Final-redhat-1]
    at org.jboss.as.web.deployment.WebDeploymentService.doStart(WebDeploymentService.java:156) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
    at org.jboss.as.web.deployment.WebDeploymentService.access$000(WebDeploymentService.java:60) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
    at org.jboss.as.web.deployment.WebDeploymentService$1.run(WebDeploymentService.java:93) [jboss-as-web-7.3.0.Final-redhat-14.jar:7.3.0.Final-redhat-14]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_67]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_67]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_67]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_67]
    at java.lang.Thread.run(Thread.java:745) [rt.jar:1.7.0_67]
    at org.jboss.threads.JBossThread.run(JBossThread.java:122)
    
asked by anonymous 13.08.2014 / 14:24

2 answers

2

I was able to install the application in jboss but had to do the following:

Add file \ WEB_INF \ jboss-deployment-structure.xml

<jboss-deployment-structure>
   <deployment>
      <exclusions>
        <module name="javax.faces.api"/>
        <module name="com.sun.jsf-impl"/>
      </exclusions>
   </deployment>
</jboss-deployment-structure>

Include the context parameter in web.xml

...
<context-param>
      <param-name>org.jboss.jbossfaces.WAR_BUNDLES_JSF_IMPL</param-name>
      <param-value>true</param-value>
</context-param>
...

This link has helped a lot link

    
13.08.2014 / 17:59
0

Modern versions of application servers already have excellent classpath isolation per project, so it's very unlikely that the problem is related to conflicts between the libraries loaded by your project and those that already exist on the server.

The problem is probably related to this exception:

java.lang.ClassNotFoundException: com.sun.faces.config.ConfigureListener

As answered in this stackoverflow question in English: link

This class is part of Mojarra, which is a concurrent implementation of MyFaces.

It should not be necessary when using MyFaces. The exception may be happening for the following reasons:

- There is a <listener> defined manually in the application's web.xml or in the web-fragmet.xml of some jar within the application, which is referring to this Mojarra class.

- There is somewhere in the classpath a Mojarra .tld file, which may be loading and contain a <listener> also pointing to the Mojarra class.

This exception can be fixed by simply removing these listeners.

    
13.08.2014 / 14:55