-->
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.  [ 3 posts ] 
Author Message
 Post subject: EJB3 entities - hibernate
PostPosted: Mon Mar 31, 2008 1:40 am 
Newbie

Joined: Thu Mar 27, 2008 5:41 am
Posts: 5
Hi!
I am using EJB3 persistence API's to create my entities ie JPA. However, I am not using the complete EJB3 architecture of session beans, entities etc. I want to use hibernate as my persistence provider. My client will be a standalone java program which will be calling my entities. Has anybody worked on this architecture?
My doubt is:
1) I have created a jar with these entities and persistence.xml configuration file. Within my persistence.xml file, I am using hibernate properties like hibernate.connection.username, hibernate.connection.password etc. I have no separate hibernate.cfg.xml file. If somebody has used it, then please tell me whether the procedure I am following is correct or not.
2) I am using jboss cache as my 2nd level caching. When I compile my java program with the entity jar in my classpath, it compiles without giving error. But when I run it, it gives me error:
Exception in thread "main" javax.persistence.PersistenceException: org.hibernate.HibernateException: Could not instantiate TransactionManagerLookup 'org.jboss.cache.TransactionManagerLookup'
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:720)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:121)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:51)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:33)
at TestPersistence.main(TestPersistence.java:18)


My persistence.xml file has the following properties:
<property name="hibernate.cache.use_second_level_cache" value="true" />
<property name="hibernate.cache.provider_class" value = "org.hibernate.cache.TreeCacheProvider"/>
<!-- JBoss Cache configuration file name -->
<property name="hibernate.cache.provider_configuration_file_resource_path" value="cache-config.xml" />

<property name="hibernate.transaction.manager_lookup_class" value="org.jboss.cache.TransactionManagerLookup" />
<property name="hibernate.generate_statistics" value="true" />
<property name="hibernate.cache.use_structured_entries" value="true" />


"cache-config.xml" file is in my META-INF.

I will be thankful if someone could sugest me a solution


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 31, 2008 3:53 am 
Newbie

Joined: Sun Mar 30, 2008 1:37 pm
Posts: 5
Maybe this will be helpful
hibernate.transaction.manager_lookup_class = org.hibernate.transaction.JBossTransactionManagerLookup


http://www.hibernate.org/hib_docs/refer ... ation.html


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 31, 2008 4:11 am 
Newbie

Joined: Thu Mar 27, 2008 5:41 am
Posts: 5
Thanks jsshop for the information..
My problem is that I am still getting that error when I use jboss cache as my 2nd level caching mechanism


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