Erro retornado usando hibernate

1 resposta
M

Ola, pessoal!Eu tava mapei uma simples classe, com os campos id, nome, sobrenome, email, datcadastro. Mas me retorna o seguinte erro, o que é isso?

Exception in thread "main" java.lang.ExceptionInInitializerError
	at hiberpack.HiberUtil.<clinit>(HiberUtil.java:18)
	at hiberpack.TesteContato.main(TesteContato.java:9)
Caused by: java.lang.NoClassDefFoundError: net/sf/cglib/core/KeyFactory
	at org.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.java:321)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
	at hiberpack.HiberUtil.<clinit>(HiberUtil.java:14)
	... 1 more
16:23:11,233  INFO SettingsFactory:237 - Structured second-level cache entries: disabled
16:23:11,249 DEBUG SQLExceptionConverterFactory:52 - Using dialect defined converter
16:23:11,280  INFO SettingsFactory:257 - Echoing all SQL to stdout
16:23:11,280  INFO SettingsFactory:261 - Statistics: disabled
16:23:11,280  INFO SettingsFactory:265 - Deleted entity synthetic identifier rollback: disabled
16:23:11,280  INFO SettingsFactory:279 - Default entity-mode: pojo
16:23:11,327 ERROR HiberUtil:17 - Initial SessionFactory creation failed.
java.lang.NoClassDefFoundError: net/sf/cglib/core/KeyFactory
	at org.hibernate.impl.SessionFactoryImpl.<clinit>(SessionFactoryImpl.java:321)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1005)
	at hiberpack.HiberUtil.<clinit>(HiberUtil.java:14)
	at hiberpack.TesteContato.main(TesteContato.java:9)

1 Resposta

_fs
Caused by: java.lang.NoClassDefFoundError: net/sf/cglib/core/KeyFactory

Este erro indica que a aplicação tentou acessar uma classe, mas não a encontrou.

Nesse caso basta colocar o cglib.jar (que vem junto na distribuição do Hibernate) no seu classpath.

Criado 18 de agosto de 2005
Ultima resposta 18 de ago. de 2005
Respostas 1
Participantes 2