Problema com Hibernate

Depois de add os jars do hibernate no netbeans 6.9.1
Rodando a aplicação… erro:

run:
SLF4J: Failed to load class “org.slf4j.impl.StaticLoggerBinder”.
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Exception in thread “main” java.lang.NoClassDefFoundError: javax/persistence/Cacheable
at org.hibernate.cfg.AnnotationBinder.determineCacheSettings(AnnotationBinder.java:988)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:579)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3977)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3931)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1368)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1826)
at firshhibernate.Main.main(Main.java:23)
Caused by: java.lang.ClassNotFoundException: javax.persistence.Cacheable
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
… 7 more
Java Result: 1

Alguem sabe porque este erro?!

A partir deste download http://www.slf4j.org/dist/slf4j-1.6.1.zip

voçê tem que adicionar essas duas bibliotecas

[color=red]slf4j-api-1.6.1
slf4j-simple-1.6.1[/color]

Obs: o Netbeans já vem com todas as bibliotecas necessárias para utilizar o hibernate, quando voçê adiciona uma library.

Amigo,
adicionei os jars e agora ele reclama disso:

run:
140 [main] INFO org.hibernate.annotations.common.Version - Hibernate Commons Annotations 3.2.0.Final
156 [main] INFO org.hibernate.cfg.Environment - Hibernate 3.6.1.Final
156 [main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
156 [main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
172 [main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
312 [main] INFO org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: firshhibernate.Users
Exception in thread “main” java.lang.NoClassDefFoundError: javax/persistence/Cacheable
at org.hibernate.cfg.AnnotationBinder.determineCacheSettings(AnnotationBinder.java:988)
at org.hibernate.cfg.AnnotationBinder.bindClass(AnnotationBinder.java:579)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processAnnotatedClassesQueue(Configuration.java:3977)
at org.hibernate.cfg.Configuration$MetadataSourceQueue.processMetadata(Configuration.java:3931)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1368)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1826)
at firshhibernate.Main.main(Main.java:23)
Caused by: java.lang.ClassNotFoundException: javax.persistence.Cacheable
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
… 7 more
Java Result: 1

Henrique

acredito que seja algo com relação ao Driver Java DB que não foi instalado. Mas tbm não acho ele nas librarys do netbeans

erro:

08/02/2011 01:10:46 org.hibernate.connection.C3P0ConnectionProvider configure
INFO: C3P0 using driver: org.apache.derby.jdbc.ClientDriver at URL: jdbc:derby://localhost:1527/testehibernate
08/02/2011 01:10:46 org.hibernate.connection.C3P0ConnectionProvider configure
INFO: Connection properties: {user=test, password=****}
08/02/2011 01:10:46 org.hibernate.connection.C3P0ConnectionProvider configure
INFO: autocommit mode: false
08/02/2011 01:10:46 org.hibernate.connection.C3P0ConnectionProvider configure
SEVERE: JDBC Driver class not found: org.apache.derby.jdbc.ClientDriver
java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:100)
at org.hibernate.connection.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:96)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:414)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
at firshhibernate.Main.main(Main.java:23)
Exception in thread “main” org.hibernate.HibernateException: JDBC Driver class not found: org.apache.derby.jdbc.ClientDriver
at org.hibernate.connection.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:101)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)
at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:56)
at org.hibernate.cfg.SettingsFactory.createConnectionProvider(SettingsFactory.java:414)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:62)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2009)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1292)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:859)
at firshhibernate.Main.main(Main.java:23)
Caused by: java.lang.ClassNotFoundException: org.apache.derby.jdbc.ClientDriver
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at org.hibernate.util.ReflectHelper.classForName(ReflectHelper.java:100)
at org.hibernate.connection.C3P0ConnectionProvider.configure(C3P0ConnectionProvider.java:96)
… 8 more
Java Result: 1
CONSTRUÍDO COM SUCESSO (tempo total: 0 segundos)

Resolvi, como usei o DB Derby do NetBeans, baixei o driver dele a parte na net, pq não achei a biblioteca no netbeans, daí pegou normal.

Antes me lembro que tinha uma Biblioteca com nome Java DB Driver no netbeans, mai agora observei que não tah mais, sabes pq?!

abraços.

respondido?

Resolvido, vlw pessoal! :smiley: