1 Reply Latest reply on Aug 27, 2014 12:27 AM by Deepak Ravichandran

    How to Migrate JBOSS 4.0.2 to JBOSS AS 7.1.1 and also facing some Hibernate Error

    Deepak Ravichandran Newbie

      Hi Friends,

                    Hope All is well !!! Actually this discussion is for "How to Migrate JBOSS 4.0.2 to JBOSS AS 7.1.1" could anyone guide me how to do this please, because I tried Many times and Steps for 2 weeks but i can't succeed. when i tried deploy EAR in 7.1.1 JBOSS it is Deployed But Error which am getting is Hibernate Problem,

       

      Server Log

      12:41:08,435 INFO  [org.jboss.as.server] (Deployment Scanner-threads - 2) JBAS018559: Deployed "XXXXXX.ear"

      12:41:26,468 ERROR [stderr] (http--127.0.0.1-9000-1) javax.naming.NameNotFoundException: MetaDataSessionFactory -- service jboss.naming.context.java.app.XXXXX.MetaDataSessionFactory

      12:41:26,468 ERROR [stderr] (http--127.0.0.1-9000-1)     at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:97)

      12:41:26,468 ERROR [stderr] (http--127.0.0.1-9000-1)     at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:178)

      12:41:26,468 ERROR [stderr] (http--127.0.0.1-9000-1)     at org.jboss.as.naming.InitialContext.lookup(InitialContext.java:123)

      12:41:26,488 ERROR [stderr] (http--127.0.0.1-9000-1)     at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:214)

      12:41:26,488 ERROR [stderr] (http--127.0.0.1-9000-1)     at javax.naming.InitialContext.lookup(InitialContext.java:392)

      12:41:26,488 ERROR [stderr] (http--127.0.0.1-9000-1)     at com.XXXXX.server.HibernateServiceImpl.getSessionFactory(HibernateServiceImpl.java:1926)

      12:41:26,488 ERROR [stderr] (http--127.0.0.1-9000-1)     at com.XXXXX.server.HibernateServiceImpl.init(HibernateServiceImpl.java:118)

      12:41:26,498 ERROR [stderr] (http--127.0.0.1-9000-1)     at javax.servlet.GenericServlet.init(GenericServlet.java:242)

      12:41:26,508 ERROR [stderr] (http--127.0.0.1-9000-1)     at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202)

      12:41:26,508 ERROR [stderr] (http--127.0.0.1-9000-1)     at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:952)

      12:41:26,518 ERROR [stderr] (http--127.0.0.1-9000-1)     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:188)

      12:41:26,518 ERROR [stderr] (http--127.0.0.1-9000-1)     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

      12:41:26,518 ERROR [stderr] (http--127.0.0.1-9000-1)     at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153)

      12:41:26,518 ERROR [stderr] (http--127.0.0.1-9000-1)     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155)

      12:41:26,528 ERROR [stderr] (http--127.0.0.1-9000-1)     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

      12:41:26,538 ERROR [stderr] (http--127.0.0.1-9000-1)     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

      12:41:26,538 ERROR [stderr] (http--127.0.0.1-9000-1)     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368)

      12:41:26,538 ERROR [stderr] (http--127.0.0.1-9000-1)     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

      12:41:26,548 ERROR [stderr] (http--127.0.0.1-9000-1)     at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671)

      12:41:26,558 ERROR [stderr] (http--127.0.0.1-9000-1)     at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930)

      12:41:26,558 ERROR [stderr] (http--127.0.0.1-9000-1)     at java.lang.Thread.run(Thread.java:662)

      12:41:26,558 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/cloud]] (http--127.0.0.1-9000-1) StandardWrapper.Throwable: java.lang.IllegalArgumentException: Cannot find Hibernate session factory implementation !

          at net.sf.gilead.core.hibernate.HibernateUtil.setSessionFactory(HibernateUtil.java:161) [hibernate-util-1.2.3.823.jar:]

          at com.XXXXX.server.XXXXX.init(XXXXX.java:118) [Shrisurance.jar:]

          at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:952) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:188) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_25]

       

      12:41:26,628 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[default-host].[/cloud].[HibernateServiceImpl]] (http--127.0.0.1-9000-1) Allocate exception for servlet HibernateServiceImpl: java.lang.IllegalArgumentException: Cannot find Hibernate session factory implementation !

          at net.sf.gilead.core.hibernate.HibernateUtil.setSessionFactory(HibernateUtil.java:161) [hibernate-util-1.2.3.823.jar:]

          at com.XXXXX.server.HibernateServiceImpl.init(HibernateServiceImpl.java:118) [XXXXXX.jar:]

          at javax.servlet.GenericServlet.init(GenericServlet.java:242) [jboss-servlet-api_3.0_spec-1.0.0.Final.jar:1.0.0.Final]

          at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1202) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:952) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:188) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161) [jbossweb-7.0.13.Final.jar:]

          at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:153) [jboss-as-web-7.1.1.Final.jar:7.1.1.Final]

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:155) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [jbossweb-7.0.13.Final.jar:]

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:368) [jbossweb-7.0.13.Final.jar:]

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877) [jbossweb-7.0.13.Final.jar:]

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:671) [jbossweb-7.0.13.Final.jar:]

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:930) [jbossweb-7.0.13.Final.jar:]

          at java.lang.Thread.run(Thread.java:662) [rt.jar:1.6.0_25]

       

      My Lookup class

      (.Class File)

      import javax.naming.InitialContext;

      import javax.naming.Context;

       

      Context ds = new InitialContext();

      SessionFactory abcd =  (SessionFactory) ds.lookup("java:app/MetaDataSessionFactory");

       

      My Structure = a.ear;b.jar;c.war;d.har

               a.ear

                   ||

        --------------------------------------------------------

         ||                        ||                           ||

      c.war                  d.har                    META-INF-------1)Application.xml

           |                        |                                    | ------- 2)jboss-deployment-structure.xml

         web-inf             Classes                               |---------3)MANIFEST.MF

           |                   XXXX.hbm.xml                     |---------4)jboss-app.xml   

          lib                  hibernate-service.xml

           |

         b.jar

       

      My Jboss-deployment-Structure

       

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

      <jboss-deployment-structure>

        <ear-subdeployments-isolated>false</ear-subdeployments-isolated>

          <deployment>

           <dependencies>

               <module name="org.apache.commons.logging" export="true"/>

               <module name="org.dom4j" export="true"/>

               <module name="org.apache.commons.collections" export="true"/>

               <module name="org.hibernate" export="true"/>     

            </dependencies>

        </deployment>

        <sub-deployment name="c.war">

          <exclusions>

                <module name="deployment.a.ear" />

          </exclusions>

        </sub-deployment>

        </jboss-deployment-structure>

       

      My jboss-app

       

      <jboss-app>

        <module>

          <har>d.har</har>

      </module>

      </jboss-app>

       

      My Hibernate-Service.xml

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

      <server>

      <mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate">

        <attribute name="SessionFactoryName">java:app/MetaDataSessionFactory</attribute>

        <attribute name="DatasourceName">java:jboss/DefaultDS</attribute>

        <attribute name="Dialect">org.hibernate.dialect.Oracle10gDialect</attribute>

        <attribute name="CacheProviderClass">org.hibernate.cache.HashtableCacheProvider</attribute>

        <attribute name="ShowSqlEnabled">false</attribute>

      </mbean>

      </server>

       

      This Much Configuration i did But after that it is showing some error in "Lookup from IMPL.class and also not connecting Hibernate from JBOSS AS 7.1.1"

       

      Anyone !! Help me on this it is greatful for me to grow up knowledge

       

      Thanks

      Deepak