-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: java.rmi.UnmarshalException when binding SessionFactory
PostPosted: Thu Sep 16, 2004 2:38 am 
Newbie

Joined: Wed Sep 15, 2004 10:13 pm
Posts: 8
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!


Top
 Profile  
 
 Post subject: java.rmi.UnmarshalException when binding SessionFactory
PostPosted: Sat Jun 11, 2005 12:55 am 
Newbie

Joined: Thu May 12, 2005 11:42 pm
Posts: 4
Location: Perth, Australia
Did you ever resolve this issue? If so could you please share the solution


Top
 Profile  
 
 Post subject: Final solution
PostPosted: Sat Jun 11, 2005 1:38 pm 
Newbie

Joined: Wed Sep 15, 2004 10:13 pm
Posts: 8
I forgot how i resolve this issue, but here's my final config file content:


<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.datasource">java:/comp/env/jdbc/OracleDS</property>
<property name="hibernate.connection.username">user</property>
<property name="hibernate.connection.password">password</property>

<!--property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property-->
<property name="hibernate.connection.autocommit">false</property>

<property name="jta.UserTransaction">java:comp/UserTransaction</property>
<property name="transaction.manager_lookup_class">org.hibernate.transaction.WeblogicTransactionManagerLookup</property>
<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="hibernate.query.factory_class">org.hibernate.hql.classic.ClassicQueryTranslatorFactory</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="show_sql">false</property>
<property name="use_outer_join">true</property>
<property name="cglib.use_reflection_optimizer">true</property>
<property name="hibernate.jdbc.fetch_size">20</property>
<property name="hibernate.cache.use_second_level_cache">false</property>
<property name="hibernate.cache.use_query_cache">true</property>

<!-- property name="hibernate.cache.provider_class">net.sf.hibernate.cache.EhCacheProvider</property-->

<mapping resource="Controller.hbm.xml" />
<mapping resource="Area.hbm.xml" />
<mapping resource="HealthyPath.hbm.xml" />
<mapping resource="Graph.hbm.xml" />
<mapping resource="Equipment.hbm.xml" />
<mapping resource="Port.hbm.xml" />
<mapping resource="AmhsPort.hbm.xml" />
<mapping resource="PortNode.hbm.xml" />
<mapping resource="Route.hbm.xml" />
<mapping resource="RouteCache.hbm.xml" />
<mapping resource="Path.hbm.xml" />
<mapping resource="RouteNode.hbm.xml" />
<mapping resource="TransportNode.hbm.xml" />
<mapping resource="QdiProperties.hbm.xml" />
<mapping resource="ZoneNode.hbm.xml" />
<mapping resource="MacroPath.hbm.xml" />

<!-- cache settings -->
<class-cache class="jp.co.daifuku.xmcs.routing.hbn.pojo.Area" usage="read-write"/>
<class-cache class="jp.co.daifuku.xmcs.routing.hbn.pojo.QdiProperties" usage="read-write"/>
<class-cache class="jp.co.daifuku.xmcs.routing.hbn.pojo.Graph" usage="read-write"/>
<class-cache class="jp.co.daifuku.xmcs.routing.hbn.pojo.Port" usage="read-only"/>
<class-cache class="jp.co.daifuku.xmcs.routing.hbn.pojo.AmhsPort" usage="read-only"/>
<class-cache class="jp.co.daifuku.xmcs.routing.hbn.pojo.Equipment" usage="read-only"/>
<class-cache class="jp.co.daifuku.xmcs.routing.hbn.pojo.PortNode" usage="read-only"/>
<class-cache class="jp.co.daifuku.xmcs.routing.hbn.pojo.Route" usage="read-write"/>
<class-cache class="jp.co.daifuku.xmcs.routing.hbn.pojo.RouteCache" usage="read-write"/>
<class-cache class="jp.co.daifuku.xmcs.routing.hbn.pojo.Path" usage="read-write"/>
<class-cache class="jp.co.daifuku.xmcs.routing.hbn.pojo.RouteNode" usage="read-write"/>
<class-cache class="jp.co.daifuku.xmcs.routing.hbn.pojo.TransportNode" usage="read-only"/>
<class-cache class="jp.co.daifuku.xmcs.routing.hbn.pojo.ZoneNode" usage="read-only"/>
<class-cache class="jp.co.daifuku.xmcs.routing.hbn.pojo.MacroPath" usage="read-write"/>

<!--collection-cache collection="nodes" class="jp.co.daifuku.xmcs.routing.hbn.pojo.Area.nodes" usage="read-write"/>
<collection-cache collection="ports" class="jp.co.daifuku.xmcs.routing.hbn.pojo.Equipment.nodes" usage="read-write"/>
<collection-cache collection="routes" class="jp.co.daifuku.xmcs.routing.hbn.pojo.Path.routes" usage="read-only"/>
<collection-cache collection="ports" class="jp.co.daifuku.xmcs.routing.hbn.pojo.PortNode.ports" usage="read-only"/>
<collection-cache collection="routes" class="jp.co.daifuku.xmcs.routing.hbn.pojo.RouteCache.routes" usage="read-only"/--> </session-factory>
</hibernate-configuration>

_________________
Thanks in advance!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.