-->
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.  [ 6 posts ] 
Author Message
 Post subject: OAS 10G issues javax.naming.NameNotFoundException
PostPosted: Thu Feb 28, 2008 10:54 am 
Newbie

Joined: Thu Feb 28, 2008 10:48 am
Posts: 7
Hi,

i am getting the following error in OAS 10G
org.hibernate.HibernateException: Could not locate TransactionManager

org.hibernate.HibernateException: Could not locate TransactionManager

at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:26)

at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:325)

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)

at com.osg.rmp.dao.util.HibernateFactory.configureSessionFactory(HibernateFactory.java:99)

at com.osg.rmp.dao.util.HibernateFactory.buildIfNeeded(HibernateFactory.java:36)

at com.osg.rmp.dao.util.HibernateFactory.openSession(HibernateFactory.java:51)

at com.osg.rmp.dao.MasterDataDAO.getImpactUnitsList(Unknown Source)

at com.osg.rmp.ajax.util.RMData.<clinit>(Unknown Source)

at java.lang.Class.forName0(Native Method)

at java.lang.Class.forName(Class.java:219)

at com.osg.rmp.ajax.servlet.RMContextListener.contextInitialized(RMContextListener.java:42)

at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1009)

at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:549)

at com.evermind.server.Application.getHttpApplication(Application.java:890)

at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:707)

at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:625)

at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:278)

at com.evermind.server.http.HttpServer.setSites(HttpServer.java:278)

at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:179)

at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2394)

at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1551)

at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:92)

at java.lang.Thread.run(Thread.java:534)

Caused by: javax.naming.NameNotFoundException: No object bound for java:comp/pm/TransactionManager

at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:116)

at javax.naming.InitialContext.lookup(InitialContext.java:347)

at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:23)

... 22 more

08/02/28 20:11:39 java.lang.NullPointerException

08/02/28 20:11:39 at com.osg.rmp.dao.util.HibernateFactory.openSession(HibernateFactory.java:52)

08/02/28 20:11:39 at com.osg.rmp.dao.MasterDataDAO.getImpactUnitsList(Unknown Source)

08/02/28 20:11:39 at com.osg.rmp.ajax.util.RMData.<clinit>(Unknown Source)

08/02/28 20:11:39 at java.lang.Class.forName0(Native Method)

08/02/28 20:11:39 at java.lang.Class.forName(Class.java:219)

08/02/28 20:11:39 at com.osg.rmp.ajax.servlet.RMContextListener.contextInitialized(RMContextListener.java:42)

08/02/28 20:11:39 at com.evermind.server.http.HttpApplication.initDynamic(HttpApplication.java:1009)

08/02/28 20:11:39 at com.evermind.server.http.HttpApplication.<init>(HttpApplication.java:549)

08/02/28 20:11:39 at com.evermind.server.Application.getHttpApplication(Application.java:890)

08/02/28 20:11:39 at com.evermind.server.http.HttpServer.getHttpApplication(HttpServer.java:707)

08/02/28 20:11:39 at com.evermind.server.http.HttpSite.initApplications(HttpSite.java:625)

08/02/28 20:11:39 at com.evermind.server.http.HttpSite.setConfig(HttpSite.java:278)

08/02/28 20:11:39 at com.evermind.server.http.HttpServer.setSites(HttpServer.java:278)

08/02/28 20:11:39 at com.evermind.server.http.HttpServer.setConfig(HttpServer.java:179)

08/02/28 20:11:39 at com.evermind.server.ApplicationServer.initializeHttp(ApplicationServer.java:2394)

08/02/28 20:11:39 at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1551)

08/02/28 20:11:39 at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:92)

08/02/28 20:11:39 at java.lang.Thread.run(Thread.java:534)

08/02/28 20:11:40 Oracle Application Server Containers for J2EE 10g (10.1.2.0.2) initialized

it is very urgent

hope some one get back to me ASAP
Thanks in advance
Purandhar


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 28, 2008 11:28 am 
Senior
Senior

Joined: Fri Jun 01, 2007 12:41 pm
Posts: 121
Can you post your hibernate configuration file here?

Are you using the properties

Code:
<property name="transaction.manager_lookup_class">
<property name="hibernate.connection.datasource">


Exception shows that JNDI name not found. Check your OAS server settings for the JNDI name.

Code:
Caused by: javax.naming.NameNotFoundException: No object bound for java:comp/pm/TransactionManager


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 28, 2008 11:33 am 
Newbie

Joined: Thu Feb 28, 2008 10:48 am
Posts: 7
Hi thanks for the reply

i am using cfg file


<session-factory name="RMSessionFactory">

<property name="connection.datasource">jdbc/RMDBConnectionPooledDS</property>
<property name="transaction.manager_lookup_class">org.hibernate.transaction.OC4JTransactionManagerLookup</property>
<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>
<property name="FlushBeforeCompletionEnabled">true</property>
<property name="AutoCloseSessionEnabled">true</property>


regards
purandhar


Top
 Profile  
 
 Post subject:
PostPosted: Thu Feb 28, 2008 11:47 am 
Senior
Senior

Joined: Fri Jun 01, 2007 12:41 pm
Posts: 121
Did you check your OAS settings for JNID name java:comp/pm/TransactionManager. I believe this is not configured in your server.

Once comment the following code in your hibernate.cfg.xml file, and your program should work fine.

Code:
<property name="transaction.manager_lookup_class">org.hibernate.transaction.OC4JTransactionManagerLookup</property>
<property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 12:07 am 
Newbie

Joined: Thu Feb 28, 2008 10:48 am
Posts: 7
Hi sjhyam,

Thanks for your idea. It is working fine now. by commenting out the Transaction factory code i am going ot loose transaction management right??

i am using autocommig=false,autorollback,autosessionclose,flush enabled .
i feel i am going to loose these things. but i need them in my application. Actually the same old code is was working fine in embedded OC4J in my Jdeveloper and standalone OC4J instance. it is failing in the environment where i have infrastructure services and mid tier along with portal.

please suggest me...

Regards,
Purandhar


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 29, 2008 11:30 am 
Senior
Senior

Joined: Fri Jun 01, 2007 12:41 pm
Posts: 121
As it was working in other environments, check with your current server settings why the JNID java:comp/pm/TransactionManager is not working. It will solve your problem forever.

Second option, use the Hibernate Transaction i.e., session.beginTrasaction()
which is plain JDBC Transaction.

For more details refer to http://www.hibernate.org/42.html

Thanks
Shyam


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