-->
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.  [ 4 posts ] 
Author Message
 Post subject: UserTransaction not found via java:comp/UserTransaction
PostPosted: Mon Oct 10, 2005 7:37 am 
Newbie

Joined: Fri Aug 05, 2005 10:38 am
Posts: 11
Hi,

since i switched to JBoss 4.0.3 release (from RC2) i have some Problems with Hibernate. The hibernate part is deployed as a har-archive in an ear.
Now i get a NameNotFoundException by the Transaction API of Hibernate.
I think Transaction API looks for JNDI "UserTransaction" in former versions and now searchs for java:comp/UserTransaction (see also JBossTransactionManagerLookup.getUserTransactionName()) and donĀ“t find anything. How can i solve this Problem by configuration?
All works fine if i replace hibernate3.jar in default/lib of JBoss with an older version (for example 3.0.3).
Is this all a bug?

Regards

Peter



Hibernate version: 3.1 rc1

Mapping documents: irrelevvant

Code between sessionFactory.openSession() and session.close():
InitialContext ctx = new InitialContext();

SessionFactory sf = (SessionFactory)ctx.lookup("java:/hibernate/DocumentArchivSessionFactory");

Session hs = sf.getCurrentSession();
Transaction tx = hs.beginTransaction();

UserHBM user = (UserHBM) hs.get(UserHBM.class, principal.getUserid());

tx.commit();
hs.close();



Full stack trace of any exception that occurs:
2005-10-10 13:19:01,359 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] JNDI lookup: hibernate/DocumentArchivSessionFactory
2005-10-10 13:19:01,359 DEBUG [org.hibernate.impl.SessionFactoryObjectFactory] lookup: uid=013bb34806da411b0106da411d500000
2005-10-10 13:19:01,359 DEBUG [org.hibernate.jdbc.JDBCContext] successfully registered Synchronization
2005-10-10 13:19:01,359 DEBUG [org.hibernate.impl.SessionImpl] opened session at timestamp: 11289431413
2005-10-10 13:19:01,359 DEBUG [org.hibernate.transaction.JTATransaction] Looking for UserTransaction under: java:comp/UserTransaction
2005-10-10 13:19:01,359 ERROR [org.hibernate.transaction.JTATransaction] Could not find UserTransaction in JNDI
javax.naming.NameNotFoundException: UserTransaction not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:514)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:522)
at org.jnp.server.NamingServer.getObject(NamingServer.java:528)
at org.jnp.server.NamingServer.lookup(NamingServer.java:281)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:701)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
at org.hibernate.transaction.JTATransaction.<init>(JTATransaction.java:60)
at org.hibernate.transaction.JTATransactionFactory.createTransaction(JTATransactionFactory.java:53)
at org.hibernate.jdbc.JDBCContext.getTransaction(JDBCContext.java:190)
at org.hibernate.impl.SessionImpl.getTransaction(SessionImpl.java:1197)
at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1204)
at de.absoft.documentarchiv.ejb.LoginManager.login(LoginManager.java:217)

Name and version of the database you are using:
MySQL 4.1.10

The generated SQL (show_sql=true):
none - irrelevant


Top
 Profile  
 
 Post subject: even with hibernate.properties it is still not working
PostPosted: Mon Oct 10, 2005 12:51 pm 
Newbie

Joined: Fri Aug 05, 2005 10:38 am
Posts: 11
hi,

i tried to solve my problem with a hibernate.properties file which is included fine

Code:
INFO  [org.hibernate.cfg.Environment] loaded properties from resource hibernate.properties: {hibernate.cglib.use_reflection_optimizer=true, jta.UserTransaction=UserTransaction}


but the problem still exists.

If i deploy my application in JBoss 4.0.2 (or take an older Hibernate version) i do not get a exception. If i change hibernate.usertansaction property to a fictive value and deploy it (4.0.2) i get the same exception as i get with 4.0.3 with the default property value.

But if i deploy my application in 4.0.3 and change the property to "UserTransaction" the Environment loads this property but uses the default value (java:comp/UserTransaction)!

Can someone tell me why
1) the default for JBoss is java:comp/UserTransaction and NOT UserTransaction and
2) Hibernate uses the default value even, if if my hibernate.properties file is loaded well

Or am i wrong and the problem is somewhere else?

Regards

Peter


Top
 Profile  
 
 Post subject: no idea?
PostPosted: Mon Oct 10, 2005 7:25 pm 
Newbie

Joined: Fri Aug 05, 2005 10:38 am
Posts: 11
no idea?


Top
 Profile  
 
 Post subject: need help
PostPosted: Tue Oct 11, 2005 2:18 pm 
Newbie

Joined: Fri Aug 05, 2005 10:38 am
Posts: 11
come on.. there must be a solution for this...


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