-->
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: using hibernate under tomcat
PostPosted: Mon Feb 07, 2005 1:38 pm 
Newbie

Joined: Mon Jan 31, 2005 10:47 am
Posts: 6
Hi all, I configured a datasource under tomcat 5 and it works fine (i can save my object to the db with the connection got from the datasource object), but I'm having problems telling hibernate to use it...

Here's my hibernate.properties:

hibernate.connection.datasource=java:comp/env/jdbc/myoracle
hibernate.transaction.factory_class=net.sf.hibernate.transaction.JTATransactionFactory
hibernate.transaction.manager_lookup_class=net.sf.hibernate.transaction.JNDITransactionManagerLookup
hibernate.dialect=net.sf.hibernate.dialect.OracleDialect
hibernate.show_sql=true


...and here's my stack trace:

java.lang.UnsupportedOperationException: The user must supply a JDBC connection at net.sf.hibernate.connection.UserSuppliedConnectionProvider.getConnection(UserSuppliedConnectionProvider.java:32) at net.sf.hibernate.impl.BatcherImpl.openConnection(BatcherImpl.java:289) at net.sf.hibernate.impl.SessionImpl.connect(SessionImpl.java:3361) at net.sf.hibernate.impl.SessionImpl.connection(SessionImpl.java:3321) at net.sf.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:40) at net.sf.hibernate.transaction.JDBCTransactionFactory.beginTransaction(JDBCTransactionFactory.java:19) at net.sf.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:2251) at quickstart.CatCreator.doGet(CatCreator.java:55) ...

maybe it's obvious for some of you...

thanks a lot.


Top
 Profile  
 
 Post subject: TransactionManagerLookup Problem
PostPosted: Tue Feb 08, 2005 7:02 am 
Newbie

Joined: Mon Jan 31, 2005 10:47 am
Posts: 6
Hi all, I fixed the previous problem but I'm still getting an error message...


[2005-02-08 1124:41]INFO [http-8080-Processor25](TransactionManagerLookupFactory.java:38) - instantiating TransactionManagerLookup: net.sf.hibernate.transaction.JNDITransactionManagerLookup
[2005-02-08 1124:41]ERROR[http-8080-Processor25](TransactionManagerLookupFactory.java:46) - Could not instantiate TransactionManagerLookup
java.lang.InstantiationException
at sun.reflect.InstantiationExceptionConstructorAccessorImpl.newInstance(InstantiationExceptionConstructorAccessorImpl.java:30)
at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
at java.lang.Class.newInstance0(Class.java:350)
at java.lang.Class.newInstance(Class.java:303)
at net.sf.hibernate.transaction.TransactionManagerLookupFactory.getTransactionManagerLookup(TransactionManagerLookupFactory.java:41)
at net.sf.hibernate.transaction.JTATransactionFactory.configure(JTATransactionFactory.java:46)
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:1160)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:794)
at quickstart.CatCreator.doGet(CatCreator.java:52)


I'm posting the contents of my hibernate.properties again

hibernate.connection.datasource=java:comp/env/jdbc/myoracle
hibernate.transaction.factory_class=net.sf.hibernate.transaction.JTATransactionFactory
hibernate.transaction.manager_lookup_class=net.sf.hibernate.transaction.JNDITransactionManagerLookup
hibernate.dialect=net.sf.hibernate.dialect.OracleDialect
hibernate.show_sql=true



Maybe it's trivial for some of you, thanks


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.