Hi,
I have not been able to bind my SessionFactory to the Weblogic JNDI from a client application. I've tried several implementation but to no avail.
Here's the exception logs:
15:39:14,688 INFO Environment:469 - Hibernate 2.1.6
15:39:14,698 INFO Environment:498 - hibernate.properties not found
15:39:14,708 INFO Environment:529 - using CGLIB reflection optimizer
15:39:14,708 INFO Configuration:895 - configuring from resource: /hibernate.cfg.xml
15:39:14,708 INFO Configuration:867 - Configuration resource: /hibernate.cfg.xml
15:39:15,459 INFO Configuration:331 - Mapping resource: jp/co/daifuku/xmcs/routing/hibernate/mapping/PortNode.hbm.xml
15:39:15,610 INFO Binder:229 - Mapping class: jp.co.daifuku.xmcs.routing.hibernate.pojo.PortNode -> PORTNODE
15:39:15,710 INFO Configuration:331 - Mapping resource: jp/co/daifuku/xmcs/routing/hibernate/mapping/Route.hbm.xml
15:39:15,760 INFO Binder:229 - Mapping class: jp.co.daifuku.xmcs.routing.hibernate.pojo.Route -> ROUTE
15:39:16,000 INFO Configuration:331 - Mapping resource: jp/co/daifuku/xmcs/routing/hibernate/mapping/Routecache.hbm.xml
15:39:16,070 INFO Binder:229 - Mapping class: jp.co.daifuku.xmcs.routing.hibernate.pojo.RouteCache -> ROUTECACHE
15:39:16,080 INFO Configuration:331 - Mapping resource: jp/co/daifuku/xmcs/routing/hibernate/mapping/Routenode.hbm.xml
15:39:16,170 INFO Binder:229 - Mapping class: jp.co.daifuku.xmcs.routing.hibernate.pojo.RouteNode -> ROUTENODE
15:39:16,170 INFO Configuration:331 - Mapping resource: jp/co/daifuku/xmcs/routing/hibernate/mapping/TransportNode.hbm.xml
15:39:16,211 INFO Binder:229 - Mapping class: jp.co.daifuku.xmcs.routing.hibernate.pojo.TransportNode -> TRANSPORTNODE
15:39:16,211 INFO Configuration:331 - Mapping resource: jp/co/daifuku/xmcs/routing/hibernate/mapping/ZoneNode.hbm.xml
15:39:16,281 INFO Binder:229 - Mapping class: jp.co.daifuku.xmcs.routing.hibernate.pojo.ZoneNode -> ZONENODE
15:39:16,291 INFO Configuration:1053 - Configured SessionFactory: hibernate.session-factory.Oracle
15:39:16,291 INFO Configuration:627 - processing one-to-many association mappings
15:39:16,301 INFO Configuration:636 - processing one-to-one association property references
15:39:16,301 INFO Configuration:661 - processing foreign key constraints
15:39:16,321 INFO Dialect:82 - Using dialect: net.sf.hibernate.dialect.Oracle9Dialect
15:39:16,321 INFO SettingsFactory:63 - Use outer join fetching: true
15:39:16,361 INFO NamingHelper:26 - JNDI InitialContext properties:{java.naming.provider.url=t3://127.0.0.1:7001, java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory}
15:39:17,492 INFO DatasourceConnectionProvider:51 - Using datasource: jdbc/OracleDS
15:39:17,502 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
15:39:19,075 INFO SettingsFactory:103 - Use scrollable result sets: true
15:39:19,075 INFO SettingsFactory:106 - Use JDBC3 getGeneratedKeys(): false
15:39:19,075 INFO SettingsFactory:109 - Optimize cache for minimal puts: false
15:39:19,075 INFO SettingsFactory:115 - echoing all SQL to stdout
15:39:19,075 INFO SettingsFactory:118 - Query language substitutions: {}
15:39:19,075 INFO SettingsFactory:129 - cache provider: net.sf.hibernate.cache.EhCacheProvider
15:39:19,075 INFO Configuration:1116 - instantiating and configuring caches
15:39:19,115 INFO SessionFactoryImpl:118 - building session factory
15:39:19,475 INFO SessionFactoryObjectFactory:86 - Factory name: hibernate.session-factory.Oracle
15:39:19,475 INFO NamingHelper:26 - JNDI InitialContext properties:{java.naming.provider.url=t3://127.0.0.1:7001, java.naming.factory.initial=weblogic.jndi.WLInitialContextFactory}
15:39:19,605 WARN SessionFactoryObjectFactory:98 - Could not bind factory to JNDI
javax.naming.CommunicationException [Root exception is java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.io.StreamCorruptedException]
at weblogic.jndi.internal.ExceptionTranslator.toNamingException(ExceptionTranslator.java:83)
at weblogic.jndi.internal.WLContextImpl.translateException(WLContextImpl.java:385)
at weblogic.jndi.internal.WLContextImpl.rebind(WLContextImpl.java:136)
at weblogic.jndi.internal.WLContextImpl.rebind(WLContextImpl.java:128)
at net.sf.hibernate.util.NamingHelper.bind(NamingHelper.java:74)
at net.sf.hibernate.impl.SessionFactoryObjectFactory.addInstance(SessionFactoryObjectFactory.java:90)
at net.sf.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:171)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:791)
at jp.co.daifuku.xmcs.routing.hibernate.Initializer.<clinit>(Initializer.java:30)
at jp.co.daifuku.xmcs.routing.hibernate.DbMain.main(DbMain.java:23)
Caused by: java.rmi.UnmarshalException: error unmarshalling arguments; nested exception is:
java.io.StreamCorruptedException
at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:284)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:244)
at weblogic.jndi.internal.ServerNamingNode_811_WLStub.rebind(Unknown Source)
at weblogic.jndi.internal.WLContextImpl.rebind(WLContextImpl.java:134)
... 7 more
Caused by: java.io.StreamCorruptedException
at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1506)
at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1435)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1626)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:114)
at weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:111)
at weblogic.jndi.internal.ServerNamingNode_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:466)
at weblogic.rmi.cluster.ReplicaAwareServerRef.invoke(ReplicaAwareServerRef.java:108)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:409)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:353)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:144)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:404)
at weblogic.rmi.internal.BasicExecuteRequest.execute(BasicExecuteRequest.java:30)
at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170)
-------------------------------
My hibernate.cfg.xml looks like this:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory name="hibernate.session-factory.Oracle">
<property name="jndi.class">weblogic.jndi.WLInitialContextFactory</property>
<property name="jndi.url">t3://127.0.0.1:7001</property>
<property name="connection.datasource">jdbc/OracleDS</property>
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
<property name="show_sql">true</property>
<property name="use_outer_join">true</property>
<property name="cglib.use_reflection_optimizer">true</property>
<!-- mapping files -->
<mapping resource="jp/co/daifuku/xmcs/routing/hibernate/mapping/PortNode.hbm.xml"/>
<mapping resource="jp/co/daifuku/xmcs/routing/hibernate/mapping/Route.hbm.xml"/>
<mapping resource="jp/co/daifuku/xmcs/routing/hibernate/mapping/Routecache.hbm.xml"/>
<mapping resource="jp/co/daifuku/xmcs/routing/hibernate/mapping/Routenode.hbm.xml"/>
<mapping resource="jp/co/daifuku/xmcs/routing/hibernate/mapping/TransportNode.hbm.xml"/>
<mapping resource="jp/co/daifuku/xmcs/routing/hibernate/mapping/ZoneNode.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Please help!
_________________ Thanks in advance!
|