-->
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.  [ 2 posts ] 
Author Message
 Post subject: Problems configuring Hibernate to use JTA or CMT transaction
PostPosted: Sun Jun 03, 2007 11:14 am 
Newbie

Joined: Wed Apr 25, 2007 4:02 pm
Posts: 7
Hibernate version: 3.2
JBoss version: 4.0.5
MySQL: 5.0.x
MySQL JDBC Driver: 3.1.14

Hello everybody,

I'm currently writing my master thesis and i have to configure Hibernate using different transaction manager. Now the problem is when configuring Hibernate using different transaction services i receive the following error:
The error is the same when i configure Hibernate to use CMTTransaction or JTATransaction


Code:
[java] Exception in thread "main" java.lang.ExceptionInInitializerError
     [java] at persistence.HibernateKonfiguration.<clinit>(Unknown Source)
     [java] at sessionBeans.TerminVerwaltungBean.terminAnlegen(Unknown Source)
     [java] at client.TerminverwaltungTest.main(Unknown Source)
     [java] Caused by: org.hibernate.HibernateException: Could not locate TransactionManager
     [java] at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:26)
     [java] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:325)
     [java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
     [java] at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
     [java] ... 3 more
     [java] Caused by: javax.naming.NameNotFoundException: TransactionManager not bound
     [java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
     [java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
     [java] at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
     [java] at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
     [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java] at java.lang.reflect.Method.invoke(Method.java:597)
     [java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
     [java] at sun.rmi.transport.Transport$1.run(Transport.java:159)
     [java] at java.security.AccessController.doPrivileged(Native Method)
     [java] at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
     [java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
     [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
     [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
     [java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
     [java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
     [java] at java.lang.Thread.run(Thread.java:619)
     [java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
     [java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
     [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
     [java] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
     [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
     [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
     [java] at javax.naming.InitialContext.lookup(InitialContext.java:392)
     [java] at org.hibernate.transaction.JNDITransactionManagerLookup.getTransactionManager(JNDITransactionManagerLookup.java:23)



Hibernate.cfg.xml:

Code:
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
       <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
       <property name="hibernate.connection.url">jdbc:mysql://localhost:3306/terminverwaltung</property>
       <property name="hibernate.connection.username">root</property>
        <property name="hibernate.connection.password"></property>
        <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property>
       <property name="hibernate.transaction.factory_class">org.hibernate.transaction.CMTTransactionFactory</property>
       <property name="jta.UserTransaction">java:comp/UserTransaction</property>
</property>



When i also configure the datasource property i receive another error:

Code:
   [java] 15:26:45,700 FATAL DatasourceConnectionProvider:55 - Could not find datasource: java:mysqlDS
     [java] javax.naming.NameNotFoundException: mysqlDS not bound
     [java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
     [java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
     [java] at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
     [java] at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
     [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java] at java.lang.reflect.Method.invoke(Method.java:597)
     [java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
     [java] at sun.rmi.transport.Transport$1.run(Transport.java:159)
     [java] at java.security.AccessController.doPrivileged(Native Method)
     [java] at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
     [java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
     [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
     [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
     [java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
     [java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
     [java] at java.lang.Thread.run(Thread.java:619)
     [java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
     [java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
     [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
     [java] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
     [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
     [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
     [java] at javax.naming.InitialContext.lookup(InitialContext.java:392)
     [java] at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
     [java] at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
     [java] at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
     [java] at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:410)
     [java] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
     [java] at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
     [java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
     [java] at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
     [java] at persistence.HibernateKonfiguration.<clinit>(Unknown Source)
     [java] at sessionBeans.TerminVerwaltungBean.terminAnlegen(Unknown Source)
     [java] at client.TerminverwaltungTest.main(Unknown Source)
     [java] Exception in thread "main" java.lang.ExceptionInInitializerError
     [java] at persistence.HibernateKonfiguration.<clinit>(Unknown Source)
     [java] at sessionBeans.TerminVerwaltungBean.terminAnlegen(Unknown Source)
     [java] at client.TerminverwaltungTest.main(Unknown Source)
     [java] Caused by: org.hibernate.HibernateException: Could not find datasource
     [java] at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:56)
     [java] at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
     [java] at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
     [java] at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:410)
     [java] at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
     [java] at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
     [java] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
     [java] at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
     [java] ... 3 more
     [java] Caused by: javax.naming.NameNotFoundException: mysqlDS not bound
     [java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
     [java] at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
     [java] at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
     [java] at org.jnp.server.NamingServer.lookup(NamingServer.java:296)
     [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [java] at java.lang.reflect.Method.invoke(Method.java:597)
     [java] at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:305)
     [java] at sun.rmi.transport.Transport$1.run(Transport.java:159)
     [java] at java.security.AccessController.doPrivileged(Native Method)
     [java] at sun.rmi.transport.Transport.serviceCall(Transport.java:155)
     [java] at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:535)
     [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:790)
     [java] at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:649)
     [java] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:885)
     [java] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
     [java] at java.lang.Thread.run(Thread.java:619)
     [java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:255)
     [java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:233)
     [java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:142)
     [java] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
     [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
     [java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
     [java] at javax.naming.InitialContext.lookup(InitialContext.java:392)
     [java] at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)



I would really appreciate your help.

Thank you very much,

Roland


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 04, 2007 5:04 pm 
Newbie

Joined: Wed Apr 25, 2007 4:02 pm
Posts: 7
Is there anyone who can help me with this problem? Its urgent.

Thanks of all the help

Roland


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