Hello,
I'm working on JPA project with Hibernate 3.3 and eclipse 3.5 with the Hibernate Tools and the eclipse Dali plugin installed. When I now try to open the SessionFactory node in the Hibernate View of eclipse I'm getting always the following excetion:
[code]
java.lang.NoSuchMethodError: com.opensymphony.oscache.util.StringUtil.isEmpty(Ljava/lang/String;)Z
at com.opensymphony.oscache.hibernate.OSCacheProvider.start(OSCacheProvider.java:111)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:183)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1294)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
at org.hibernate.console.ConsoleConfiguration$3.execute(ConsoleConfiguration.java:505)
at org.hibernate.console.execution.DefaultExecutionContext.execute(DefaultExecutionContext.java:64)
at org.hibernate.console.ConsoleConfiguration.execute(ConsoleConfiguration.java:94)
at org.hibernate.console.ConsoleConfiguration.buildSessionFactory(ConsoleConfiguration.java:500)
at org.hibernate.eclipse.console.workbench.LazySessionFactoryAdapter.getChildren(LazySessionFactoryAdapter.java:43)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.getChildren(BasicWorkbenchAdapter.java:100)
at org.hibernate.eclipse.console.workbench.BasicWorkbenchAdapter.fetchDeferredChildren(BasicWorkbenchAdapter.java:106)
at org.eclipse.ui.progress.DeferredTreeContentManager$1.run(DeferredTreeContentManager.java:234)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
[/code]
persistens.xml:
[code]
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/ ... ce_1_0.xsd">
<persistence-unit name="GartenSWT" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
</persistence-unit>
</persistence>
[/code]
hibernate.properties
[code]
hibernate.show_sql=false
hibernate.format_sql=false
hibernate.use_sql_comments=false
hibernate.current_session_context_class=thread
hibernate.connection.provider_class=org.hibernate.connection.C3P0ConnectionProvider
hibernate.cache.provider_class=com.opensymphony.oscache.hibernate.OSCacheProvider
hibernate.cache.use_query_cache=true
hibernate.cache.use_second_level_cache=true
hibernate.generate_statistics=true
hibernate.bytecode.provider=cglib
hibernate.bytecode.use_reflection_optimizer=true
hibernate.c3p0.minPoolSize=2
hibernate.c3p0.maxPoolSize=5
hibernate.c3p0.timeout=2000
hibernate.c3p0.max_statement=50
hibernate.c3p0.testConnectionOnCheckout=false
[/code]
hibernate.cfg.xml
[code]
<?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>
<mapping package="garten" />
<mapping class="garten.Garten" />
...
</session-factory>
</hibernate-configuration>
[/code]
But the 'missing' class is definitely in the classpath (build with maven). The Configuration and Database nodes are working fine. Also at runtime the hibernate access (with spring) works fine. So what's the reason for this exception ?
After a little bit of trying I've found that when I'm disable the lines
[code]
hibernate.connection.provider_class + hibernate.cache.provider_class
[/code]
in the hibernate.properties and change the lines
[code]
hibernate.cache.use_query_cache + hibernate.cache.use_second_level_cache from 'true' to 'false'
[/code]
it works. But where's the relation to the SessionFactory ?
Thank you
Lothar