-->
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.  [ 1 post ] 
Author Message
 Post subject: NoSuchMethodError: AnnotationConfiguration.setEntityNot...
PostPosted: Fri Jun 23, 2006 9:08 am 
Newbie

Joined: Tue Apr 26, 2005 10:45 am
Posts: 7
Hi,

i would like to program against the Java Persistence API using Hibernate. My current code looks like this:
Code:
public static void main(String[] args) {
    Class.forName("org.hsqldb.jdbcDriver").newInstance();
        // start persistence
       
        final EntityManagerFactory factory = Persistence.createEntityManagerFactory("gse");
        final EntityManager manager = factory.createEntityManager();

}


This throws a NoSuchMethodError if i use Hibernate 3.2CR2 and a ClassNotFoundException if i use Hibernate 3.2CR1. I guess these libraries of Hibernate, Hibernate Annotations and Hibernate EntityManager are some kind of incompatible. Is there an version known to work?

Thanks,
Alexander


Hibernate version:

Hibernate 3.2 CR1
Hibernate 3.2.CR2
Hibernate Annotations 3.2.0 CR1
Hibernate EntityManager 3.2.0 CR1

Mapping documents:

In my case this is the persistence.xml in the folder META-INF/

Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence 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/persistence_1_0.xsd"
   version="1.0">

    <!-- external database setup -->
    <!--
   <persistence-unit name="sample" transaction-type="RESOURCE_LOCAL">
       <class>addressbook.Person</class>
      <properties>
         <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
         <property name="hibernate.connection.username" value="sa"/>
         <property name="hibernate.connection.password" value=""/>
         <property name="hibernate.connection.url" value="jdbc:hsqldb:hsql://localhost"/>
         <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
         <property name="hibernate.hbm2ddl.auto" value="update"/>         
      </properties>
   </persistence-unit>
    -->
   
   <!-- in-process database setup -->
   <persistence-unit name="gse" transaction-type="RESOURCE_LOCAL">
       <class>de.informus.gse.data.Area</class>
       <class>de.informus.gse.data.Category</class>
       <class>de.informus.gse.data.File</class>
       <class>de.informus.gse.data.MapMarker</class>
       <class>de.informus.gse.data.Metadata</class>
       <class>de.informus.gse.data.PointOfContact</class>
       <class>de.informus.gse.data.PolicyDriver</class>
       <class>de.informus.gse.data.Product</class>
       <class>de.informus.gse.data.ProductType</class>
       <class>de.informus.gse.data.Quicklook</class>
       <class>de.informus.gse.data.Resource</class>
       <class>de.informus.gse.data.ServiceActor</class>
       <class>de.informus.gse.data.ServiceCase</class>
       <class>de.informus.gse.data.ServiceProvider</class>
       <class>de.informus.gse.data.ServiceType</class>
       <class>de.informus.gse.data.ServiceUser</class>
       <class>de.informus.gse.data.Time</class>
       <properties>
         <property name="hibernate.connection.driver_class" value="org.hsqldb.jdbcDriver"/>
         <property name="hibernate.connection.username" value="sa"/>
         <property name="hibernate.connection.password" value=""/>
         <property name="hibernate.connection.url" value="jdbc:hsqldb:GsefmDB"/>
         <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>
         <property name="hibernate.hbm2ddl.auto" value="update"/>         
      </properties>
   </persistence-unit>
</persistence>


Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.cfg.AnnotationConfiguration.setEntityNotFoundDelegate(Lorg/hibernate/proxy/EntityNotFoundDelegate;)V
at org.hibernate.ejb.Ejb3Configuration.<init>(Ejb3Configuration.java:94)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:113)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
Name and version of the database you are using:

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:

Code:


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.