6 Replies Latest reply on Oct 29, 2010 2:42 PM by jnovotny

    newbie question, what is wrong with this EAR on JBoss 5.1.0?

    jnovotny Newbie



      I have an EAR file with this structure:




      and application.xml looks like:


          <display-name>CIS ear</display-name>
          <description>ear for CIS</description>


      After I start up JBoss, I get this error:


      14:20:59,326 ERROR [AbstractKernelController] Error installing to PostClassLoader: name=vfszip:/Users/novotny/Software/jboss-5.1.0.GA/server/default/deploy/cis.ear/ state=ClassLoader mode=Manual requiredState=PostClassLoader
      org.jboss.deployers.spi.DeploymentException: Cannot process metadata
          at org.jboss.deployers.spi.DeploymentException.rethrowAsDeploymentException(DeploymentException.java:49)
          at org.jboss.deployment.AnnotationMetaDataDeployer.deploy(AnnotationMetaDataDeployer.java:181)
           .....(more stack trace)...
          at org.jboss.Main$1.run(Main.java:556)
          at java.lang.Thread.run(Thread.java:680)
      Caused by: java.lang.RuntimeException: java.lang.ClassNotFoundException: com.machenergy.jms.CalculationDestinationBean from BaseClassLoader@5c594008{VFSClassLoaderPolicy@677afc95{name=vfszip:/Users/novotny/Software/jboss-5.1.0.GA/server/default/deploy/cis.ear/ domain=ClassLoaderDomain@27a36a2{name=DefaultDomain parentPolicy=BEFORE parent=org.jboss.bootstrap.NoAnnotationURLClassLoader@e76cbf7} roots=[MemoryContextHandler@995938118[path= context=vfsmemory://5c4o13w-nqhf65-gfsplri8-1-gfspmf8b-2b real=vfsmemory://5c4o13w-nqhf65-gfsplri8-1-gfspmf8b-2b],


      But the class not found is in fact in backoffice2.jar which is packed into the EAR file. Why is it not finding it?


      Thanks, Jason

        • 1. Re: newbie question, what is wrong with this EAR on JBoss 5.1.0?
          Francesco Marchioni Apprentice

          JBoss 5 enforces stricter XML configuration files so at first check the correctness of your XML and DTD files.

          If that cannot solve your problem, try to isolate it: for example, try to deploy the EJB standalone and see if it deploys.

          If you get an exception in deploying it, then post your EJB jar structure (jar tvf backoffice2.jar) along with your XML files if used any.

          Hope it helps,



          JBoss tutorials

          • 2. Re: newbie question, what is wrong with this EAR on JBoss 5.1.0?
            jnovotny Newbie

            Hi Francesco,


            Thanks for your help-- I'm trying to just test my EJB standalone and I was able to find another ejb jar sample that does work to compare between the two.



            The one that works has the following jar structure:


            0 Thu Oct 28 16:14:52 PDT 2010 META-INF/
               126 Thu Oct 28 16:14:50 PDT 2010 META-INF/MANIFEST.MF
                 0 Thu Oct 28 13:32:26 PDT 2010 net/
                 0 Thu Oct 28 13:32:26 PDT 2010 net/learntechnology/
                 0 Thu Oct 28 13:32:26 PDT 2010 net/learntechnology/persistence/
                 0 Thu Oct 28 13:32:26 PDT 2010 net/learntechnology/persistence/dao/
                 0 Thu Oct 28 13:32:26 PDT 2010 net/learntechnology/persistence/entity/
                 0 Thu Oct 28 13:32:26 PDT 2010 net/learntechnology/service/
               650 Thu Oct 28 16:08:26 PDT 2010 META-INF/persistence.xml
               433 Thu Oct 28 13:32:26 PDT 2010 net/learntechnology/persistence/dao/UserDAO.class
              1943 Thu Oct 28 16:14:50 PDT 2010 net/learntechnology/persistence/dao/UserDAOBean.class
               761 Thu Oct 28 13:32:26 PDT 2010 net/learntechnology/persistence/entity/BaseEntity.class
              1702 Thu Oct 28 13:32:26 PDT 2010 net/learntechnology/persistence/entity/User.class
              1175 Thu Oct 28 13:32:26 PDT 2010 net/learntechnology/service/UserServiceBean.class
               329 Thu Oct 28 13:32:26 PDT 2010 net/learntechnology/service/UserServiceLocal.class
               332 Thu Oct 28 13:32:26 PDT 2010 net/learntechnology/service/UserServiceRemote.class


            and mine has more classes but its virtually the same... I also carefully analyzed persistence.xml between the two and they are exactly identical except I set a different <persistence-unit name="OurEntityManager">. Otherwise exact same.


            The other weird thing is that when JBoss starts, for the ejb jar that works I notice these log lines:


            16:21:42,099 INFO  [JBossASKernel] Created KernelDeployment for: lt-ejb-jar-1.0-SNAPSHOT.jar
            16:21:42,103 INFO  [JBossASKernel] installing bean: jboss.j2ee:jar=lt-ejb-jar-1.0-SNAPSHOT.jar,name=UserDAOBean,service=EJB3
            16:21:42,103 INFO  [JBossASKernel]   with dependencies:
            16:21:42,103 INFO  [JBossASKernel]   and demands:
            16:21:42,103 INFO  [JBossASKernel]     jboss.ejb:service=EJBTimerService
            16:21:42,103 INFO  [JBossASKernel]     persistence.unit:unitName=#OurEntityManager
            16:21:42,103 INFO  [JBossASKernel]   and supplies:
            16:21:42,103 INFO  [JBossASKernel]     jndi:UserDAOBean/remote
            16:21:42,103 INFO  [JBossASKernel]     Class:net.learntechnology.persistence.dao.UserDAO
            16:21:42,103 INFO  [JBossASKernel]     jndi:UserDAOBean/local-net.learntechnology.persistence.dao.UserDAO
            16:21:42,103 INFO  [JBossASKernel]     jndi:UserDAOBean/local
            16:21:42,104 INFO  [JBossASKernel] Added bean(jboss.j2ee:jar=lt-ejb-jar-1.0-SNAPSHOT.jar,name=UserDAOBean,service=EJB3) to KernelDeployment of: lt-ejb-jar-1.0-SNAPSHOT.jar
            16:21:42,105 INFO  [JBossASKernel] installing bean: jboss.j2ee:jar=lt-ejb-jar-1.0-SNAPSHOT.jar,name=UserServiceBean,service=EJB3
            16:21:42,105 INFO  [JBossASKernel]   with dependencies:
            16:21:42,105 INFO  [JBossASKernel]   and demands:
            16:21:42,105 INFO  [JBossASKernel]     jboss.ejb:service=EJBTimerService
            16:21:42,105 INFO  [JBossASKernel]     jndi:UserDAOBean/local-net.learntechnology.persistence.dao.UserDAO
            16:21:42,105 INFO  [JBossASKernel]   and supplies:
            16:21:42,105 INFO  [JBossASKernel]     Class:net.learntechnology.service.UserServiceRemote
            16:21:42,105 INFO  [JBossASKernel]     jndi:UserServiceBean/remote
            16:21:42,105 INFO  [JBossASKernel]     jndi:UserServiceBean/local
            16:21:42,105 INFO  [JBossASKernel]     Class:net.learntechnology.service.UserServiceLocal
            16:21:42,105 INFO  [JBossASKernel]     jndi:UserServiceBean/remote-net.learntechnology.service.UserServiceRemote
            16:21:42,105 INFO  [JBossASKernel]     jndi:UserServiceBean/local-net.learntechnology.service.UserServiceLocal
            16:21:42,105 INFO  [JBossASKernel] Added bean(jboss.j2ee:jar=lt-ejb-jar-1.0-SNAPSHOT.jar,name=UserServiceBean,service=EJB3) to KernelDeployment of: lt-ejb-jar-1.0-SNAPSHOT.jar
            16:21:42,111 INFO  [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@2806a765{name=jboss.j2ee:jar=lt-ejb-jar-1.0-SNAPSHOT.jar,name=UserDAOBean,service=EJB3_endpoint bean=org.jboss.ejb3.endpoint.deployers.impl.EndpointImpl properties=[container] constructor=null autowireCandidate=true}
            16:21:42,112 INFO  [EJB3EndpointDeployer] Deploy AbstractBeanMetaData@73e24a8f{name=jboss.j2ee:jar=lt-ejb-jar-1.0-SNAPSHOT.jar,name=UserServiceBean,service=EJB3_endpoint bean=org.jboss.ejb3.endpoint.deployers.impl.EndpointImpl properties=[container] constructor=null autowireCandidate=true}
            16:21:42,357 INFO  [PersistenceUnitDeployment] Starting persistence unit persistence.unit:unitName=#OurEntityManager
            16:21:42,575 INFO  [Version] Hibernate Annotations 3.4.0.GA
            16:21:42,601 INFO  [Environment] Hibernate 3.3.1.GA
            16:21:42,620 INFO  [Environment] hibernate.properties not found
            16:21:42,626 INFO  [Environment] Bytecode provider name : javassist
            16:21:42,634 INFO  [Environment] using JDK 1.4 java.sql.Timestamp handling
            16:21:42,787 INFO  [Version] Hibernate Commons Annotations 3.1.0.GA
            16:21:42,794 INFO  [Version] Hibernate EntityManager 3.4.0.GA
            16:21:42,857 INFO  [Ejb3Configuration] Processing PersistenceUnitInfo [
                name: OurEntityManager
            16:21:42,882 WARN  [Ejb3Configuration] Persistence provider caller does not implement the EJB3 spec correctly. PersistenceUnitInfo.getNewTempClassLoader() is null.
            16:21:43,009 INFO  [AnnotationBinder] Binding entity from annotated class: net.learntechnology.persistence.entity.User
            16:21:43,120 INFO  [EntityBinder] Bind entity net.learntechnology.persistence.entity.User on table lt_user
            16:21:43,289 INFO  [Version] Hibernate Validator 3.1.0.GA
            16:21:43,363 INFO  [HibernateSearchEventListenerRegister] Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.
            16:21:43,469 INFO  [ConnectionProviderFactory] Initializing connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
            16:21:43,473 INFO  [InjectedDataSourceConnectionProvider] Using provided datasource
            16:21:43,526 INFO  [SettingsFactory] RDBMS: MySQL, version: 5.1.48
            16:21:43,526 INFO  [SettingsFactory] JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.5 ( Revision: ${svn.Revision} )
            16:21:43,562 INFO  [Dialect] Using dialect: org.hibernate.dialect.MySQLDialect
            16:21:43,576 INFO  [TransactionFactoryFactory] Transaction strategy: org.hibernate.ejb.transaction.JoinableCMTTransactionFactory
            16:21:43,579 INFO  [TransactionManagerLookupFactory] instantiating TransactionManagerLookup: org.hibernate.transaction.JBossTransactionManagerLookup
            16:21:43,582 INFO  [TransactionManagerLookupFactory] instantiated TransactionManagerLookup
            16:21:43,583 INFO  [SettingsFactory] Automatic flush during beforeCompletion(): disabled
            16:21:43,583 INFO  [SettingsFactory] Automatic session close at end of transaction: disabled
            16:21:43,583 INFO  [SettingsFactory] JDBC batch size: 15
            16:21:43,584 INFO  [SettingsFactory] JDBC batch updates for versioned data: disabled
            16:21:43,586 INFO  [SettingsFactory] Scrollable result sets: enabled
            16:21:43,586 INFO  [SettingsFactory] JDBC3 getGeneratedKeys(): enabled
            16:21:43,586 INFO  [SettingsFactory] Connection release mode: auto
            16:21:43,588 INFO  [SettingsFactory] Maximum outer join fetch depth: 2
            16:21:43,588 INFO  [SettingsFactory] Default batch fetch size: 1
            16:21:43,588 INFO  [SettingsFactory] Generate SQL with comments: disabled
            16:21:43,588 INFO  [SettingsFactory] Order SQL updates by primary key: disabled
            16:21:43,588 INFO  [SettingsFactory] Order SQL inserts for batching: disabled
            16:21:43,588 INFO  [SettingsFactory] Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
            16:21:43,592 INFO  [ASTQueryTranslatorFactory] Using ASTQueryTranslatorFactory
            16:21:43,592 INFO  [SettingsFactory] Query language substitutions: {}
            16:21:43,592 INFO  [SettingsFactory] JPA-QL strict compliance: enabled
            16:21:43,592 INFO  [SettingsFactory] Second-level cache: enabled
            16:21:43,592 INFO  [SettingsFactory] Query cache: disabled
            16:21:43,606 INFO  [SettingsFactory] Cache region factory : org.hibernate.cache.impl.bridge.RegionFactoryCacheProviderBridge
            16:21:43,606 INFO  [RegionFactoryCacheProviderBridge] Cache provider: org.hibernate.cache.HashtableCacheProvider
            16:21:43,609 INFO  [SettingsFactory] Optimize cache for minimal puts: disabled
            16:21:43,609 INFO  [SettingsFactory] Cache region prefix: persistence.unit:unitName=#OurEntityManager
            16:21:43,609 INFO  [SettingsFactory] Structured second-level cache entries: disabled
            16:21:43,618 INFO  [SettingsFactory] Statistics: disabled
            16:21:43,621 INFO  [SettingsFactory] Deleted entity synthetic identifier rollback: disabled
            16:21:43,623 INFO  [SettingsFactory] Default entity-mode: pojo
            16:21:43,623 INFO  [SettingsFactory] Named query checking : enabled
            16:21:43,704 INFO  [SessionFactoryImpl] building session factory
            16:21:43,942 INFO  [SessionFactoryObjectFactory] Factory name: persistence.unit:unitName=#OurEntityManager
            16:21:43,944 INFO  [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
            16:21:43,950 INFO  [SessionFactoryObjectFactory] Bound factory to JNDI name: persistence.unit:unitName=#OurEntityManager
            16:21:43,950 WARN  [SessionFactoryObjectFactory] InitialContext did not implement EventContext
            16:21:43,950 INFO  [NamingHelper] JNDI InitialContext properties:{java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory, java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces}
            16:21:44,253 INFO  [SessionSpecContainer] Starting jboss.j2ee:jar=lt-ejb-jar-1.0-SNAPSHOT.jar,name=UserDAOBean,service=EJB3
            16:21:44,276 INFO  [EJBContainer] STARTED EJB: net.learntechnology.persistence.dao.UserDAOBean ejbName: UserDAOBean
            16:21:44,354 INFO  [JndiSessionRegistrarBase] Binding the following Entries in Global JNDI:


                UserDAOBean/local - EJB3.x Default Local Business Interface
                UserDAOBean/local-net.learntechnology.persistence.dao.UserDAO - EJB3.x Local Business Interface


            16:21:44,469 INFO  [SessionSpecContainer] Starting jboss.j2ee:jar=lt-ejb-jar-1.0-SNAPSHOT.jar,name=UserServiceBean,service=EJB3
            16:21:44,471 INFO  [EJBContainer] STARTED EJB: net.learntechnology.service.UserServiceBean ejbName: UserServiceBean



            But I don't see any log lines declaring JBoss found/started my EJBs at all for my ejb jar file... it seems like I'm getting closer but I can't figure out what the difference is!


            Thanks again, Jason

            • 3. Re: newbie question, what is wrong with this EAR on JBoss 5.1.0?
              Francesco Marchioni Apprentice

              The log you are attaching relates to the EJB that is working, right ? I guess so because I can see EJB get deployed.

              Rather I think it would be useful if you post the logs for the backoffice2.jar so we can have a look at exceptions.


              If you cannot find any apparent difference between your EJBs (the one that works and the one that doesn't) check at first if you have compiled and executed the classes using the same environment. (Including in this, the JBoss libraries and the JDK used)



              • 4. Re: newbie question, what is wrong with this EAR on JBoss 5.1.0?
                jnovotny Newbie

                It turns out that's the log for both the EJB that gets deployed and works AND backoffice2.jar... I simply have no idea why backoffice2.jar is not getting picked up and deployed! There are no logs related to backoffice2.jar yet it does have a META-INF/persistence.xml that is virtually identical to the onr jar that is deployed... :-(

                • 5. Re: newbie question, what is wrong with this EAR on JBoss 5.1.0?
                  Wolf-Dieter Fink Master

                  Where the class 'com.machenergy.jms.CalculationDestinationBean' is located?

                  I suppose you use EJB3.

                  Does the backoffice2.jar deploy if you locate it instead of your EAR?

                  Also it might help to append descriptor XML of your jar file.

                  • 6. Re: newbie question, what is wrong with this EAR on JBoss 5.1.0?
                    jnovotny Newbie

                    FIXED! :-)


                    turns out backoffice2.jar has the following packaging structure....


                    10797 Fri Oct 29 11:34:02 PDT 2010 com/machenergy/Blah.class

                        48 Fri Oct 29 10:28:56 PDT 2010 META-INF/jboss.xml
                      2012 Fri Oct 29 10:28:56 PDT 2010 META-INF/mach-logo-black.png
                       469 Fri Oct 29 10:28:56 PDT 2010 META-INF/persistence.xml
                    1871035 Fri Oct 29 11:34:04 PDT 2010 WEB-INF/lib/ChartDirector.jar
                    50231 Fri Oct 29 11:34:04 PDT 2010 WEB-INF/lib/OpenForecast-0.4.0.jar
                    91184 Fri Oct 29 11:34:04 PDT 2010 WEB-INF/lib/commons-net-ftp-2.0.jar
                    75738 Fri Oct 29 11:34:04 PDT 2010 WEB-INF/lib/jep-2.3.1.jar
                    720702 Fri Oct 29 11:34:04 PDT 2010 WEB-INF/lib/jxl.jar
                    435942 Fri Oct 29 11:34:04 PDT 2010 WEB-INF/lib/ostermillerutils_1_06_01.jar


                    but in fact when I put the dependent libs flat like so:


                    1871035 Fri Oct 29 11:34:04 PDT 2010 ChartDirector.jar
                    50231 Fri Oct 29 11:34:04 PDT 2010 OpenForecast-0.4.0.jar
                    91184 Fri Oct 29 11:34:04 PDT 2010 commons-net-ftp-2.0.jar
                    75738 Fri Oct 29 11:34:04 PDT 2010 jep-2.3.1.jar
                    720702 Fri Oct 29 11:34:04 PDT 2010 jxl.jar
                    435942 Fri Oct 29 11:34:04 PDT 2010 ostermillerutils_1_06_01.jar


                    it now works!! Very strange... while it makes sense that a EJB jar wouldn't put dependent jars in WEB-INF/lib (unlike a WAR file) I'm surprised Jboss AS didn't log more informative error messsages....


                    Thanks everyone for the help provided!