java.lang.NoSuchMethodError: org.hibernate.ejb.EntityManagerFactoryImpl.<init>(Lorg/hibernate/SessionFactory;Ljavax/persistence/spi/PersistenceUnitTransactionType;Z)V

Hibernate JIRA | prabhu raman | 1 decade ago
  1. 0

    Using the latest published versions of Hibernate (3.2 cr2), Hib Annotations (3.1.0 Beta 10), Hib EntityManager (3.1.0 Beta 8) and a (1) simple Annotated Entity Bean (2) hibernate.properties file as present in the distribution (3) junit extending TestCase exactly as it appears in EntityManager distribution I get the following NoSuchMethod at runtime. Heres the complete output trace. 23:41:08,681 INFO Version:15 - Hibernate EntityManager 3.1.0.Beta8b 23:41:08,711 INFO Version:15 - Hibernate Annotations 3.1.0.Beta10b 23:41:08,731 INFO Environment:499 - Hibernate 3.2 cr2 23:41:08,741 INFO Environment:517 - loaded properties from resource hibernate.properties: {hibernate.connection.password=****, hibernate.jdbc.batch_versioned_data=true, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.cache.region_prefix=hibernate.test, hibernate.proxool.pool_alias=pool1, hibernate.bytecode.use_reflection_optimizer=false, hibernate.default_batch_fetch_size=8, hibernate.hbm2ddl.auto=create-drop, hibernate.jdbc.use_streams_for_binary=true, hibernate.max_fetch_depth=1, hibernate.connection.pool_size=1, hibernate.connection.username=guhaAdmin, hibernate.connection.driver_class=com.mysql.jdbc.Driver, hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider, javax.persistence.provider=org.hibernate.ejb.HibernatePersistence, javax.persistence.transactionType=RESOURCE_LOCAL, hibernate.order_updates=true, hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect, hibernate.connection.url=jdbc:mysql://localhost:3306/guha} 23:41:08,751 INFO Environment:548 - using java.io streams to persist binary types 23:41:08,751 INFO Environment:666 - Bytecode provider name : cglib 23:41:08,771 INFO Environment:583 - using JDK 1.4 java.sql.Timestamp handling 23:41:09,122 INFO AnnotationBinder:336 - Binding entity from annotated class: com.guha.entity.beans.SecurityValue 23:41:09,182 INFO EntityBinder:324 - Bind entity com.guha.entity.beans.SecurityValue on table SecurityValue 23:41:09,462 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!) 23:41:09,472 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 1 23:41:09,472 INFO DriverManagerConnectionProvider:45 - autocommit mode: true 23:41:09,482 INFO DriverManagerConnectionProvider:80 - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/guha 23:41:09,482 INFO DriverManagerConnectionProvider:86 - connection properties: {user=guhaAdmin, password=****, autocommit=true, release_mode=auto} 23:41:09,813 INFO SettingsFactory:78 - RDBMS: MySQL, version: 5.0.18-nt 23:41:09,813 INFO SettingsFactory:79 - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.12 ( $Date: 2005-11-17 15:53:48 +0100 (Thu, 17 Nov 2005) $, $Revision$ ) 23:41:09,843 INFO Dialect:128 - Using dialect: org.hibernate.dialect.MySQLInnoDBDialect 23:41:09,853 INFO TransactionFactoryFactory:34 - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory 23:41:09,863 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 23:41:09,863 INFO SettingsFactory:126 - Automatic flush during beforeCompletion(): disabled 23:41:09,863 INFO SettingsFactory:130 - Automatic session close at end of transaction: disabled 23:41:09,863 INFO SettingsFactory:137 - JDBC batch size: 15 23:41:09,863 INFO SettingsFactory:140 - JDBC batch updates for versioned data: enabled 23:41:09,873 INFO SettingsFactory:145 - Scrollable result sets: enabled 23:41:09,873 INFO SettingsFactory:153 - JDBC3 getGeneratedKeys(): enabled 23:41:09,873 INFO SettingsFactory:161 - Connection release mode: auto 23:41:09,873 INFO SettingsFactory:185 - Maximum outer join fetch depth: 1 23:41:09,873 INFO SettingsFactory:188 - Default batch fetch size: 8 23:41:09,883 INFO SettingsFactory:192 - Generate SQL with comments: disabled 23:41:09,883 INFO SettingsFactory:196 - Order SQL updates by primary key: enabled 23:41:09,883 INFO SettingsFactory:357 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 23:41:09,883 INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactory 23:41:09,883 INFO SettingsFactory:204 - Query language substitutions: {no='N', true=1, yes='Y', false=0} 23:41:09,893 INFO SettingsFactory:210 - Second-level cache: enabled 23:41:09,893 INFO SettingsFactory:214 - Query cache: disabled 23:41:09,893 INFO SettingsFactory:344 - Cache provider: org.hibernate.cache.HashtableCacheProvider 23:41:09,893 INFO SettingsFactory:229 - Optimize cache for minimal puts: disabled 23:41:09,893 INFO SettingsFactory:234 - Cache region prefix: hibernate.test 23:41:09,903 INFO SettingsFactory:238 - Structured second-level cache entries: disabled 23:41:09,913 INFO SettingsFactory:265 - Statistics: disabled 23:41:09,923 INFO SettingsFactory:269 - Deleted entity synthetic identifier rollback: disabled 23:41:09,923 INFO SettingsFactory:284 - Default entity-mode: pojo 23:41:09,973 INFO SessionFactoryImpl:159 - building session factory 23:41:10,504 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured 23:41:10,514 INFO SchemaExport:152 - Running hbm2ddl schema export 23:41:10,514 DEBUG SchemaExport:168 - import file not found: /import.sql 23:41:10,514 INFO SchemaExport:177 - exporting generated schema to database 23:41:10,514 DEBUG SchemaExport:301 - drop table if exists SecurityValue 23:41:10,614 DEBUG SchemaExport:301 - create table SecurityValue (id bigint not null auto_increment, secureValue varchar(255), primary key (id)) type=InnoDB 23:41:10,774 INFO SchemaExport:194 - schema export complete java.lang.NoSuchMethodError: org.hibernate.ejb.EntityManagerFactoryImpl.<init>(Lorg/hibernate/SessionFactory;Ljavax/persistence/spi/PersistenceUnitTransactionType;Z)V at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:522) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:650) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:518) at org.hibernate.ejb.test.TestCase.setUp(TestCase.java:37) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78) Process finished with exit code -1

    Hibernate JIRA | 1 decade ago | prabhu raman
    java.lang.NoSuchMethodError: org.hibernate.ejb.EntityManagerFactoryImpl.<init>(Lorg/hibernate/SessionFactory;Ljavax/persistence/spi/PersistenceUnitTransactionType;Z)V
  2. 0

    Using the latest published versions of Hibernate (3.2 cr2), Hib Annotations (3.1.0 Beta 10), Hib EntityManager (3.1.0 Beta 8) and a (1) simple Annotated Entity Bean (2) hibernate.properties file as present in the distribution (3) junit extending TestCase exactly as it appears in EntityManager distribution I get the following NoSuchMethod at runtime. Heres the complete output trace. 23:41:08,681 INFO Version:15 - Hibernate EntityManager 3.1.0.Beta8b 23:41:08,711 INFO Version:15 - Hibernate Annotations 3.1.0.Beta10b 23:41:08,731 INFO Environment:499 - Hibernate 3.2 cr2 23:41:08,741 INFO Environment:517 - loaded properties from resource hibernate.properties: {hibernate.connection.password=****, hibernate.jdbc.batch_versioned_data=true, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.cache.region_prefix=hibernate.test, hibernate.proxool.pool_alias=pool1, hibernate.bytecode.use_reflection_optimizer=false, hibernate.default_batch_fetch_size=8, hibernate.hbm2ddl.auto=create-drop, hibernate.jdbc.use_streams_for_binary=true, hibernate.max_fetch_depth=1, hibernate.connection.pool_size=1, hibernate.connection.username=guhaAdmin, hibernate.connection.driver_class=com.mysql.jdbc.Driver, hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider, javax.persistence.provider=org.hibernate.ejb.HibernatePersistence, javax.persistence.transactionType=RESOURCE_LOCAL, hibernate.order_updates=true, hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect, hibernate.connection.url=jdbc:mysql://localhost:3306/guha} 23:41:08,751 INFO Environment:548 - using java.io streams to persist binary types 23:41:08,751 INFO Environment:666 - Bytecode provider name : cglib 23:41:08,771 INFO Environment:583 - using JDK 1.4 java.sql.Timestamp handling 23:41:09,122 INFO AnnotationBinder:336 - Binding entity from annotated class: com.guha.entity.beans.SecurityValue 23:41:09,182 INFO EntityBinder:324 - Bind entity com.guha.entity.beans.SecurityValue on table SecurityValue 23:41:09,462 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!) 23:41:09,472 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 1 23:41:09,472 INFO DriverManagerConnectionProvider:45 - autocommit mode: true 23:41:09,482 INFO DriverManagerConnectionProvider:80 - using driver: com.mysql.jdbc.Driver at URL: jdbc:mysql://localhost:3306/guha 23:41:09,482 INFO DriverManagerConnectionProvider:86 - connection properties: {user=guhaAdmin, password=****, autocommit=true, release_mode=auto} 23:41:09,813 INFO SettingsFactory:78 - RDBMS: MySQL, version: 5.0.18-nt 23:41:09,813 INFO SettingsFactory:79 - JDBC driver: MySQL-AB JDBC Driver, version: mysql-connector-java-3.1.12 ( $Date: 2005-11-17 15:53:48 +0100 (Thu, 17 Nov 2005) $, $Revision$ ) 23:41:09,843 INFO Dialect:128 - Using dialect: org.hibernate.dialect.MySQLInnoDBDialect 23:41:09,853 INFO TransactionFactoryFactory:34 - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory 23:41:09,863 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended) 23:41:09,863 INFO SettingsFactory:126 - Automatic flush during beforeCompletion(): disabled 23:41:09,863 INFO SettingsFactory:130 - Automatic session close at end of transaction: disabled 23:41:09,863 INFO SettingsFactory:137 - JDBC batch size: 15 23:41:09,863 INFO SettingsFactory:140 - JDBC batch updates for versioned data: enabled 23:41:09,873 INFO SettingsFactory:145 - Scrollable result sets: enabled 23:41:09,873 INFO SettingsFactory:153 - JDBC3 getGeneratedKeys(): enabled 23:41:09,873 INFO SettingsFactory:161 - Connection release mode: auto 23:41:09,873 INFO SettingsFactory:185 - Maximum outer join fetch depth: 1 23:41:09,873 INFO SettingsFactory:188 - Default batch fetch size: 8 23:41:09,883 INFO SettingsFactory:192 - Generate SQL with comments: disabled 23:41:09,883 INFO SettingsFactory:196 - Order SQL updates by primary key: enabled 23:41:09,883 INFO SettingsFactory:357 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory 23:41:09,883 INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactory 23:41:09,883 INFO SettingsFactory:204 - Query language substitutions: {no='N', true=1, yes='Y', false=0} 23:41:09,893 INFO SettingsFactory:210 - Second-level cache: enabled 23:41:09,893 INFO SettingsFactory:214 - Query cache: disabled 23:41:09,893 INFO SettingsFactory:344 - Cache provider: org.hibernate.cache.HashtableCacheProvider 23:41:09,893 INFO SettingsFactory:229 - Optimize cache for minimal puts: disabled 23:41:09,893 INFO SettingsFactory:234 - Cache region prefix: hibernate.test 23:41:09,903 INFO SettingsFactory:238 - Structured second-level cache entries: disabled 23:41:09,913 INFO SettingsFactory:265 - Statistics: disabled 23:41:09,923 INFO SettingsFactory:269 - Deleted entity synthetic identifier rollback: disabled 23:41:09,923 INFO SettingsFactory:284 - Default entity-mode: pojo 23:41:09,973 INFO SessionFactoryImpl:159 - building session factory 23:41:10,504 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured 23:41:10,514 INFO SchemaExport:152 - Running hbm2ddl schema export 23:41:10,514 DEBUG SchemaExport:168 - import file not found: /import.sql 23:41:10,514 INFO SchemaExport:177 - exporting generated schema to database 23:41:10,514 DEBUG SchemaExport:301 - drop table if exists SecurityValue 23:41:10,614 DEBUG SchemaExport:301 - create table SecurityValue (id bigint not null auto_increment, secureValue varchar(255), primary key (id)) type=InnoDB 23:41:10,774 INFO SchemaExport:194 - schema export complete java.lang.NoSuchMethodError: org.hibernate.ejb.EntityManagerFactoryImpl.<init>(Lorg/hibernate/SessionFactory;Ljavax/persistence/spi/PersistenceUnitTransactionType;Z)V at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:522) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:650) at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:518) at org.hibernate.ejb.test.TestCase.setUp(TestCase.java:37) at com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78) Process finished with exit code -1

    Hibernate JIRA | 1 decade ago | prabhu raman
    java.lang.NoSuchMethodError: org.hibernate.ejb.EntityManagerFactoryImpl.<init>(Lorg/hibernate/SessionFactory;Ljavax/persistence/spi/PersistenceUnitTransactionType;Z)V
  3. 0

    Struts Hibernate Integration with Annotations (java.lang.NoSuchMethodException)

    Stack Overflow | 9 months ago | Tobias Nolte
    java.lang.NoSuchMethodError: org.hibernate.cfg.annotations.reflection.JPAMetadataProvider.<init>(Lorg/hibernate/boot/spi/MetadataBuildingOptions;)V
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Hibernate + spring error

    Stack Overflow | 1 year ago | Fabio
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.cfg.annotations.reflection.JPAMetadataProvider.<init>(Lorg/hibernate/boot/spi/MetadataBuildingOptions;)V
  6. 0

    Spring Framework + Hibernate - Stack Overflow на русском

    stackoverflow.com | 1 year ago
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in ServletContext resource [/WEB-INF/hibernate.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.cfg.annotations.reflection.JPAMetadataProvider.<init>(Lorg/hibernate/boot/spi/MetadataBuildingOptions;)V

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.NoSuchMethodError

      org.hibernate.ejb.EntityManagerFactoryImpl.<init>(Lorg/hibernate/SessionFactory;Ljavax/persistence/spi/PersistenceUnitTransactionType;Z)V

      at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory()
    2. Hibernate EJB
      Ejb3Configuration.createEntityManagerFactory
      1. org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:522)
      2. org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:650)
      3. org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:518)
      3 frames
    3. org.hibernate.ejb
      TestCase.setUp
      1. org.hibernate.ejb.test.TestCase.setUp(TestCase.java:37)
      1 frame
    4. com.intellij.rt
      JUnitStarter.main
      1. com.intellij.rt.execution.junit2.JUnitStarter.main(JUnitStarter.java:31)
      1 frame
    5. Java RT
      DelegatingMethodAccessorImpl.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      3 frames
    6. IDEA
      AppMain.main
      1. com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
      1 frame