-->
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: hibernate2.1.1 does not get beyond SessionFactory
PostPosted: Thu Jan 08, 2004 9:22 am 
Newbie

Joined: Thu Jan 08, 2004 9:11 am
Posts: 2
Can someone help me ?

I am running an ant build script with junit and the test fails while in the buildSettings. I am very confused as to why this is happening. It looks like it cannot find the net.sf.ehcache.hibernate.Provider class . I tried looking for this file and it is not in the binary distribution or in the source.

Below is an excerpt running it in ant/junit.

[junit] DEBUG [main] - opening new JDBC connection
[junit] DEBUG [main] - created connection to: jdbc:inetdae:witsdev13:1433:workwell_dm, Isola
tion Level: 2
[junit] DEBUG [main] - returning connection to pool, pool size: 1
[junit] INFO [main] - Use scrollable result sets: true
[junit] INFO [main] - echoing all SQL to stdout
[junit] INFO [main] - Query language substitutions: {}
[junit] INFO [main] - cache provider: net.sf.ehcache.hibernate.Provider
[junit] ------------- ---------------- ---------------
[junit] ------------- Standard Error -----------------
[junit] Begin ApplicationProperties.init
[junit] c:\cygwin\home\Administrator\workwell_v3\src\wws\properties\PropertiesMaster.cfg
[junit] End ApplicationProperties.init
[junit] net.sf.hibernate.HibernateException: could not instantiate CacheProvider: net.sf.ehc
ache.hibernate.Provider
[junit] at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:115)
[junit] at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1078)
[junit] at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:724
)
[junit] at com.workwell.util.database.HibernateUtil.<clinit>(HibernateUtil.java:12)
[junit] at com.workwell.security.UserBroker.submitUserLogin(UserBroker.java:121)
[junit] at test.security.TestUserController.testUserBroker(TestUserController.java:44)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)

[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.
java:25)
[junit] at java.lang.reflect.Method.invoke(Method.java:324)
[junit] at junit.framework.TestCase.runTest(TestCase.java:154)
[junit] at junit.framework.TestCase.runBare(TestCase.java:127)
[junit] at junit.framework.TestResult$1.protect(TestResult.java:106)
[junit] at junit.framework.TestResult.runProtected(TestResult.java:124)
[junit] at junit.framework.TestResult.run(TestResult.java:109)
[junit] at junit.framework.TestCase.run(TestCase.java:118)
[junit] at junit.framework.TestSuite.runTest(TestSuite.java:208)
[junit] at junit.framework.TestSuite.run(TestSuite.java:203)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRun
ner.java:326)
[junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRu
nner.java:560)
[junit] Caused by: java.lang.ClassNotFoundException: net.sf.ehcache.hibernate.Provider
[junit] at java.net.URLClassLoader$1.run(URLClassLoader.java:199)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 08, 2004 9:25 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Add lib/ehcache.jar (from the Hibernate distribution) to your classpath or switch cache provider, as described in http://www.hibernate.org/hib_docs/refer ... ormance-s3

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 08, 2004 9:15 pm 
Beginner
Beginner

Joined: Sun Sep 14, 2003 10:54 am
Posts: 36
christian wrote:
Add lib/ehcache.jar (from the Hibernate distribution) to your classpath or switch cache provider, as described in http://www.hibernate.org/hib_docs/refer ... ormance-s3


Sounds like ehcache is the default cache used by HB. This may lead to a confusion since lib/README.txt says ehcache.jar is optional. It's optional only if some other cache is specified.


Top
 Profile  
 
 Post subject: Thanks for your help
PostPosted: Fri Jan 09, 2004 2:50 pm 
Newbie

Joined: Thu Jan 08, 2004 9:11 am
Posts: 2
It was as you said I was missing the ehcache.jar ... I think I might have missed that as part of the required libs and did not move it in the test.


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.