-->
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: NoSuchMethodError with HibernateTools and eclipse
PostPosted: Sun Sep 27, 2009 2:14 pm 
Newbie

Joined: Mon Jun 13, 2005 9:29 am
Posts: 8
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


Top
 Profile  
 
 Post subject: Re: NoSuchMethodError with HibernateTools and eclipse
PostPosted: Mon Sep 28, 2009 8:21 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
The exception is not about the missing class.
The class com.opensymphony.oscache.util.StringUtil is present, but it haven't the method
StringUtil#isEmpty(String s).


Top
 Profile  
 
 Post subject: Re: NoSuchMethodError with HibernateTools and eclipse
PostPosted: Mon Sep 28, 2009 10:47 am 
Newbie

Joined: Mon Jun 13, 2005 9:29 am
Posts: 8
That can't be true. The method is still there ...


Top
 Profile  
 
 Post subject: Re: NoSuchMethodError with HibernateTools and eclipse
PostPosted: Mon Sep 28, 2009 4:42 pm 
Newbie

Joined: Mon Jun 13, 2005 9:29 am
Posts: 8
I've now switched to ehcache and this works.

Lothar


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.