-->
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.  [ 10 posts ] 
Author Message
 Post subject: Oracle 10G: Could not locate TransactionManager
PostPosted: Fri Jul 08, 2005 6:09 am 
Newbie

Joined: Fri Apr 08, 2005 7:15 am
Posts: 10
Hello,

I was using Hibernate 2.1.8 in a managed app on a OC4J 9.0.4.0.0 standalone Oracle app server and everything worked fine.
Now, We are migrating to OC4J 10.1.2.0.0 (standalone Oracle 10G app server) and I receive the following exception:
Code:
net.sf.hibernate.HibernateException: Could not locate TransactionManager
   at net.sf.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:26)
   at net.sf.hibernate.transaction.JTATransactionFactory.configure(JTATransactionFactory.java:48)
   at net.sf.hibernate.transaction.TransactionFactoryFactory.buildTransactionFactory(TransactionFactoryFactory.java:48)
   at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:77)
   at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1172)
   at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:803)
   at be.cm.comps.entitymanager.plugin.hibernate2.config.BaseHibernate2Config.buildFactory(BaseHibernate2Config.java:158)
   at be.cm.comps.entitymanager.plugin.hibernate2.config.ManagedHibernate2Config.configureFactory(ManagedHibernate2Config.java:110)
   at be.cm.comps.entitymanager.factory.Persistence.createEntityManagerFactory(Persistence.java:61)
   at be.cm.comps.entitymanager.factory.Persistence.createEntityManagerFactory(Persistence.java:44)
   at be.cm.apps.persistence.business.justif.ejb.impl.HibernatePatternTestBoBean.ejbCreate(HibernatePatternTestBoBean.java:45)
   at HibernatePatternTestBoLocalHome_StatelessSessionHomeWrapper25.callCreate(HibernatePatternTestBoLocalHome_StatelessSessionHomeWrapper25.java:111)
   at com.evermind.server.ejb.StatelessSessionEJBHome.getContextInstance(StatelessSessionEJBHome.java:271)
   at com.evermind.server.ejb.StatelessSessionEJBHome.getLocalContextInstance(StatelessSessionEJBHome.java:166)
   at HibernatePatternTestBoLocal_StatelessSessionBeanWrapper24.insertNewFashion(HibernatePatternTestBoLocal_StatelessSessionBeanWrapper24.java:71)
   at be.cm.apps.persistence.workflow.ejb.impl.FacadeBean.test(FacadeBean.java:79)
   at Facade_StatelessSessionBeanWrapper26.test(Facade_StatelessSessionBeanWrapper26.java:78)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:124)
   at com.evermind.server.rmi.RMICallHandler.run(RMICallHandler.java:48)
   at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)
   at java.lang.Thread.run(Unknown Source)
Caused by: javax.naming.NameNotFoundException: Only session and message-driven beans with bean-managed transaction are allowed to use UserTransaction
   at com.evermind.server.ApplicationContext.lookupJavaCompRsrc(ApplicationContext.java:180)
   at com.evermind.server.ApplicationContext.lookupJavaComp(ApplicationContext.java:136)
   at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:306)
   at com.evermind.server.ApplicationContext.lookup(ApplicationContext.java:120)
   at javax.naming.InitialContext.lookup(Unknown Source)
   at net.sf.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:23)
   ... 24 more


I think this is due to the net.sf.hibernate.transaction.OrionTransactionManagerLookup which I've specified as the 'hibernate.transaction.manager_lookup_class' because it specifies that the TransactionManager is located at JNDI namespace 'java:comp/UserTransaction' but I think this isn't the TransactionManager but just the UserTransaction (did Oracle change this?). Can this be possible?

Does anyone know how to fix this? I might write my own TransactionManagerLookupClass but I don't know where Oracle publishes the TransactionManager in 10G.

Is it possible they are just changing this to complicate the configuration and migration for us (Hibernate folks) because they have TopLink?

Thanx mates,

Stijn


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 12, 2005 9:55 am 
Newbie

Joined: Wed Feb 04, 2004 7:12 am
Posts: 18
Location: Brasilia - Brazil
Hi,

Did you get a solution for this problem? Same thing happens to me when SessionFactory is to be built.

I was looking for a way to get a TransactionManager from OC4J, to write a TransacionManagerLookup class, but it seems that OC4J doesn't publish TransactionManager anywhere.

So I tryied to get it from OC4J instance class, as I could see, there is a class com.evermind.server.ApplicationServer with an attribute called instance this is an instance of itself. The problem is, when I try to access this attribute, an exception (java.lang.IllegalAccessException) is thrown and this class has a method that returns an TransactionManager.

Do you know something else?

