Problema com hibernate

2 respostas
F

Estou aprendendo a usar o hibernate e estou tendo o seguinte erro quando uso o método createEntityManagerFactory()…

aqui está a saida do console:

0 [main] INFO  org.hibernate.cfg.annotations.Version - Hibernate Annotations <a href="http://3.4.0.GA">3.4.0.GA</a>

16 [main] INFO  org.hibernate.cfg.Environment - Hibernate 3.3.0.SP1

16 [main] INFO  org.hibernate.cfg.Environment - hibernate.properties not found

16 [main] INFO  org.hibernate.cfg.Environment - Bytecode provider name : javassist

31 [main] INFO  org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling

94 [main] INFO  org.hibernate.annotations.common.Version - Hibernate Commons Annotations <a href="http://3.1.0.GA">3.1.0.GA</a>

94 [main] INFO  org.hibernate.ejb.Version - Hibernate EntityManager 3.6.0.Final

375 [main] INFO  org.hibernate.cfg.AnnotationBinder - Binding entity from annotated class: modelo.Editora

422 [main] INFO  org.hibernate.cfg.annotations.EntityBinder - Bind entity modelo.Editora on table Editora

469 [main] INFO  org.hibernate.cfg.AnnotationConfiguration - Hibernate Validator not found: ignoring

484 [main] INFO  org.hibernate.cfg.search.HibernateSearchEventListenerRegister - Unable to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate Search is not enabled.

547 [main] INFO  org.hibernate.connection.DriverManagerConnectionProvider - Using Hibernate built-in connection pool (not for production use!)

547 [main] INFO  org.hibernate.connection.DriverManagerConnectionProvider - Hibernate connection pool size: 20

547 [main] INFO  org.hibernate.connection.DriverManagerConnectionProvider - autocommit mode: true

562 [main] INFO  org.hibernate.connection.DriverManagerConnectionProvider - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost/test

562 [main] INFO  org.hibernate.connection.DriverManagerConnectionProvider - connection properties: {user=root, password=****, autocommit=true, release_mode=auto}

953 [main] INFO  org.hibernate.cfg.SettingsFactory - RDBMS: MySQL, version: 5.1.33-community

953 [main] INFO  org.hibernate.cfg.SettingsFactory - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-5.1.13 ( Revision: ${bzr.revision-id} )

969 [main] INFO  org.hibernate.dialect.Dialect - Using dialect: org.hibernate.dialect.MySQL5InnoDBDialect

984 [main] INFO  org.hibernate.transaction.TransactionFactoryFactory - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory

984 [main] INFO  org.hibernate.transaction.TransactionManagerLookupFactory - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Automatic flush during beforeCompletion(): disabled

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Automatic session close at end of transaction: disabled

984 [main] INFO  org.hibernate.cfg.SettingsFactory - JDBC batch size: 15

984 [main] INFO  org.hibernate.cfg.SettingsFactory - JDBC batch updates for versioned data: disabled

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Scrollable result sets: enabled

984 [main] INFO  org.hibernate.cfg.SettingsFactory - JDBC3 getGeneratedKeys(): enabled

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Connection release mode: auto

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Maximum outer join fetch depth: 2

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Default batch fetch size: 1

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Generate SQL with comments: disabled

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Order SQL updates by primary key: disabled

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Order SQL inserts for batching: disabled

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory

984 [main] INFO  org.hibernate.hql.ast.ASTQueryTranslatorFactory - Using ASTQueryTranslatorFactory

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Query language substitutions: {}

984 [main] INFO  org.hibernate.cfg.SettingsFactory - JPA-QL strict compliance: enabled

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Second-level cache: enabled

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Query cache: disabled

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Cache region factory : org.hibernate.cache.impl.NoCachingRegionFactory

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Optimize cache for minimal puts: disabled

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Structured second-level cache entries: disabled

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Statistics: disabled

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Deleted entity synthetic identifier rollback: disabled

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Default entity-mode: pojo

984 [main] INFO  org.hibernate.cfg.SettingsFactory - Named query checking : enabled

1031 [main] INFO  org.hibernate.impl.SessionFactoryImpl - building session factory

1203 [main] INFO  org.hibernate.impl.SessionFactoryObjectFactory - Not binding factory to JNDI, no JNDI name configured

1203 [main] INFO  org.hibernate.tool.hbm2ddl.SchemaUpdate - Running hbm2ddl schema update

1203 [main] INFO  org.hibernate.tool.hbm2ddl.SchemaUpdate - fetching database metadata

1203 [main] INFO  org.hibernate.tool.hbm2ddl.SchemaUpdate - updating schema

1234 [main] INFO  org.hibernate.tool.hbm2ddl.TableMetadata - table found: test.editora

1234 [main] INFO  org.hibernate.tool.hbm2ddl.TableMetadata - columns: [id, email, nome]

1234 [main] INFO  org.hibernate.tool.hbm2ddl.TableMetadata - foreign keys: []

1234 [main] INFO  org.hibernate.tool.hbm2ddl.TableMetadata - indexes: [primary]

1234 [main] INFO  org.hibernate.tool.hbm2ddl.SchemaUpdate - schema update complete

Exception in thread “main” java.lang.NoSuchMethodError: org.hibernate.mapping.PersistentClass.getSuperMappedSuperclass()Lorg/hibernate/mapping/MappedSuperclass;

at org.hibernate.ejb.metamodel.MetamodelImpl.buildEntityType(MetamodelImpl.java:83)

at org.hibernate.ejb.metamodel.MetamodelImpl.locateOrBuildEntityType(MetamodelImpl.java:73)

at org.hibernate.ejb.metamodel.MetamodelImpl.buildMetamodel(MetamodelImpl.java:63)

at org.hibernate.ejb.EntityManagerFactoryImpl.(EntityManagerFactoryImpl.java:84)

at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:902)

at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:57)

at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:52)

at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:34)

at teste.InsereEditoraComJPA.main(InsereEditoraComJPA.java:12)

alguem poderia dar uma ajuda???

2 Respostas

newbcc

Olá,

cara verifica se você possui o seguinte jar no seu classpath

hibernate3.jar

O erro está ocorrendo porque a sua aplicação não encontrou o método

getSuperMapped da classe org.hibernate.mapping.PersistentClass

que está dentro do jar acima.

Abs!

F

Eu tenho ela no classpath sim…

Criado 19 de novembro de 2010
Ultima resposta 19 de nov. de 2010
Respostas 2
Participantes 2