facebook

HELP !!! configuration Hiberante 3 with Weblogic

  1. MyEclipse Archived
  2.  > 
  3. Application Servers and Deployment
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #265281 Reply

    gary_tam
    Member

    tried to bind the Hibernate SessionFactory to Weblogic JNDI. I got error on failed to load org.hibernate.impl.SessionFactoryImpl

    DEBUG org.hibernate.util.NamingHelper – binding: HibernateFactory
    DEBUG org.hibernate.impl.SessionFactoryImpl – serializing: 8a8284ca106e1c1401106e1c188a0000
    DEBUG org.hibernate.impl.SessionFactoryImpl – serialized
    DEBUG org.hibernate.impl.SessionFactoryImpl – serializing: 8a8284ca106e1c1401106e1c188a0000
    DEBUG org.hibernate.impl.SessionFactoryImpl – serialized
    DEBUG org.hibernate.impl.SessionFactoryImpl – serializing: 8a8284ca106e1c1401106e1c188a0000
    DEBUG org.hibernate.impl.SessionFactoryImpl – serialized
    DEBUG org.hibernate.impl.SessionFactoryImpl – serializing: 8a8284ca106e1c1401106e1c188a0000
    DEBUG org.hibernate.impl.SessionFactoryImpl – serialized
    WARN org.hibernate.impl.SessionFactoryObjectFactory – Could not bind factory to JNDI
    javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: Failed to load class org.hibernate.impl.SessionFactoryImpl]
    at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:85)
    at weblogic.jndi.internal.WLContextImpl.translateException(WLContextImpl.java:421)
    at weblogic.jndi.internal.WLContextImpl.rebind(WLContextImpl.java:137)
    at javax.naming.InitialContext.rebind(InitialContext.java:371)
    at org.hibernate.util.NamingHelper.bind(NamingHelper.java:74)
    at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:260)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
    at com.poc.hibernate.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:64)
    at com.poc.hibernate.HibernateSessionFactory.getCurrentSession(HibernateSessionFactory.java:47)
    at com.poc.hibernate.transferobjects.BaseHibernateDAO.getSession(BaseHibernateDAO.java:14)
    at com.poc.hibernate.transferobjects.CreditEnhancementCodeDAO.findById(CreditEnhancementCodeDAO.java:51)
    at test.com.poc.hibernate.TestCreditEnhancementCode.testFindById(TestCreditEnhancementCode.java:20)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.lang.ClassNotFoundException: Failed to load class org.hibernate.impl.SessionFactoryImpl
    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:195)
    at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:338)
    at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
    at weblogic.jndi.internal.ServerNamingNode_920_WLStub.rebind(Unknown Source)
    at weblogic.jndi.internal.WLContextImpl.rebind(WLContextImpl.java:135)
    … 28 more
    Caused by: java.lang.ClassNotFoundException: Failed to load class org.hibernate.impl.SessionFactoryImpl
    at weblogic.rmi.utils.WLRMIClassLoaderDelegate.loadClass(WLRMIClassLoaderDelegate.java:203)
    at weblogic.rmi.utils.WLRMIClassLoaderDelegate.loadClass(WLRMIClassLoaderDelegate.java:128)
    at weblogic.rmi.utils.Utilities.loadClass(Utilities.java:308)
    at weblogic.rmi.utils.Utilities.loadClass(Utilities.java:344)
    at weblogic.rjvm.MsgAbbrevInputStream.resolveClass(MsgAbbrevInputStream.java:400)
    at weblogic.utils.io.ChunkedObjectInputStream$NestedObjectInputStream.resolveClass(ChunkedObjectInputStream.java:255)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:195)
    at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:565)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:191)
    at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:517)
    at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:407)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:403)
    at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:56)
    at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:934)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    DEBUG org.hibernate.impl.SessionFactoryImpl – instantiated session factory
    INFO org.hibernate.impl.SessionFactoryImpl – Checking 0 named queries
    DEBUG org.hibernate.impl.SessionImpl – opened session at timestamp: 4792641290620928

    Once I added the hibernate jar files from \MyEclipse 5.0M2\eclipse\plugins\com.genuitec.org.hibernate.eclipse_4.9.200\lib\hibernate\… to weblogic and restarted, got a different error

    DEBUG org.hibernate.impl.SessionFactoryImpl – serializing: 8a8284ca106e22cd01106e22d1da0000
    DEBUG org.hibernate.impl.SessionFactoryImpl – serialized
    WARN org.hibernate.impl.SessionFactoryObjectFactory – Could not bind factory to JNDI
    javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.io.InvalidClassException: org.hibernate.impl.SessionFactoryImpl; local class incompatible: stream classdesc serialVersionUID = -228140159662132396, local class serialVersionUID = 5500346574931967936]
    at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:85)
    at weblogic.jndi.internal.WLContextImpl.translateException(WLContextImpl.java:421)
    at weblogic.jndi.internal.WLContextImpl.rebind(WLContextImpl.java:137)
    at javax.naming.InitialContext.rebind(InitialContext.java:371)
    at org.hibernate.util.NamingHelper.bind(NamingHelper.java:74)
    at org.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:260)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
    at com.poc.hibernate.HibernateSessionFactory.rebuildSessionFactory(HibernateSessionFactory.java:64)
    at com.poc.hibernate.HibernateSessionFactory.getCurrentSession(HibernateSessionFactory.java:47)
    at com.poc.hibernate.transferobjects.BaseHibernateDAO.getSession(BaseHibernateDAO.java:14)
    at com.poc.hibernate.transferobjects.CreditEnhancementCodeDAO.findById(CreditEnhancementCodeDAO.java:51)
    at test.com.poc.hibernate.TestCreditEnhancementCode.testFindById(TestCreditEnhancementCode.java:20)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
    Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
    java.io.InvalidClassException: org.hibernate.impl.SessionFactoryImpl; local class incompatible: stream classdesc serialVersionUID = -228140159662132396, local class serialVersionUID = 5500346574931967936
    at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:195)
    at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:338)
    at weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:252)
    at weblogic.jndi.internal.ServerNamingNode_920_WLStub.rebind(Unknown Source)
    at weblogic.jndi.internal.WLContextImpl.rebind(WLContextImpl.java:135)
    … 28 more
    Caused by: java.io.InvalidClassException: org.hibernate.impl.SessionFactoryImpl; local class incompatible: stream classdesc serialVersionUID = -228140159662132396, local class serialVersionUID = 5500346574931967936
    at java.io.ObjectStreamClass.initNonProxy(ObjectStreamClass.java:519)
    at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1546)
    at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460)
    at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693)
    at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299)
    at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:195)
    at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:565)
    at weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:191)
    at weblogic.jndi.internal.RootNamingNode_WLSkel.invoke(Unknown Source)
    at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:517)
    at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
    at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:407)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
    at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:403)
    at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:56)
    at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:934)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    DEBUG org.hibernate.impl.SessionFactoryImpl – instantiated session factory

    Here is my hibernate.cfg.xml

    <session-factory>
    <property name=”connection.username”>weblogic</property>
    <property name=”dialect”>
    org.hibernate.dialect.Oracle9Dialect
    </property>
    <property name=”jndi.url”>t3://localhost:7001</property>
    <property name=”jndi.class”>
    weblogic.jndi.WLInitialContextFactory
    </property>
    <property name=”connection.datasource”>DBRS_DS</property>
    <property name=”connection.password”>weblogic</property>
    <property name=”session_factory_name”>
    hibernateSessionFactory
    </property>
    <mapping
    resource=”com/poc/hibernate/transferobjects/CreditEnhancementCode.hbm.xml” />

    </session-factory>

    What do I need to configure weblogic/myEclipse/Hibernate in order to do the JNDI for SessionFactory ???

    #265414 Reply

    Riyad Kalla
    Member

    There are a few things here:

    1) You don’t want to copy those Hibernate libraries to your web logic install. From the look of things (the incompatible class errors with the serial ID) makes me think that you had some already in there?

    2) Make sure your JNDI URL is right, it doesn’t look right. Normally these things look like java:comp/env/jdbc/TestDB

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: HELP !!! configuration Hiberante 3 with Weblogic

You must be logged in to post in the forum log in