Boa noite galera.
estou fazendo um projeto com hibernete + MY SQL
Criei um pacote util para meu banco
nele eu coloquei a classe.
GeraBanco.java
[code]
package br.com.lojavirtual.util;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
import org.hibernate.tool.hbm2ddl.SchemaExport;
public class GeraBanco {
public static void main(String[] args) {
Configuration conf = new AnnotationConfiguration();
conf.configure();
SchemaExport se = new SchemaExport(conf);
se.create(true, true);
}
}[/code]
HiberneteUtil.java
package br.com.lojavirtual.util;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;
import org.hibernate.cfg.Configuration;
public class HibernateUtil {
public static SessionFactory factory;
static{
Configuration conf = new AnnotationConfiguration();
conf.configure();
factory = conf.buildSessionFactory();
}
public static Session getSession(){
return factory.openSession();
}
}
Quando eu tento rodar, ele dá um erro abaixo:
Exception in thread "main" java.lang.NoClassDefFoundError: org/dom4j/DocumentException
at br.com.lojavirtual.util.GeraBanco.main(GeraBanco.java:13)
Caused by: java.lang.ClassNotFoundException: org.dom4j.DocumentException
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
... 1 more
O que seria??
Sou iniciante e estou meio perdido
Obrigado