Thanks

_________________
___________________________
[ MediaSonic (www.geleira.org) ]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 13, 2005 2:20 am 
Newbie

Joined: Fri Apr 08, 2005 7:15 am
Posts: 10
The TransactionManager is published at "java:comp/pm/TransactionManager" I had to decompile some code to find this out but normally it should work...

Greetz,
Stijn


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 13, 2005 2:31 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
If one of you could verify this and submit a transactionmanager lookup class to JIRA, we can include it with the upcoming release of 3.1. An interesting question would be if this URI is valid for all versions of OAS or only 10g?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 13, 2005 3:07 am 
Newbie

Joined: Fri Apr 08, 2005 7:15 am
Posts: 10
From what I can see in the containers classes (903 - 904 - 10G), this should work for all OC4Js.
MediaSonic, can you give some input when you tried this, please.
How can i post my transactionmanager lookup class to JIRA?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 13, 2005 3:10 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Register an account, open a new issue, attach the file.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 13, 2005 10:30 am 
Newbie

Joined: Wed Feb 04, 2004 7:12 am
Posts: 18
Location: Brasilia - Brazil
Stijn wrote:
From what I can see in the containers classes (903 - 904 - 10G), this should work for all OC4Js.
MediaSonic, can you give some input when you tried this, please.
How can i post my transactionmanager lookup class to JIRA?


Hi Stijn,

First of all, thank you for the answer and solution, I have changed class "org.hibernate.transaction.OrionTransactionManagerLookup", rebuilt and now it's working well, please send your version to the official repository.

Cheers,
Emilio Numazaki

_________________
___________________________
[ MediaSonic (www.geleira.org) ]


Top
 Profile  
 
 Post subject:
PostPosted: Tue Sep 13, 2005 10:38 am 
Newbie

Joined: Wed Feb 04, 2004 7:12 am
Posts: 18
Location: Brasilia - Brazil
MediaSonic wrote:
Stijn wrote:
From what I can see in the containers classes (903 - 904 - 10G), this should work for all OC4Js.
MediaSonic, can you give some input when you tried this, please.
How can i post my transactionmanager lookup class to JIRA?


Oh yes, about the test, UserTransaction is available in older version, but I guess TransactionManager lookup is done in the same way. Unfortunately I haven't old version here.

Cheers,
Emilio

_________________
___________________________
[ MediaSonic (www.geleira.org) ]


Top
 Profile  
 
 Post subject: Oracle 10g 10.1.2 TransactionManager Lookup using Spring
PostPosted: Fri Oct 07, 2005 7:24 pm 
Newbie

Joined: Fri Oct 07, 2005 6:59 pm
Posts: 1
Hi,

>The TransactionManager is published >at "java:comp/pm/TransactionManager" I had to decompile some code >tofind this out but normally it should work...

Could somebody validate the above statement.? If the above statement is correct, you don't have to mention the TransactionManager Lookup class as one of the hibernate properties when using with Spring framework.

In spring, you can do the following:

<bean id="jtaTransactionManager" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"><value>java:comp/pm/TransactionManager</value></property>
</bean>

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource"><ref local="dataSource"/></property>
<property name="jtaTransactionManager"><ref local="jtaTransactionManager"/></property>
<property name="mappingResources">
<list> <value>petclinic.hbm.xml</value>
</property>
<property name="hibernateProperties">
<props>
<prop key ="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
</props>
</property>
</bean>


Top
 Profile  
 
 Post subject: Re: Oracle 10g 10.1.2 TransactionManager Lookup using Spring
PostPosted: Fri Oct 07, 2005 7:26 pm 
Newbie

Joined: Wed Feb 04, 2004 7:12 am
Posts: 18
Location: Brasilia - Brazil
vbose wrote:
Hi,

>The TransactionManager is published >at "java:comp/pm/TransactionManager" I had to decompile some code >tofind this out but normally it should work...

Could somebody validate the above statement.? If the above statement is correct, you don't have to mention the TransactionManager Lookup class as one of the hibernate properties when using with Spring framework.

In spring, you can do the following:

<bean id="jtaTransactionManager" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName"><value>java:comp/pm/TransactionManager</value></property>
</bean>

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource"><ref local="dataSource"/></property>
<property name="jtaTransactionManager"><ref local="jtaTransactionManager"/></property>
<property name="mappingResources">
<list> <value>petclinic.hbm.xml</value>
</property>
<property name="hibernateProperties">
<props>
<prop key ="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
</props>
</property>
</bean>


Yes, it is... I've changed the class and now it is working very well.

_________________
___________________________
[ MediaSonic (www.geleira.org) ]


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 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.