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: Myeclipse with hibernate capabilities......ERROR!!!...Helppp
PostPosted: Wed May 20, 2009 1:33 pm 
Newbie

Joined: Tue May 19, 2009 7:28 pm
Posts: 5
Helloo hibernators!

Im trying to use anottations to avoid doing the xml mapping file of the entity.

i have this POJO:

Quote:
import java.io.Serializable;
import javax.*;
import javax.persistence.Entity;
import javax.persistence.*;

@Entity
@Table (name="Employee")
public class Person {
@Id
@GeneratedValue (strategy = GenerationType.AUTO)
long id;
@Column (nullable=false, length=50)
String name;
@Column (nullable=false)
int age;

public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}

public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}

public int getAge() {
return age;
}
public void setAge(int age) {
this.age = age;
}

}


this hibernate.cfg.xml

Quote:
<?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">

<!-- Generated by MyEclipse Hibernate Tools. -->
<hibernate-configuration>

<session-factory>
<property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:jtds:sqlserver://127.0.0.1:1433/base1</property>
<property name="hibernate.connection.username">jorge</property>
<property name="hibernate.connection.password">xxx</property>
<property name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
<property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
<property name="hibernate.transaction.factory_class">org.hibernate.transaction.JDBCTransactionFactory</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.hbm2ddl.auto">update</property>
<property name="hibernate.generate_statistics">true</property>
<property name="hibernate.use_sql_comments">true</property>
<property name="hibernate.current_session_context_class">thread</property>

<mapping class="Person"/>
</session-factory>

</hibernate-configuration>


and i am getting the following error!!!!!!!....

Quote:
java.lang.NoSuchMethodError: org.hibernate.util.ReflectHelper.classForName(Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Class;
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:752)
at HibernateUtil.<clinit>(HibernateUtil.java:12)
at PersonDAO.insertPerson(PersonDAO.java:13)
at Client.main(Client.java:17)
Exception in thread "main" java.lang.NullPointerException
at PersonDAO.insertPerson(PersonDAO.java:13)
at Client.main(Client.java:17)


I cant find what this error could be in any forum !
Your help would be much appreciated!

Thanks,
Jorge


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.