[jboss-user] [JBoss Eclipse IDE (users)] - Cache-related error creating SessionFactory in Hibernate Con

dserodio do-not-reply at jboss.com
Tue Aug 29 13:10:34 EDT 2006


I'm using Eclipse 3.2, with Hibernate Tools beta7.

I created a "hibernate.cfg.xml" using the Eclipse Wizard, but when I try to open the SessionFactory in Hibernate Console, I get:

org.hibernate.HibernateException: Could not instantiate cache implementation
  | 	at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:64)
  | 	at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:214)
  | 	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
  | 	at org.hibernate.console.ConsoleConfiguration$2.execute(ConsoleConfiguration.java:282)
  | 	at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:56)
  | 	at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:85)
  | 	at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:277)
  | 	at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:41)
  | 	at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:88)
  | 	at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:94)
  | 	at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:207)
  | 	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:58)
  | Caused by: org.hibernate.cache.NoCachingEnabledException: Second-level cache is not enabled for usage [hibernate.cache.use_second_level_cache | hibernate.cache.use_query_cache]
  | 	at org.hibernate.cache.NoCacheProvider.buildCache(NoCacheProvider.java:21)
  | 	at org.hibernate.cache.CacheFactory.createCache(CacheFactory.java:61)
  | 	... 11 more

I added the suggested settings to the hibernate.cfg.xml file, but I still get the same error. My cfg file is:
<?xml version="1.0" encoding="UTF-8"?>
  | <!DOCTYPE hibernate-configuration PUBLIC
  | 		"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
  | 		"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
  | <hibernate-configuration>
  |     <session-factory name="Console">
  |         <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
  |         <property name="hibernate.connection.url">jdbc:hsqldb:bd/nfe</property>
  |         <property name="hibernate.connection.username">sa</property>
  |         <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
  |         <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
  |         <property name="hibernate.cache.use_second_level_cache">true</property>
  |         <property name="hibernate.cache.use_query_cache">true</property>
  |     </session-factory>
  | </hibernate-configuration>
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3968154#3968154

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3968154



More information about the jboss-user mailing list