1 2 Previous Next 16 Replies Latest reply on Dec 3, 2012 10:16 AM by Rafael Neves

    JBossAS7 JSF 2 support

    jkazakov Newbie

      It may sound as a strange questions, but does JBossAS7 support JSF2?

       

      I am getting the following exception when I deploy JSF2 app: Caused by: java.lang.ClassNotFoundException: javax.faces.component.behavior.ClientBehaviorHolder

       

      When ClientBehaviorHolder is found in jsf-api-2.0.jar

       

      I was deploying application on JBossAS 7.1.0.CR1b.

       

      Thanks, J

        • 1. Re: JBossAS7 JSF 2 support
          Nicklas Karlsson Master

          Yes. Do you have a faces-config.xml? (probably that which the deployer checks for if the JSF libs should be on the apps classpath)

          • 2. Re: JBossAS7 JSF 2 support
            jkazakov Newbie

            Yes, I do have an empty faces-config.xml under WEB-INF:

             

            <faces-config xmlns="http://java.sun.com/xml/ns/javaee"

              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                      xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

                       http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd"

                version="2.0">

             

            </faces-config>

             

            The required libraries should be also in place. At least, I see javax/faces/main/jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar under modules dir. I have tried to replace it and register another JAR (jsf-api-2.0.0-RC.jar) in module.xml, but the result was the same.

             

            The app work perfectly fine on Glassfish 3.1, I was just trying it out on JBoss and was a bit suppriesed with the outcome.

             

            Thanks, J

            • 3. Re: JBossAS7 JSF 2 support
              Nicklas Karlsson Master

              The JSF libs are not bundled in the WAR, are they?

              • 4. Re: JBossAS7 JSF 2 support
                jkazakov Newbie

                No, there are not JSF libs bundled to WAR; just double checked.

                • 5. Re: JBossAS7 JSF 2 support
                  jkazakov Newbie

                  this is my stack trace:

                   

                  16:44:15,317 WARN  [org.jboss.modules] (MSC service thread 1-5) Failed to define class opatopa.faces.component.SvgImportComponent in Module "deployment.opatopa-ear.ear:main" from Service Module Loader: java.lang.LinkageError: Failed to link opatopa/faces/component/SvgImportComponent (Module "deployment.opatopa-ear.ear:main" from Service Module Loader)

                            at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396) [jboss-modules.jar:1.1.0.CR6]

                            at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243) [jboss-modules.jar:1.1.0.CR6]

                            at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73) [jboss-modules.jar:1.1.0.CR6]

                            at org.jboss.modules.Module.loadModuleClass(Module.java:505) [jboss-modules.jar:1.1.0.CR6]

                            at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:182) [jboss-modules.jar:1.1.0.CR6]

                            at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.0.CR6]

                            at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.0.CR6]

                            at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.0.CR6]

                            at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.0.CR6]

                            at org.jboss.as.web.deployment.jsf.JsfAnnotationProcessor.deploy(JsfAnnotationProcessor.java:109)

                            at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]

                            at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

                            at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

                            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [:1.6.0_29]

                            at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_29]

                            at java.lang.Thread.run(Thread.java:680) [:1.6.0_29]

                  Caused by: java.lang.NoClassDefFoundError: javax/faces/component/behavior/ClientBehaviorHolder

                            at java.lang.ClassLoader.defineClass1(Native Method) [:1.6.0_29]

                            at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631) [:1.6.0_29]

                            at java.lang.ClassLoader.defineClass(ClassLoader.java:615) [:1.6.0_29]

                            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141) [:1.6.0_29]

                            at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327) [jboss-modules.jar:1.1.0.CR6]

                            at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391) [jboss-modules.jar:1.1.0.CR6]

                            ... 15 more

                  Caused by: java.lang.ClassNotFoundException: javax.faces.component.behavior.ClientBehaviorHolder from [Module "deployment.opatopa-ear.ear:main" from Service Module Loader]

                            at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190) [jboss-modules.jar:1.1.0.CR6]

                            at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468) [jboss-modules.jar:1.1.0.CR6]

                            at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456) [jboss-modules.jar:1.1.0.CR6]

                            at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:423) [jboss-modules.jar:1.1.0.CR6]

                            at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) [jboss-modules.jar:1.1.0.CR6]

                            at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120) [jboss-modules.jar:1.1.0.CR6]

                            ... 21 more

                  • 6. Re: JBossAS7 JSF 2 support
                    Nicklas Karlsson Master

                    Your EAR file needs the JSF libs? Or am I misinterpreting the stacktrace?

                    • 7. Re: JBossAS7 JSF 2 support
                      jkazakov Newbie

                      Why should it? JBoss AS 7 itself is an implementation of JEE6 spec.

                      • 8. Re: JBossAS7 JSF 2 support
                        Nicklas Karlsson Master

                        Just trying to interpret

                         

                         

                        Caused by: java.lang.ClassNotFoundException: javax.faces.component.behavior.ClientBehaviorHolder from [Module "deployment.opatopa-ear.ear:main" from Service Module Loader]

                        • 9. Re: JBossAS7 JSF 2 support
                          jkazakov Newbie

                          I see. This is what I do not understand, because javax.faces.component.behavior.ClientBehaviorHolder is in modules/javax/faces/main/jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar, which is in the classpath.

                          • 10. Re: JBossAS7 JSF 2 support
                            Stephen Coy Master

                            Hi there,

                            1. Do you have a "normally" packed EAR file? ie. Your EAR file does not contain "exploded" sub-deployments?
                            2. Do you have a servlet spec 3.0 web.xml?
                              <?xml version="1.0" encoding="UTF-8"?>
                              <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
                              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                              xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
                            3. Are you using a jboss-classloading.xml file? If so, what's in it?
                            • 11. Re: JBossAS7 JSF 2 support
                              jkazakov Newbie

                              1. Yes, it is normally packed EAR. This is its structure:

                              --<myapp>.ear

                              ----<myfirstEJB>.jar (contains EJBs)

                              ----<mysecondEJB>.jar (contains EJBs)

                              ----<myfirstWAR>.war (skinny WAR, no JARs in WEB-INF/lib)

                              ----<mysecondWAR>.war (skinny WAR, no JARs in WEB-INF/lib)

                              ----lib (contains all required libs)

                              ----META-INF

                              ------application.xml

                               

                              2. Yes, I have Servlet 3.0 schema declaration in my web.xml files for both WARs.

                               

                              3. No, I am not using  jboss-classloading.xml file.

                              • 12. Re: JBossAS7 JSF 2 support
                                Patrick Garner Newbie

                                I have the same set up i.e. normally packed EAR, Servlet 3.0 schema declaration in web.xml, and I'm not using jboss-classloading.xml.  And I can deploy to Glassfish without exceptions thrown.

                                 

                                $JBOSS_HOME/modules/javax/faces looks like this:

                                `-- api

                                    |-- 1.2

                                    |   |-- jsf-api-1.2_15-jbossorg-2.jar

                                    |   `-- module.xml

                                    `-- main

                                        |-- jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar

                                        |-- jboss-jsf-api_2.1_spec-2.0.0.Beta1.jar.index

                                        `-- module.xml

                                 

                                 

                                 

                                I am able to deploy without ClassNotFoundException when Maven includes jsf-api-2.1.5.jar in the EAR.

                                 

                                 

                                <dependency>

                                    <groupId>com.sun.faces</groupId>

                                    <artifactId>jsf-api</artifactId>

                                    <version>2.1.5</version>

                                </dependency>

                                 

                                EAR structure:

                                .

                                |-- lib

                                |   `-- jsf-api-2.1.5.jar

                                |-- META-INF

                                |   |-- application.xml

                                |   |-- MANIFEST.MF

                                |   `-- maven

                                |       `-- com.patrac

                                |           `-- Patrac-ear

                                |               |-- pom.properties

                                |               `-- pom.xml

                                |-- Patrac-ejb-1.0-SNAPSHOT.jar

                                `-- Patrac-web-1.0-SNAPSHOT.war

                                 

                                 

                                 

                                But when Maven does not include jsf-api-2.1.5.jar in the EAR the ClassNotFoundException is thrown.

                                 

                                <dependency>

                                    <groupId>com.sun.faces</groupId>

                                    <artifactId>jsf-api</artifactId>

                                    <version>2.1.5</version>

                                    <scope>provided</scope>

                                </dependency>

                                 

                                 

                                EAR structure:

                                .

                                |-- META-INF

                                |   |-- application.xml

                                |   |-- MANIFEST.MF

                                |   `-- maven

                                |       `-- com.patrac

                                |           `-- Patrac-ear

                                |               |-- pom.properties

                                |               `-- pom.xml

                                |-- Patrac-ejb-1.0-SNAPSHOT.jar

                                `-- Patrac-web-1.0-SNAPSHOT.war

                                 

                                The stacktrace looks like this:

                                 

                                12:58:26,833 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.subunit."Patrac.ear"."Patrac-ejb-1.0-SNAPSHOT.jar".POST_MODULE: org.jboss.msc.service.StartException in service jboss.deployment.subunit."Patrac.ear"."Patrac-ejb-1.0-SNAPSHOT.jar".POST_MODULE: Failed to process phase POST_MODULE of subdeployment "Patrac-ejb-1.0-SNAPSHOT.jar" of deployment "Patrac.ear"

                                        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:121) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]

                                        at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

                                        at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759) [jboss-msc-1.0.1.GA.jar:1.0.1.GA]

                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0]

                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0]

                                        at java.lang.Thread.run(Thread.java:722) [:1.7.0]

                                Caused by: java.lang.RuntimeException: Error getting reflective information for class com.patrac.data.AcademicYearDataModelProducer with ClassLoader ModuleClassLoader for Module "deployment.Patrac.ear.Patrac-ejb-1.0-SNAPSHOT.jar:main" from Service Module Loader                                                                                                                                                                                                                    

                                        at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:70) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]                                                                    

                                        at org.jboss.as.ee.metadata.MethodAnnotationAggregator.runtimeAnnotationInformation(MethodAnnotationAggregator.java:58)                                                                                                             

                                        at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.handleAnnotations(InterceptorAnnotationProcessor.java:70)                                                                                                     

                                        at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.processComponentConfig(InterceptorAnnotationProcessor.java:117)                                                                                               

                                        at org.jboss.as.ee.component.deployers.InterceptorAnnotationProcessor.deploy(InterceptorAnnotationProcessor.java:54)                                                                                                                

                                        at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:115) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]                                                                                 

                                        ... 5 more                                                                                                                                                                                                                          

                                Caused by: java.lang.NoClassDefFoundError: javax/faces/model/DataModel                                                                                                                                                                      

                                        at java.lang.Class.getDeclaredFields0(Native Method) [:1.7.0]                                                                                                                                                                       

                                        at java.lang.Class.privateGetDeclaredFields(Class.java:2308) [:1.7.0]                                                                                                                                                               

                                        at java.lang.Class.getDeclaredFields(Class.java:1760) [:1.7.0]                                                                                                                                                                      

                                        at org.jboss.as.server.deployment.reflect.ClassReflectionIndex.<init>(ClassReflectionIndex.java:57) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]                                                                                     

                                        at org.jboss.as.server.deployment.reflect.DeploymentReflectionIndex.getClassIndex(DeploymentReflectionIndex.java:66) [jboss-as-server-7.1.0.CR1b.jar:7.1.0.CR1b]                                                                    

                                        ... 10 more                                                                                                                                                                                                                         

                                Caused by: java.lang.ClassNotFoundException: javax.faces.model.DataModel from [Module "deployment.Patrac.ear.Patrac-ejb-1.0-SNAPSHOT.jar:main" from Service Module Loader]                                                                  

                                        at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:190)                                                                                                                                                        

                                        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:468)                                                                                                                                

                                        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:456)                                                                                                                                  

                                        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)                                                                                                                                         

                                        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:120)                                                                                                                                                

                                        ... 15 more                                                                                                                                                                                                                        

                                • 13. Re: JBossAS7 JSF 2 support
                                  Rafael Neves Newbie

                                  I have the same problem, it not have solution?

                                  Jboss 7 not is a good idea for application server?

                                   

                                   

                                  I received this error:

                                  java.lang.ClassNotFoundException: javax.faces.model.DataModel

                                   

                                   

                                  if I using Jboss 5, my project is compiled normally

                                  • 14. Re: JBossAS7 JSF 2 support
                                    Stan Silvert Master

                                    Can someone post an ear (or war) that recreates this problem?  I'd like to figure out what is going on and fix it.

                                     

                                    Stan

                                    1 2 Previous Next