1 2 Previous Next 26 Replies Latest reply on Feb 6, 2012 5:40 PM by Stephen Coy

    JBoss AS 7 error:  WAR deployment succeeds, EAR deployment fails

    Patrick Garner Newbie

      I take the same exact same web application and deploy it as an WAR wiht no problems.  However, same application deployed as EAR fails.  Same files, just different deployment.  First, look at the WAR:

       

      Webapp.war

      .

      |-- error.xhtml

      |-- index.xhtml

      |-- language.xhtml

      |-- login.xhtml

      |-- META-INF

      |-- register.xhtml

      |-- resources

      |   |-- css

      |   |   `-- layout.css

      |   |-- images

      |   |   `-- logo.png

      |   `-- javascript

      |       `-- detectScreenSize.js

      |-- sendMail.xhtml

      |-- templates

      |   `-- masterLayout.xhtml

      `-- WEB-INF

          |-- beans.xml

          |-- classes

          |   |-- ApplicationResources_es.properties

          |   |-- ApplicationResources.properties

          |   |-- com

          |   |   `-- webapp

          |   |       |-- controller

          |   |       |   |-- auth

          |   |       |   |   |-- ClientInfo.class

          |   |       |   |   |-- LoginModule.class

          |   |       |   |   |-- RBAC.class

          |   |       |   |   |-- SimpleGroup.class

          |   |       |   |   `-- SimplePrincipal.class

          |   |       |   |-- LocaleManager.class

          |   |       |   |-- SendMailBean.class

          |   |       |   |-- UserRegistration.class

          |   |       |   `-- UserRemoval.class

          |   |       |-- data

          |   |       |   `-- UserListProducer.class

          |   |       |-- exception

          |   |       |   |-- ViewExpiredExceptionExceptionHandler.class

          |   |       |   `-- ViewExpiredExceptionExceptionHandlerFactory.class

          |   |       |-- model

          |   |       |   |-- Entity.class

          |   |       |   |-- LoginHistory.class

          |   |       |   |-- Role.class

          |   |       |   |-- User.class

          |   |       |   `-- UserRole.class

          |   |       `-- util

          |   |           |-- Resources.class

          |   |           |-- TimestampAdapter.class

          |   |           `-- Util.class

          |   |-- META-INF

          |   |   |-- beans.xml

          |   |   `-- persistence.xml

          |   `-- ValidationMessages.properties

          |-- faces-config.xml

          |-- jboss-web.xml

          |-- lib

          |   |-- cssparser-0.9.5.jar

          |   |-- guava-r08.jar

          |   |-- richfaces-components-api-4.0.0.Final.jar

          |   |-- richfaces-components-ui-4.0.0.Final.jar

          |   |-- richfaces-core-api-4.0.0.Final.jar

          |   |-- richfaces-core-impl-4.0.0.Final.jar

          |   `-- sac-1.3.jar

          |-- navigation.xml

          `-- web.xml

       

       

       

      Now, here is the EAR.  Same files (except for now it has application.xml), just different structure.

       

      Webapp.ear

       

      .

      |-- META-INF

      |   |-- application.xml

      |   |-- MANIFEST.MF

      |   `-- maven

      |       `-- com.webapp

      |           `-- Webapp-ear

      |               |-- pom.properties

      |               `-- pom.xml

      |-- Webapp-ejb-1.0-SNAPSHOT.jar

      `-- Webapp-web-1.0-SNAPSHOT.war

       

       

      Webapp-ejb-1.0-SNAPSHOT.jar

      .

      |-- ApplicationResources_es.properties

      |-- ApplicationResources.properties

      |-- com

      |   `-- webapp

      |       |-- controller

      |       |   |-- auth

      |       |   |   |-- ClientInfo.class

      |       |   |   |-- LoginModule.class

      |       |   |   |-- RBAC.class

      |       |   |   |-- SimpleGroup.class

      |       |   |   `-- SimplePrincipal.class

      |       |   |-- LocaleManager.class

      |       |   |-- SendMailBean.class

      |       |   |-- UserRegistration.class

      |       |   `-- UserRemoval.class

      |       |-- data

      |       |   `-- UserListProducer.class

      |       |-- exception

      |       |   |-- ViewExpiredExceptionExceptionHandler.class

      |       |   `-- ViewExpiredExceptionExceptionHandlerFactory.class

      |       |-- model

      |       |   |-- Entity.class

      |       |   |-- LoginHistory.class

      |       |   |-- Role.class

      |       |   |-- User.class

      |       |   `-- UserRole.class

      |       `-- util

      |           |-- Resources.class

      |           |-- TimestampAdapter.class

      |           `-- Util.class

      |-- META-INF

      |   |-- beans.xml

      |   |-- MANIFEST.MF

      |   |-- maven

      |   |   `-- com.webapp

      |   |       `-- Webapp-ejb

      |   |           |-- pom.properties

      |   |           `-- pom.xml

      |   `-- persistence.xml

      `-- ValidationMessages.properties

       

       

       

      Webapp-web-1.0-SNAPSHOT.war

      .

      |-- error.xhtml

      |-- index.xhtml

      |-- language.xhtml

      |-- login.xhtml

      |-- META-INF

      |   |-- MANIFEST.MF

      |   `-- maven

      |       `-- com.webapp

      |           `-- Webapp-web

      |               |-- pom.properties

      |               `-- pom.xml

      |-- register.xhtml

      |-- resources

      |   |-- css

      |   |   `-- layout.css

      |   |-- images

      |   |   `-- logo.png

      |   `-- javascript

      |       `-- detectScreenSize.js

      |-- sendMail.xhtml

      |-- templates

      |   `-- masterLayout.xhtml

      `-- WEB-INF

          |-- beans.xml

          |-- faces-config.xml

          |-- jboss-web.xml

          |-- lib

          |   |-- cssparser-0.9.5.jar

          |   |-- guava-r08.jar

          |   |-- richfaces-components-api-4.0.0.Final.jar

          |   |-- richfaces-components-ui-4.0.0.Final.jar

          |   |-- richfaces-core-api-4.0.0.Final.jar

          |   |-- richfaces-core-impl-4.0.0.Final.jar

          |   `-- sac-1.3.jar

          |-- navigation.xml

          `-- web.xml

       

       

      Here is the application.xml in the EAR deployment:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <application 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/application_6.xsd" version="6">

        <display-name>Webapp-ear</display-name>

        <module>

          <web>

            <web-uri>Webapp-web-1.0-SNAPSHOT.war</web-uri>

            <context-root>/Webapp</context-root>

          </web>

        </module>

        <module>

          <ejb>Webapp-ejb-1.0-SNAPSHOT.jar</ejb>

        </module>

        <library-directory>lib</library-directory>

      </application>

       

       

      The WAR deploys without errors, but the EAR fails to be deployed as follows:

       

      17:41:02,059 WARN  [org.jboss.modules] (MSC service thread 1-2) Failed to define class com.webapp.exception.ViewExpiredExceptionExceptionHandler in Module "deployment.Webapp.ear.Webapp-ejb-1.0-SNAPSHOT.jar:main" from Service Module Loader: java.lang.LinkageError: Failed to link com/webapp/exception/ViewExpiredExceptionExceptionHandler (Module "deployment.Webapp.ear.Webapp-ejb-1.0-SNAPSHOT.jar:main" from Service Module Loader)

              at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)

              at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

              at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

              at org.jboss.modules.Module.loadModuleClass(Module.java:505)

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

              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)

              at org.jboss.as.jpa.hibernate4.HibernateAnnotationScanner.getPackagesInJar(HibernateAnnotationScanner.java:92)

              at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:490) [hibernate-entitymanager-4.0.0.Final.jar:4.0.0.Final]

              at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:852) [hibernate-entitymanager-4.0.0.Final.jar:4.0.0.Final]

              at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:597) [hibernate-entitymanager-4.0.0.Final.jar:4.0.0.Final]

              at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72) [hibernate-entitymanager-4.0.0.Final.jar:4.0.0.Final]

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:149) [jboss-as-jpa-7.1.0.CR1b.jar:7.1.0.CR1b]

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:79) [jboss-as-jpa-7.1.0.CR1b.jar:7.1.0.CR1b]

              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.7.0_02]

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

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

      Caused by: java.lang.NoClassDefFoundError: javax/faces/context/ExceptionHandlerWrapper

              at java.lang.ClassLoader.defineClass1(Native Method) [:1.7.0_02]

              at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [:1.7.0_02]

              at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [:1.7.0_02]

              at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

              at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

              ... 20 more

      Caused by: java.lang.ClassNotFoundException: javax.faces.context.ExceptionHandlerWrapper from [Module "deployment.Webapp.ear.Webapp-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)

              ... 25 more

       

      17:41:02,143 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.persistenceunit."Webapp.ear/Webapp-ejb-1.0-SNAPSHOT.jar#PostgresPersistenceUnit": org.jboss.msc.service.StartException in service jboss.persistenceunit."Webapp.ear/Webapp-ejb-1.0-SNAPSHOT.jar#PostgresPersistenceUnit": Failed to start service

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

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

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

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

      Caused by: java.lang.RuntimeException: error trying to scan <jar-file>: vfs:/content/Webapp.ear/Webapp-ejb-1.0-SNAPSHOT.jar/

              at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:855)

              at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:597)

              at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:149)

              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:79)

              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]

              ... 3 more

      Caused by: java.lang.RuntimeException: JBAS011431: Could not load entity class 'com.webapp.exception.ViewExpiredExceptionExceptionHandler' with PersistenceUnitInfo.getNewTempClassLoader()

              at org.jboss.as.jpa.hibernate4.HibernateAnnotationScanner.getPackagesInJar(HibernateAnnotationScanner.java:96)

              at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:490)

              at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:852)

              ... 9 more

      Caused by: java.lang.ClassNotFoundException: com.webapp.exception.ViewExpiredExceptionExceptionHandler from [Module "deployment.Webapp.ear.Webapp-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)

              at org.jboss.as.jpa.hibernate4.HibernateAnnotationScanner.getPackagesInJar(HibernateAnnotationScanner.java:92)

              ... 11 more

       

       

      I used the "org.jboss.spec.archetypes:jboss-javaee6-ear-webapp" maven archetype to generate the template and poms for the EAR project and I use maven jboss-as:deploy plugin to deploy the EAR.  I am using jboss-as-7.1.0.CR1b.

       

      My web.xml is servlet spec 3.0:

       

      <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">

       

       

       

       

      What am I not getting here?  Please help.

        • 1. Re: JBoss AS 7 error:  WAR deployment succeeds, EAR deployment fails
          Stephen Coy Master

          Patrick Garner wrote:

           

          ...

           

          Caused by: java.lang.RuntimeException: JBAS011431: Could not load entity class 'com.webapp.exception.ViewExpiredExceptionExceptionHandler' with PersistenceUnitInfo.getNewTempClassLoader()

                  at org.jboss.as.jpa.hibernate4.HibernateAnnotationScanner.getPackagesInJar(HibernateAnnotationScanner.java:96)

                  at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:490)

                  at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:852)

                  ... 9 more

           

          ...

           

          Is com.webapp.exception.ViewExpiredExceptionExceptionHandler really an entity class?

          1 of 1 people found this helpful
          • 2. Re: JBoss AS 7 error:  WAR deployment succeeds, EAR deployment fails
            Patrick Garner Newbie

            No, it's not:

            public class ViewExpiredExceptionExceptionHandler

                extends ExceptionHandlerWrapper

            {

             

                private final ExceptionHandler wrapped;

             

                public ViewExpiredExceptionExceptionHandler

                (

                    final ExceptionHandler wrapped

                )

                {

                    this.wrapped = wrapped;

                }

             

                @Override

                public ExceptionHandler getWrapped()

                {

                    return this.wrapped;

                }

             

                @Override

                public void handle() throws FacesException

                {

                    for

                    (

                        Iterator<ExceptionQueuedEvent> i =

                            getUnhandledExceptionQueuedEvents().iterator();

                        i.hasNext();

                    )

                    {

                        ExceptionQueuedEvent event = i.next();

                        ExceptionQueuedEventContext context =

                            (ExceptionQueuedEventContext) event.getSource();

                        Throwable t = context.getException();

             

                        //  Here is where we get the actual ViewExpiredException

                        if (t instanceof ViewExpiredException)

                        {

                            FacesContext fc = FacesContext.getCurrentInstance();

                            ExternalContext ec = fc.getExternalContext();

                            Map<String, Object> requestMap = ec.getRequestMap();

                            NavigationHandler nav =

                                    fc.getApplication().getNavigationHandler();

                            try

                            {

                                StringBuilder sb = new StringBuilder

                                (

                                    "Your session expired after "

                                );

                                sb.append

                                (

                                    String.valueOf

                                    (

                                        (

                                            (javax.servlet.http.HttpSession)ec.getSession

                                            (

                                                true

                                            )

                                        )

                                        .getMaxInactiveInterval()/60

                                    )

                                    .split("[.]")[0]

                                );

                                sb.append

                                (

                                    " minutes."

                                );

             

                                sb.append

                                (

                                    "  You will need to log in again."

                                );

             

                                fc.addMessage

                                (

                                    fc.getViewRoot().getClientId(fc),

                                    new FacesMessage(sb.toString())

                                );

             

                                nav.handleNavigation(fc, null, "error");

             

                                fc.renderResponse();

                            }

                            finally

                            {

                                i.remove();

                            }

                            break;

                        }

                    }

                    getWrapped().handle();

                }

            }

            • 3. Re: JBoss AS 7 error:  WAR deployment succeeds, EAR deployment fails
              Stephen Coy Master

              Patrick Garner wrote:

               

              ...

              I used the "org.jboss.spec.archetypes:jboss-javaee6-ear-webapp" maven archetype to generate the template and poms for the EAR project and I use maven jboss-as:deploy plugin to deploy the EAR.  I am using jboss-as-7.1.0.CR1b.

               

              ...

               

              Another user was mis-using the maven jboss-as:deploy plugin and getting weird results. What happens if you manually deploy the EAR by copying it to the "deployments" directory? Make sure that the directory is empty first (aside from any JDBC drivers you may have added).

              • 4. Re: JBoss AS 7 error:  WAR deployment succeeds, EAR deployment fails
                Patrick Garner Newbie

                $ mvn clean package

                $ cp Webapp.Ear $JBOSS_HOME/standalone/deployments

                 

                 

                It gives the same exact error. 

                 

                Caused by: java.lang.RuntimeException: JBAS011431: Could not load entity class 'com.patrac.exception.ViewExpiredExceptionExceptionHandler' with PersistenceUnitInfo.getNewTempClassLoader()

                • 5. Re: JBoss AS 7 error:  WAR deployment succeeds, EAR deployment fails
                  Patrick Garner Newbie

                  When I remove ViewExpiredExceptionHandler and ViewExpiredExceptionHandlerFactory and redeploy I get the following error (can't find javax.faces.event.ActionEvent and javax.faces.context.ExternalContext):

                   

                   

                   

                  19:15:38,211 INFO  [org.jboss.weld] (MSC service thread 1-2) Starting weld service

                  19:15:38,377 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-2) WELD-000119 Not generating any bean definitions from com.patrac.controller.auth.ClientInfo because of underlying class loading error

                  19:15:38,383 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-2) catching: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class com.patrac.controller.auth.ClientInfo

                          at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:152) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:171) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:336) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:81) [jboss-as-weld-7.1.0.CR1b.jar:7.1.0.CR1b]

                          at org.jboss.as.weld.services.WeldService.start(WeldService.java:89) [jboss-as-weld-7.1.0.CR1b.jar:7.1.0.CR1b]

                          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.7.0_02]

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

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

                  Caused by: java.lang.NoClassDefFoundError: Ljavax/faces/context/ExternalContext;

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

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

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

                          at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:102) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.util.reflection.SecureReflections$4.work(SecureReflections.java:99) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.util.reflection.SecureReflections.getDeclaredFields(SecureReflections.java:99) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:153) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:49) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:40) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:355)

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)

                          at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69)

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:393)

                          at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:149) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          ... 11 more

                  Caused by: java.lang.ClassNotFoundException: javax.faces.context.ExternalContext 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)

                          ... 29 more

                   

                  19:15:38,711 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-2) WELD-000119 Not generating any bean definitions from com.patrac.controller.LocaleManager because of underlying class loading error

                  19:15:38,713 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-2) catching: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class com.patrac.controller.LocaleManager

                          at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:152) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:171) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:336) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:81) [jboss-as-weld-7.1.0.CR1b.jar:7.1.0.CR1b]

                          at org.jboss.as.weld.services.WeldService.start(WeldService.java:89) [jboss-as-weld-7.1.0.CR1b.jar:7.1.0.CR1b]

                          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.7.0_02]

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

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

                  Caused by: java.lang.NoClassDefFoundError: javax/faces/event/ActionEvent

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

                          at java.lang.Class.privateGetDeclaredMethods(Class.java:2442) [:1.7.0_02]

                          at java.lang.Class.getDeclaredMethods(Class.java:1808) [:1.7.0_02]

                          at org.jboss.weld.util.reflection.SecureReflections$8.work(SecureReflections.java:172) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.util.reflection.SecureReflections$8.work(SecureReflections.java:169) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.util.reflection.SecureReflections.getDeclaredMethods(SecureReflections.java:169) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:233) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:49) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:40) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:355)

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)

                          at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69)

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:393)

                          at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:149) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          ... 11 more

                  Caused by: java.lang.ClassNotFoundException: javax.faces.event.ActionEvent 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)

                          ... 29 more

                   

                  19:15:38,783 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-2) WELD-000119 Not generating any bean definitions from com.patrac.util.Util because of underlying class loading error

                  19:15:38,791 INFO  [org.jboss.weld.ClassLoading] (MSC service thread 1-2) catching: org.jboss.weld.resources.spi.ResourceLoadingException: Error loading class com.patrac.util.Util

                          at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:152) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.bootstrap.BeanDeployer.addClass(BeanDeployer.java:86) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.bootstrap.BeanDeployer.addClasses(BeanDeployer.java:115) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.bootstrap.BeanDeployment.createBeans(BeanDeployment.java:171) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.bootstrap.WeldBootstrap.deployBeans(WeldBootstrap.java:336) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:81) [jboss-as-weld-7.1.0.CR1b.jar:7.1.0.CR1b]

                          at org.jboss.as.weld.services.WeldService.start(WeldService.java:89) [jboss-as-weld-7.1.0.CR1b.jar:7.1.0.CR1b]

                          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.7.0_02]

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

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

                  Caused by: java.lang.NoClassDefFoundError: javax/faces/event/ActionEvent

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

                          at java.lang.Class.privateGetDeclaredMethods(Class.java:2442) [:1.7.0_02]

                          at java.lang.Class.getDeclaredMethods(Class.java:1808) [:1.7.0_02]

                          at org.jboss.weld.util.reflection.SecureReflections$8.work(SecureReflections.java:172) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.util.reflection.SecureReflections$8.work(SecureReflections.java:169) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:52) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.util.reflection.SecureReflectionAccess.runAndWrap(SecureReflectionAccess.java:63) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.util.reflection.SecureReflections.getDeclaredMethods(SecureReflections.java:169) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.introspector.jlr.WeldClassImpl.<init>(WeldClassImpl.java:233) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.introspector.jlr.WeldClassImpl.of(WeldClassImpl.java:118) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:49) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at org.jboss.weld.resources.ClassTransformer$TransformTypeToWeldClass.apply(ClassTransformer.java:40) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingValueReference.compute(ComputingConcurrentHashMap.java:355)

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.compute(ComputingConcurrentHashMap.java:184)

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingSegment.getOrCompute(ComputingConcurrentHashMap.java:153)

                          at com.google.common.collect.ComputingConcurrentHashMap.getOrCompute(ComputingConcurrentHashMap.java:69)

                          at com.google.common.collect.ComputingConcurrentHashMap$ComputingMapAdapter.get(ComputingConcurrentHashMap.java:393)

                          at org.jboss.weld.resources.ClassTransformer.loadClass(ClassTransformer.java:149) [weld-core-1.1.4.Final.jar:2011-11-22 20:01]

                          ... 11 more

                  Caused by: java.lang.ClassNotFoundException: javax.faces.event.ActionEvent 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)

                          ... 29 more

                   

                  19:15:39,268 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.deployment.unit."Patrac.ear".WeldService: org.jboss.msc.service.StartException in service jboss.deployment.unit."Patrac.ear".WeldService: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [LocaleManager] with qualifiers [@Default] at injection point [[field] @Inject private com.patrac.controller.auth.LoginModule.localeManager]

                          at org.jboss.as.weld.services.WeldService.start(WeldService.java:96)

                          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_02]

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

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

                  Caused by: org.jboss.weld.exceptions.DeploymentException: WELD-001408 Unsatisfied dependencies for type [LocaleManager] with qualifiers [@Default] at injection point [[field] @Inject private com.patrac.controller.auth.LoginModule.localeManager]

                          at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:274)

                          at org.jboss.weld.bootstrap.Validator.validateInjectionPoint(Validator.java:243)

                          at org.jboss.weld.bootstrap.Validator.validateBean(Validator.java:106)

                          at org.jboss.weld.bootstrap.Validator.validateRIBean(Validator.java:126)

                          at org.jboss.weld.bootstrap.Validator.validateBeans(Validator.java:345)

                          at org.jboss.weld.bootstrap.Validator.validateDeployment(Validator.java:330)

                          at org.jboss.weld.bootstrap.WeldBootstrap.validateBeans(WeldBootstrap.java:366)

                          at org.jboss.as.weld.WeldContainer.start(WeldContainer.java:82)

                          at org.jboss.as.weld.services.WeldService.start(WeldService.java:89)

                          ... 5 more

                  • 6. Re: JBoss AS 7 error:  WAR deployment succeeds, EAR deployment fails
                    Stephen Coy Master

                    It's looking a lot like the JBoss EJB deployer can't see JSF classes, which I think would be a bug.

                     

                    Can you reduce your deployment to one that just contains ViewExpiredExceptionHandler and ViewExpiredExceptionHandlerFactory classes and try that?

                     

                    In any event we're going to need input from one of the JBoss devs here.

                    • 7. Re: JBoss AS 7 error:  WAR deployment succeeds, EAR deployment fails
                      Patrick Garner Newbie

                      When I remove all Java class files except for ViewExpiredExceptionHandler and ViewExpiredExceptionHandlerFactory classes I get the following error:

                       

                      19:44:15,212 WARN  [org.jboss.modules] (MSC service thread 1-2) Failed to define class com.patrac.exception.ViewExpiredExceptionExceptionHandler in Module "deployment.Patrac.ear.Patrac-ejb-1.0-SNAPSHOT.jar:main" from Service Module Loader: java.lang.LinkageError: Failed to link com/patrac/exception/ViewExpiredExceptionExceptionHandler (Module "deployment.Patrac.ear.Patrac-ejb-1.0-SNAPSHOT.jar:main" from Service Module Loader)

                              at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:396)

                              at org.jboss.modules.ModuleClassLoader.loadClassLocal(ModuleClassLoader.java:243)

                              at org.jboss.modules.ModuleClassLoader$1.loadClassLocal(ModuleClassLoader.java:73)

                              at org.jboss.modules.Module.loadModuleClass(Module.java:505)

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

                              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)

                              at org.jboss.as.jpa.hibernate4.HibernateAnnotationScanner.getPackagesInJar(HibernateAnnotationScanner.java:92)

                              at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:490) [hibernate-entitymanager-4.0.0.Final.jar:4.0.0.Final]

                              at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:852) [hibernate-entitymanager-4.0.0.Final.jar:4.0.0.Final]

                              at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:597) [hibernate-entitymanager-4.0.0.Final.jar:4.0.0.Final]

                              at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72) [hibernate-entitymanager-4.0.0.Final.jar:4.0.0.Final]

                              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:149) [jboss-as-jpa-7.1.0.CR1b.jar:7.1.0.CR1b]

                              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:79) [jboss-as-jpa-7.1.0.CR1b.jar:7.1.0.CR1b]

                              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.7.0_02]

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

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

                      Caused by: java.lang.NoClassDefFoundError: javax/faces/context/ExceptionHandlerWrapper

                              at java.lang.ClassLoader.defineClass1(Native Method) [:1.7.0_02]

                              at java.lang.ClassLoader.defineClass(ClassLoader.java:791) [:1.7.0_02]

                              at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) [:1.7.0_02]

                              at org.jboss.modules.ModuleClassLoader.doDefineOrLoadClass(ModuleClassLoader.java:327)

                              at org.jboss.modules.ModuleClassLoader.defineClass(ModuleClassLoader.java:391)

                              ... 20 more

                      Caused by: java.lang.ClassNotFoundException: javax.faces.context.ExceptionHandlerWrapper 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)

                              ... 25 more

                       

                      19:44:15,297 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-2) MSC00001: Failed to start service jboss.persistenceunit."Patrac.ear/Patrac-ejb-1.0-SNAPSHOT.jar#PostgresPersistenceUnit": org.jboss.msc.service.StartException in service jboss.persistenceunit."Patrac.ear/Patrac-ejb-1.0-SNAPSHOT.jar#PostgresPersistenceUnit": Failed to start service

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

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

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

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

                      Caused by: java.lang.RuntimeException: error trying to scan <jar-file>: vfs:/content/Patrac.ear/Patrac-ejb-1.0-SNAPSHOT.jar/

                              at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:855)

                              at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:597)

                              at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:72)

                              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:149)

                              at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:79)

                              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]

                              ... 3 more

                      Caused by: java.lang.RuntimeException: JBAS011431: Could not load entity class 'com.patrac.exception.ViewExpiredExceptionExceptionHandler' with PersistenceUnitInfo.getNewTempClassLoader()

                              at org.jboss.as.jpa.hibernate4.HibernateAnnotationScanner.getPackagesInJar(HibernateAnnotationScanner.java:96)

                              at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:490)

                              at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:852)

                              ... 9 more

                      Caused by: java.lang.ClassNotFoundException: com.patrac.exception.ViewExpiredExceptionExceptionHandler 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)

                              at org.jboss.as.jpa.hibernate4.HibernateAnnotationScanner.getPackagesInJar(HibernateAnnotationScanner.java:92)

                              ... 11 more

                       

                      How do we get input from a JBoss dev?

                      • 8. Re: JBoss AS 7 error:  WAR deployment succeeds, EAR deployment fails
                        Stephen Coy Master

                        We wait

                         

                        In the meantime, you should try it with the latest nightly build to see whether it's been fixed or not.

                        • 9. Re: JBoss AS 7 error:  WAR deployment succeeds, EAR deployment fails
                          jaikiran pai Master

                          Please post the output of

                           

                          jar -tf Webapp-ejb-1.0-SNAPSHOT.jar

                           

                          Also post the contents of your application.xml

                          • 10. Re: JBoss AS 7 error:  WAR deployment succeeds, EAR deployment fails
                            Scott Marlow Master

                            I agree it will be interesting to see the exception call stack from the latest nightly build (will be easier to match the exception against the latest code) and the contents of Webapp-ejb-1.0-SNAPSHOT.jar/application.xml.

                             

                            Might also be interesting to enable JPA logging at TRACE level and attach the server.log output (as7/standalong/log/server.log).  See troubleshooting description here https://docs.jboss.org/author/display/AS71/JPA+Reference+Guide to enable that.  Its probably optional at this point though.  Just having the exception call stack from the nightly build (and the output that Jaikiran asked for), will be enough for now.

                             

                            I'm also wondering if the ClassNotFoundException could be ignored, instead of causing the deployment to fail.  I think that would be the last option (to consider), if no other fix comes out of this discussion.  I would prefer to fail the deployment, as the ClassNotFoundException could be on an entity class that is important to be mapped as an entity (otherwise later application attempts to use the entity with JPA will not work). 

                            • 11. Re: JBoss AS 7 error:  WAR deployment succeeds, EAR deployment fails
                              Patrick Garner Newbie

                              [pgarner@localhost Webapp.ear.bak]$ cat ./Webapp-ear/target/Webapp/META-INF/application.xml

                              <?xml version="1.0" encoding="UTF-8"?>

                              <application 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/application_6.xsd" version="6">

                                <display-name>Webapp-ear</display-name>

                                <module>

                                  <web>

                                    <web-uri>Webapp-web-1.0-SNAPSHOT.war</web-uri>

                                    <context-root>/Webapp</context-root>

                                  </web>

                                </module>

                                <module>

                                  <ejb>Webapp-ejb-1.0-SNAPSHOT.jar</ejb>

                                </module>

                                <library-directory>lib</library-directory>

                              </application>

                               

                               

                              [pgarner@localhost target]$ jar -tf Webapp-ejb-1.0-SNAPSHOT.jar

                              META-INF/

                              META-INF/MANIFEST.MF

                              com/

                              com/webapp/

                              com/webapp/util/

                              com/webapp/model/

                              com/webapp/model/typesafeenum/

                              com/webapp/data/

                              com/webapp/controller/

                              com/webapp/controller/auth/

                              com/webapp/exception/

                              ApplicationResources_es.properties

                              com/webapp/util/Resources.class

                              com/webapp/util/TimestampAdapter.class

                              com/webapp/util/Util.class

                              com/webapp/model/User$2.class

                              com/webapp/model/AcademicYear.class

                              com/webapp/model/Entity$3.class

                              com/webapp/model/Role$2.class

                              com/webapp/model/UserRole$1.class

                              com/webapp/model/Role.class

                              com/webapp/model/typesafeenum/FontSize.class

                              com/webapp/model/TimePeriod$2.class

                              com/webapp/model/TimePeriod$3.class

                              com/webapp/model/TimePeriod$1.class

                              com/webapp/model/LoginHistory$2.class

                              com/webapp/model/User$1.class

                              com/webapp/model/UserRole$2.class

                              com/webapp/model/LoginHistory.class

                              com/webapp/model/LoginHistory$3.class

                              com/webapp/model/UserRole.class

                              com/webapp/model/Entity$2.class

                              com/webapp/model/Entity.class

                              com/webapp/model/Entity$1.class

                              com/webapp/model/TimePeriod.class

                              com/webapp/model/Role$1.class

                              com/webapp/model/User$3.class

                              com/webapp/model/User.class

                              com/webapp/model/LoginHistory$1.class

                              com/webapp/data/AcademicYearListProducer$2.class

                              com/webapp/data/AcademicYearListProducer$3.class

                              com/webapp/data/AcademicYearListProducer.class

                              com/webapp/data/AcademicYearListProducer$4.class

                              com/webapp/data/AcademicYearListProducer$5.class

                              com/webapp/data/AcademicYearListProducer$1.class

                              com/webapp/data/UserListProducer.class

                              com/webapp/controller/RichBean.class

                              com/webapp/controller/LocaleManager.class

                              com/webapp/controller/UserRemoval.class

                              com/webapp/controller/UserRegistration.class

                              com/webapp/controller/auth/SimplePrincipal.class

                              com/webapp/controller/auth/SimpleGroup.class

                              com/webapp/controller/auth/RBAC$MenuItem.class

                              com/webapp/controller/auth/LoginModule.class

                              com/webapp/controller/auth/ClientInfo.class

                              com/webapp/controller/auth/RBAC.class

                              com/webapp/controller/auth/LoginModule$LoginFields.class

                              com/webapp/controller/SendMailBean.class

                              com/webapp/exception/EndDateBeforeBeginDateException.class

                              com/webapp/exception/ViewExpiredExceptionExceptionHandlerFactory.class

                              com/webapp/exception/NullArgumentException.class

                              com/webapp/exception/ViewExpiredExceptionExceptionHandler.class

                              ApplicationResources.properties

                              META-INF/beans.xml

                              META-INF/persistence.xml

                              ValidationMessages.properties

                              META-INF/maven/

                              META-INF/maven/com.webapp/

                              META-INF/maven/com.webapp/Webapp-ejb/

                              META-INF/maven/com.webapp/Webapp-ejb/pom.xml

                              META-INF/maven/com.webapp/Webapp-ejb/pom.properties

                              • 12. Re: JBoss AS 7 error:  WAR deployment succeeds, EAR deployment fails
                                Patrick Garner Newbie

                                The root cause of the problem seems to be that if I attempt to reference an object in the faces.context packages the class loader problem occurs.

                                 

                                @Named

                                @SessionScoped

                                public class ClientInfo implements Serializable

                                {

                                /*

                                    TODO:  JBoss AS7 bug????  Any use of ExternalContext or

                                    FacesContext causes a ClassNotFoundException to be thrown.

                                 

                                    Caused by: java.lang.ClassNotFoundException: javax.faces.context.ExternalContext 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)

                                        ... 29 more

                                 

                                 

                                    public void gatherClientInfo(ExternalContext ec) throws LoginException

                                    {

                                        ...

                                    }

                                */

                                }

                                 

                                 

                                Here's another one:

                                 

                                public class Util

                                {

                                /*

                                 

                                    TODO:  JBoss bug???? ActionEvent  ClassNotFoundException??

                                 

                                    public static String getAttribute(ActionEvent event, String name)

                                    {

                                        return (String)event.getComponent().getAttributes().get(name);

                                    }

                                 

                                    public static String getRequestParameter(String name)

                                    {

                                        return (String) FacesContext.getCurrentInstance().getExternalContext()

                                            .getRequestParameterMap().get(name);

                                    }

                                */

                                }

                                 

                                Caused by: java.lang.ClassNotFoundException: javax.faces.event.ActionEvent 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)

                                        ... 29 more

                                 

                                 

                                When I comment out any references to these objects in my code, the web app is successfully deployed.

                                 

                                Another thing I did was to add a dependency to my pom that placed jsf-api.xxx.jar file into the lib directory of Webapp-web-1.0-SNAPSHOT.war and the EAR was able to be deployed without error.  However, when I clicked on CommandLinks in my Facelet views, a NullPointerException would be thrown as follows:

                                 

                                @Named
                                @SessionScoped
                                public class LocaleManager implements Serializable
                                {
                                ...
                                   
                                public void setLanguage(String language)
                                   
                                {
                                       
                                this.locale = new Locale(language);
                                       
                                FacesContext fc = FacesContext.getCurrentInstance();


                                       
                                UIViewRoot uivr = fc.getViewRoot(); <===== NullPointerException

                                        uivr
                                .setLocale(locale);
                                   
                                }
                                }

                                 

                                You can see the details on a question I had about this problem, including the stack trace,  at http://stackoverflow.com/questions/9136108/facescontext-getcurrentinstance-returns-null-within-request-handled-by-facesse

                                • 13. Re: JBoss AS 7 error:  WAR deployment succeeds, EAR deployment fails
                                  jaikiran pai Master

                                  Patrick Garner wrote:

                                   

                                  com/webapp/exception/ViewExpiredExceptionExceptionHandler.class

                                   

                                  and the stacktrace:

                                   

                                  Caused by: java.lang.ClassNotFoundException: com.xxx.exception.ViewExpiredExceptionExceptionHandler from [Module "deployment.xxx.ear.xxx-ejb-1.0-SNAPSHOT.jar:main" from Service Module Loader]

                                   

                                  Is that really a issue or is it because you intentionally changed the jar output to remove company specific information (which is OK, just trying to understand if we have found the problem).

                                  • 14. Re: JBoss AS 7 error:  WAR deployment succeeds, EAR deployment fails
                                    Scott Marlow Master

                                    How do we get input from a JBoss dev?

                                     

                                    http://www.jboss.org/ does talk about the possible ways to get help.  Those of us helping on the community forums, are on an equal basis.  We all have access to the same source code (guide to hacking AS7 code is here).  I'm not sure what you meant exactly by this question but wanted to point this out.  I'm sure you didn't mean any disrespect to those helping you.

                                     

                                    Are you also going to try again with the nightly AS7 build?

                                    1 2 Previous Next