Note that there are some explanatory texts on larger screens.

plurals
  1. POJBoss AS 7 error: WAR deployment succeeds, EAR deployment fails
    primarykey
    data
    text
    <p>I take the same exact same web application and deploy it as an WAR with no problems. However, same application deployed as EAR fails. Same files, just different deployment. First, look at the WAR:</p> <pre><code>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 </code></pre> <p>Now, here is the EAR. Same files (except for now it has application.xml), just different structure.</p> <pre><code>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 </code></pre> <p>Here's the EJB JAR file:</p> <pre><code>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 </code></pre> <p>Here's the WAR file:</p> <pre><code>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 </code></pre> <p>Here is the application.xml in the EAR deployment:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;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"&gt; &lt;display-name&gt;Webapp-ear&lt;/display-name&gt; &lt;module&gt; &lt;web&gt; &lt;web-uri&gt;Webapp-web-1.0-SNAPSHOT.war&lt;/web-uri&gt; &lt;context-root&gt;/Webapp&lt;/context-root&gt; &lt;/web&gt; &lt;/module&gt; &lt;module&gt; &lt;ejb&gt;Webapp-ejb-1.0-SNAPSHOT.jar&lt;/ejb&gt; &lt;/module&gt; &lt;library-directory&gt;lib&lt;/library-directory&gt; &lt;/application&gt; </code></pre> <p>The WAR deploys without errors, but the EAR fails to be deployed as follows:</p> <pre><code>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 &lt;jar-file&gt;: 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 </code></pre> <p>It's strange that the error is:</p> <p><code>Caused by: java.lang.RuntimeException: JBAS011431: Could not load entity class 'com.webapp.exception.ViewExpiredExceptionExceptionHandler' with PersistenceUnitInfo.getNewTempClassLoader()</code></p> <p>The <code>ViewExpiredExceptionHandler</code> is not an entity, so why would <code>PersistenceUnitInfo</code> try to be loading it?</p> <p>I used the <code>"org.jboss.spec.archetypes:jboss-javaee6-ear-webapp"</code> maven archetype to generate the template and poms for the EAR project and I use maven <code>jboss-as:deploy</code> plugin to deploy the EAR. I am using <code>jboss-as-7.1.0.CR1b</code>.</p> <p>My web.xml is servlet spec 3.0:</p> <pre><code>&lt;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"&gt; </code></pre> <p>What am I not getting here? Please help.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload