me0wster / javamelody

Automatically exported from code.google.com/p/javamelody
0 stars 0 forks source link

Jboss 7.0.2 : Exception starting filter javamelody: java.lang.IllegalStateException: Could not find backup for factory javax.faces.application.ApplicationFactory #204

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. I have added below in my pom.xml

          <!-- javamelody-core -->
        <dependency>
                <groupId>net.bull.javamelody</groupId>
                <artifactId>javamelody-core</artifactId>
                <version>1.35.0</version>
        </dependency>
        <!-- itext, option to add PDF export -->
        <dependency>
                <groupId>com.lowagie</groupId>
                <artifactId>itext</artifactId>
                <version>2.1.7</version>
                <exclusions>
                        <exclusion>
                                <artifactId>bcmail-jdk14</artifactId>
                                <groupId>bouncycastle</groupId>
                        </exclusion>
                        <exclusion>
                                <artifactId>bcprov-jdk14</artifactId>
                                <groupId>bouncycastle</groupId>
                        </exclusion>
                        <exclusion>
                                <artifactId>bctsp-jdk14</artifactId>
                                <groupId>bouncycastle</groupId>
                        </exclusion>
                </exclusions>
        </dependency>

2. Manually installed both JAR files, 

 /home/maven/bin/mvn  install:install-file -Dmaven.repo.local=/home/maven/prod/.m2/repository/ -DgroupId=net.bull.javamelody  -DartifactId=javamelody-core -Dversion=1.35.0 -Dpackaging=jar -Dfile=/home/aalias/javamelody-1.35.0.jar

/home/maven/bin/mvn install:install-file 
-Dmaven.repo.local=/home/aalias/minix/maven/prod/.m2/repository/ 
-DgroupId=org.jrobin  -DartifactId=jrobin -Dversion=1.5.9 -Dpackaging=jar 
-Dfile=/home/aalias/Downloads/jrobin-1.5.9.jar

3. Added Filter and listeners in the web.xml

Now to check this, I compiled and tried to deploy the application and I am 
getting below error. 

<error>

16:44:30,841 SEVERE [javax.faces] (MSC service thread 1-3) Application was not 
properly initialized at startup, could not find Factory: 
javax.faces.application.ApplicationFactory. Attempting to find backup.
16:44:30,841 ERROR 
[org.apache.catalina.core.ContainerBase.[jboss.web].[beta.aalias.phoenix.shipco.
com].[/phoenix]] (MSC service thread 1-3) Exception starting filter javamelody: 
java.lang.IllegalStateException: Could not find backup for factory 
javax.faces.application.ApplicationFactory. 
    at javax.faces.FactoryFinder$FactoryManager.getFactory(FactoryFinder.java:1008) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at javax.faces.FactoryFinder.getFactory(FactoryFinder.java:343) [jboss-jsf-api_2.1_spec-2.0.1.Final.jar:2.0.1.Final]
    at com.sun.faces.config.InitFacesContext.getApplication(InitFacesContext.java:126) [jsf-impl-2.1.3-b02-jbossorg-2.jar:2.1.3-SNAPSHOT]
    at net.bull.javamelody.JsfActionHelper.initJsfActionListener(JsfActionHelper.java:40) [javamelody-core-1.35.1.jar:]
    at net.bull.javamelody.FilterContext.<init>(FilterContext.java:93) [javamelody-core-1.35.1.jar:]
    at net.bull.javamelody.MonitoringFilter.init(MonitoringFilter.java:110) [javamelody-core-1.35.1.jar:]
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:447) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3245) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
    at org.apache.catalina.core.StandardContext.start(StandardContext.java:3836) [jbossweb-7.0.1.Final.jar:7.0.2.Final]
    at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:70) [jboss-as-web-7.0.2.Final.jar:7.0.2.Final]
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.6.0_22]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.6.0_22]
    at java.lang.Thread.run(Thread.java:679) [:1.6.0_22]

</error>

Appreciate your kind advice.

What version of the product are you using? On what application server, JDK,
operating system?

Please provide any additional information below.

Original issue reported on code.google.com by alias....@gmail.com on 27 Mar 2012 at 9:52

GoogleCodeExporter commented 9 years ago
Application server : Jboss 7.0.2

Java: Version:

java version "1.6.0_22"
OpenJDK Runtime Environment (IcedTea6 1.10.4) (rhel-1.42.1.10.4.el6_2-x86_64)
OpenJDK 64-Bit Server VM (build 20.0-b11, mixed mode)

Operating System : Linux

The log I have attached in the previous comment I got when I monitor the server 
log while deploying the application.

[aalias@bdcphoenixappbeta ~]$ tail -f 
/usr/jboss-as-7.0.2.Final/standalone/log/server.log

Original comment by alias....@gmail.com on 27 Mar 2012 at 10:18

GoogleCodeExporter commented 9 years ago
Strange, because the simple call to the method 
"javax.faces.context.FacesContext.getCurrentInstance().getApplication()" throws 
this IllegalArgumentException (the method is called when the MonitoringFilter 
is initialized).

It is a pure JavaEE API, so I am not sure what could be wrong except a 
"configuration" issue in the server or in the webapp.
What version of JSF are you using?
Do you package a specific version of JSF in the war files of the webapp?
Do you run JBoss as standalone or in Eclipse for example?

Anyway, there should not be such an exception in the filter. I think that the 
exception could be swallowed and replaced by a log saying that there will not 
be any monitoring of the JSF actions.

Original comment by evernat@free.fr on 27 Mar 2012 at 2:55

GoogleCodeExporter commented 9 years ago
I have committed a fix in trunk (revision 2692) and it is ready for the next 
release (1.36).
Because there should not be an exception when installing the JSF action 
listener does not work, the exception is catched and replaced by a log (level 
INFO) saying that the jsf action listener is not initialized (and there will 
not be any monitoring of the JSF actions).

If you want, we could then try to find why you have an exception in 
"javax.faces.context.FacesContext.getCurrentInstance().getApplication()" in 
your case.

Original comment by evernat@free.fr on 31 Mar 2012 at 11:58

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Thank so much. Now Java melody is working for us.

Original comment by alias....@gmail.com on 11 Apr 2012 at 10:24