-->
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.  [ 2 posts ] 
Author Message
 Post subject: NoSuchFieldError: tableNameBinding
PostPosted: Fri Feb 24, 2006 10:15 am 
Beginner
Beginner

Joined: Mon Dec 05, 2005 4:15 am
Posts: 36
I try to get my first application with EJB3.
At the first line of my application:

Code:
EntityManagerFactory emf = Persistence.createEntityManagerFactory("manager", new HashMap());


comes an exception:
Code:
Exception in thread "main" java.lang.NoSuchFieldError: tableNameBinding
   at org.hibernate.cfg.AnnotationConfiguration.createExtendedMappings(AnnotationConfiguration.java:140)
   at org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:273)
   at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:210)
   at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:988)
   at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:722)
   at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:161)
   at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:567)
   at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:118)
   at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:165)
   at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:103)
   at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
   at ejb3.ejb3test.main(ejb3test.java:14)



Hibernate version: 3.1

My Entity bean:


package pojo;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

@Entity
@Table(name="users")
public class Users {
private String id;

@Id
public String getId() {
return userid;
}

public void setId(String userid) {
this.userid = userid;
}

}


My client application:
Code:
package ejb3;
import java.util.HashMap;

import javax.persistence.EntityManager;
import javax.persistence.EntityManagerFactory;
import javax.persistence.Persistence;


public class ejb3test {
   
   EntityManager emf;
   
   public static void main(String[] args){
      EntityManagerFactory emf = Persistence.createEntityManagerFactory("manager", new HashMap());
      emf.createEntityManager();
   }

}



My config:

hibernate-annotations-3.1beta8
hibernate-entitymanager-3.1beta6
hibernate-3.1rc2
jboss-EJB-3.0_RC5-PFD

persistence.xml:
Code:
<persistence>
   <persistence-unit name="manager" transaction-type="RESOURCE_LOCAL">
      <class>pojo.Users</class>
      <properties>
         <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>
         <property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver"/>
         <property name="hibernate.connection.username" value="sa"/>
         <property name="hibernate.connection.password" value=""/>
         <property name="hibernate.connection.url" value="jdbc:mysql://myhost/mydb"/>
         <property name="hibernate.max_fetch_depth" value="3"/>
      </properties>
   </persistence-unit>
</persistence>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 24, 2006 11:07 am 
Beginner
Beginner

Joined: Mon Dec 05, 2005 4:15 am
Posts: 36
the problem is solved, it was a version conflict of the jar's.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.