I am trying to initialize hibernate from a startup servlet within Tomcat. The following line of code
QUERY_KEY_FACTORY = (QueryCacheKeyFactory) KeyFactory.create(QueryCacheKeyFactory.class);
in
package net.sf.hibernate.impl.SessionFactoryImpl
semms to be called twice after
sessionFactory = new Configuration().configure().buildSessionFactory();
The first time it executes fine, the next time it blows up on finding the KeyFactory and I get a java.lang.NoClassDefFoundError
I am using Eclipse to attach a debugger to tomcat, and have downlowded the cglib src jar. I can step into the jar the first time it is called, but not the second.
I have checked the required libraries in the readme.txt file and I have all the required, and some of the optional that I was not sure about.
I am stuck any help would be greatly appreciated.
Thanks,
Chad
Hibernate version:
2.1.6
Code between sessionFactory.openSession() and session.close():
try {
// Create the SessionFactory
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (HibernateException ex) {
sessionFactory = new Configuration().configure().buildSessionFactory();
} catch (HibernateException ex) {
Full stack trace of any exception that occurs:
java.lang.RuntimeException: Configuration problem: null
at gov.fbi.vicap.dal.HibernateSessionManager.<init>(HibernateSessionManager.java:34)
at gov.fbi.vicap.init.VicapFactoryInit.init(VicapFactoryInit.java:12)
at javax.servlet.GenericServlet.init(GenericServlet.java:211)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1029)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:862)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4013)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4357)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:789)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1083)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:478)
at org.apache.catalina.core.StandardService.start(StandardService.java:480)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:2313)
at org.apache.catalina.startup.Catalina.start(Catalina.java:556)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:287)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:425)
Caused by: java.lang.NoClassDefFoundError
at net.sf.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.java:236)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:791)
at gov.fbi.vicap.dal.HibernateSessionManager.<init>(HibernateSessionManager.java:25)
... 19 more
2004-12-17 11:44:46 StandardContext[/balancer]org.apache.webapp.balancer.BalancerFilter: init(): ruleChain: [org.apache.webapp.balancer.RuleChain: [org.apache.webapp.balancer.rules.URLStringMatchRule: Target string: News / Redirect URL:
http://www.cnn.com], [org.apache.webapp.balancer.rules.RequestParameterRule: Target param name: paramName / Target param value: paramValue / Redirect URL:
http://www.yahoo.com], [org.apache.webapp.balancer.rules.AcceptEverythingRule: Redirect URL:
http://jakarta.apache.org]]
Name and version of the database you are using:
Oracle 9.i