jeveaux, seguinte, o problema acima eu resolvi, tô usando a ide do eclipse, e consegui importar os package do hibernate. O problema é que agora eu não consigo executar a aplicação, tá dando o seguinte erro:
java.lang.NoClassDefFoundError: org/dom4j/Attribute
at PessoaTeste.<init>(PessoaTeste.java:27)
at PessoaTeste.main(PessoaTeste.java:37)
Exception in thread “main”
a classe é a seguinte:
import net.sf.hibernate.HibernateException;
import net.sf.hibernate.SessionFactory;
import net.sf.hibernate.cfg.Configuration;
public class PessoaTeste {
public PessoaTeste(){
try{
Configuration cfg = new Configuration().configure();
SessionFactory sf = cfg.buildSessionFactory();
System.out.println("Ok");
}catch(HibernateException he){
he.printStackTrace();
}
}
public static void main(String[] args) {
PessoaTeste p = new PessoaTeste();
}
}
meu arquivo hibernate.cfg.xml é este:
<?xml version=‘1.0’ encoding=‘utf-8’?>
<!DOCTYPE hibernate-configuration PUBLIC
“-//Hibernate/Hibernate Configuration DTD//EN”
“http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd”>
<hibernate-configuration>
<session-factory>
<property name=“hibernate.connection.driver_class”>org.gjt.mm.mysql.Driver</property>
<property name=“hibernate.connection.url”>jdbc:mysql://localhost:3306/test</property>
<property name=“hibernate.connection.username”>admin</property>
<property name=“hibernate.connection.password”>admin</property>
<property name=“show_sql”>true</property>
<property name=“dialect”>net.sf.hibernate.dialect.MySQLDialect</property>
<!--Apresentado Posteriormente-->
<!--mapping resource="Pessoa.hbm.xml"/-->
</session-factory>
</hibernate-configuration>
Tentei de várias maneiras incluir um classpath no eclipse, mas não adiantou, ainda dá o mesmo erro:
java.lang.NoClassDefFoundError: org/dom4j/Attribute
at PessoaTeste.<init>(PessoaTeste.java:27)
at PessoaTeste.main(PessoaTeste.java:37)
Exception in thread “main”
Valeu, cara;