8 Replies Latest reply on Jul 6, 2012 9:04 AM by sergiu_pienar

    Problem while Jboss migration from 4.2 to 7.1

    bajrang_asthana

      I am getting very strange error while deploying Seam project (.ear file) in JBoss 7.1.

       

      I have mentioned some of the errors below -

       

      18:09:40,472 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-1) MSC00001: Failed to start service jboss.deployment.subunit."protectoria.ear"."app.jar".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."protectoria.ear"."app.jar".INSTALL: Failed to process phase INSTALL of subdeployment "app.jar" of deployment "protectoria.ear"

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:119) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

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

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

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

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

          at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21]

      Caused by: javax.persistence.PersistenceException: JBAS011466: PersistenceProvider '

            org.hibernate.ejb.HibernatePersistence

          ' not found

          at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.lookupProvider(PersistenceUnitDeploymentProcessor.java:555)

          at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deployPersistenceUnit(PersistenceUnitDeploymentProcessor.java:295)

          at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.addPuService(PersistenceUnitDeploymentProcessor.java:258)

          at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.handleJarDeployment(PersistenceUnitDeploymentProcessor.java:145)

          at org.jboss.as.jpa.processor.PersistenceUnitDeploymentProcessor.deploy(PersistenceUnitDeploymentProcessor.java:120)

          at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:113) [jboss-as-server-7.1.1.Final.jar:7.1.1.Final]

          ... 5 more

       

      18:09:40,659 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/protectoria]] (MSC service thread 1-2) Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener: java.lang.NoClassDefFoundError: org/dom4j/io/SAXReader

          at org.jboss.seam.util.XML.getRootElement(XML.java:13) [jboss-seam.jar:1.2.1.GA-protectoria_JBSEAM-1323_patch]

          at org.jboss.seam.init.Initialization.initComponentsFromXmlDocuments(Initialization.java:115) [jboss-seam.jar:1.2.1.GA-protectoria_JBSEAM-1323_patch]

          at org.jboss.seam.init.Initialization.create(Initialization.java:89) [jboss-seam.jar:1.2.1.GA-protectoria_JBSEAM-1323_patch]

          at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:33) [jboss-seam.jar:1.2.1.GA-protectoria_JBSEAM-1323_patch]

          at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]

          at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

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

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

          at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21]

      Caused by: java.lang.ClassNotFoundException: org.dom4j.io.SAXReader from [Module "deployment.protectoria.ear: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.performLoadClassChecked(ConcurrentClassLoader.java:423)

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

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

          ... 12 more

       

      18:09:40,690 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/protectoria]] (MSC service thread 1-2) Exception sending context initialized event to listener instance of class no.messageman.protectoria.core.contextlistener.InitializeGlobalContext: java.lang.NullPointerException

          at java.util.Properties$LineReader.readLine(Properties.java:418) [rt.jar:1.6.0_21]

          at java.util.Properties.load0(Properties.java:337) [rt.jar:1.6.0_21]

          at java.util.Properties.load(Properties.java:325) [rt.jar:1.6.0_21]

          at no.messageman.protectoria.core.contextlistener.InitializeGlobalContext.createMessages(InitializeGlobalContext.java:421) [app.jar:]

          at no.messageman.protectoria.core.contextlistener.InitializeGlobalContext.contextInitialized(InitializeGlobalContext.java:179) [app.jar:]

          at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]

          at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

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

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

          at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21]

       

      18:09:40,706 ERROR [no.messageman.protectoria.core.finder.ProtectoriaLookup] (MSC service thread 1-2) Lookup failed for class protectoria/RBACHandler/local: javax.naming.NameNotFoundException: protectoria/RBACHandler/local -- service jboss.naming.context.java.protectoria.RBACHandler.local

          at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)

          at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:113)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:214)

          at javax.naming.InitialContext.lookup(InitialContext.java:392) [rt.jar:1.6.0_21]

          at no.messageman.protectoria.core.finder.ProtectoriaLookup.getRBACHandler(ProtectoriaLookup.java:361) [app.jar:]

          at no.messageman.protectoria.core.security.CacheResourceRoleMapping.contextInitialized(CacheResourceRoleMapping.java:55) [app.jar:]

          at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]

          at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

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

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

          at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21]

       

      18:09:40,722 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/protectoria]] (MSC service thread 1-2) Exception sending context initialized event to listener instance of class no.messageman.protectoria.core.security.CacheResourceRoleMapping: java.lang.RuntimeException: javax.naming.NameNotFoundException: protectoria/RBACHandler/local -- service jboss.naming.context.java.protectoria.RBACHandler.local

          at no.messageman.protectoria.core.finder.ProtectoriaLookup.getRBACHandler(ProtectoriaLookup.java:366) [app.jar:]

          at no.messageman.protectoria.core.security.CacheResourceRoleMapping.contextInitialized(CacheResourceRoleMapping.java:55) [app.jar:]

          at org.apache.catalina.core.StandardContext.contextListenerStart(StandardContext.java:3392) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardContext.start(StandardContext.java:3850) [jbossweb-7.0.13.Final.jar:]

          at org.jboss.as.web.deployment.WebDeploymentService.start(WebDeploymentService.java:90) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)

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

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

          at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21]

      Caused by: javax.naming.NameNotFoundException: protectoria/RBACHandler/local -- service jboss.naming.context.java.protectoria.RBACHandler.local

          at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)

          at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:113)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:214)

          at javax.naming.InitialContext.lookup(InitialContext.java:392) [rt.jar:1.6.0_21]

          at no.messageman.protectoria.core.finder.ProtectoriaLookup.getRBACHandler(ProtectoriaLookup.java:361) [app.jar:]

          ... 9 more

       

      If anyone has faced such exceptions/errors. Please help with your suggestions.

        • 1. Re: Problem while Jboss migration from 4.2 to 7.1
          liuliu

          if you use lookup in your project, i think the jndi name changed in jboss as 7.

          • 2. Re: Problem while Jboss migration from 4.2 to 7.1
            sergiu_pienar

            Check this : https://docs.jboss.org/author/display/AS7/How+do+I+migrate+my+application+from+AS5+or+AS6+to+AS7

             

             

            The Update application JNDI namespace names section.

            • 3. Re: Problem while Jboss migration from 4.2 to 7.1
              bajrang_asthana

              Thanks for Reply.

               

              I have changed the jndi pattern -

               

              1. in components.xml

               

              from

              <core:init

                      jndi-pattern="protectoria/#{ejbName}/local"

                      debug="true" />

              To

              <core:init

                      jndi-pattern="java:app/protectoria/#{ejbName}/local"

                      debug="true" />

              2.  Also changed in the class that I am using for lookup to-

               

                        context = new InitialContext();

                          ISeamDelegate deligate = (ISeamDelegate) context.lookup("java:app/protectoria/SeamDelegate/local");

              But still I am getting the same errors.

              • 4. Re: Problem while Jboss migration from 4.2 to 7.1
                sergiu_pienar

                AFAIK JBoss 7 does not allow custom JNDI names at this moment so it's likely that your EJB's are not bound to java:app/protectoria/SeamDelegate/local but to something like java:app/protectoria/SeamDelegate!SeamDelegateLocal .

                 

                Check your console at startup (the names under which the EJB's are bound should be displayed).

                 

                Sergiu

                • 5. Re: Problem while Jboss migration from 4.2 to 7.1
                  bajrang_asthana

                  Thanks!

                   

                  I saw in server's log file and found below information-

                   

                  19:53:14,262 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named SeamDelegate in deployment unit subdeployment "app.jar" of deployment "protectoria.ear" are as follows:

                   

                      java:global/protectoria/app.jar/SeamDelegate!no.messageman.protectoria.core.web.ISeamDelegate

                      java:app/app.jar/SeamDelegate!no.messageman.protectoria.core.web.ISeamDelegate

                      java:module/SeamDelegate!no.messageman.protectoria.core.web.ISeamDelegate

                      java:global/protectoria/app.jar/SeamDelegate

                      java:app/app.jar/SeamDelegate

                      java:module/SeamDelegate

                  So what pattern should I use in  components.xml file (may be this will be different for all session beans) and in class which I use for lookup?

                   

                  Please suggest

                  • 6. Re: Problem while Jboss migration from 4.2 to 7.1
                    sergiu_pienar

                    Here's my 2 cents on the look-up string :

                     

                    <core:init

                            jndi-pattern="java:app/protectoria/#{ejbName}!no.messageman.protectoria.core.web.ISeamDelegate"

                            debug="true" />

                     

                     

                    context = new InitialContext();

                                ISeamDelegate deligate = (ISeamDelegate) context.lookup(" java:app/app.jar/SeamDelegate!no.messageman.protectoria.core.web.ISeamDelegate");

                     

                    It's a longshot but you can give it a try.

                     

                    Sergiu

                    • 7. Re: Problem while Jboss migration from 4.2 to 7.1
                      bajrang_asthana

                      Sorry, But currently we are useing same jndi pattern for all session beans in components.xml like this-

                       

                      1. in components.xml

                       

                      <core:init

                              jndi-pattern="protectoria/#{ejbName}/local"

                              debug="true" />

                       

                      How should I keep it different for different session beans. or should I add the same entry for all session beans in components.xml file.

                       

                      <core:init

                              jndi-pattern="java:app/protectoria/#{ejbName}!no.messageman.protectoria.core.web.ISeamDelegate"

                              debug="true" />

                       

                      The above jndi pattern is only applicable for Seamdelegate session beans what about for other session beans.

                       

                      Please suggest.

                      • 8. Re: Problem while Jboss migration from 4.2 to 7.1
                        sergiu_pienar

                        Bajrang,

                         

                        I don't know exactly how, but IMHO you'll have to determine a certain pattern for your beans and write it down accordingly in components.xml and in the java file.

                         

                        Sergiu