java.lang.NoSuchMethodError: org.hibernate.cfg.NamingStrategy.foreignKeyColumnName(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

Hibernate JIRA | Paul Cantrell | 1 decade ago
  1. 0

    I am encountering a NoSuchMethodError when Hibernate attempts to process my configuration. This suggests that my annotations and core jars are out of sync, but I do seem to have the latest versions of both. And indeed, when I try to build hibernate-annotations, I get compile errors suggesting that the annotations were built against some code other than what I have checked out, probably 3.2cr1. Looks like the published build of annotations is just out of sync with the latest core release...? java.lang.NoSuchMethodError: org.hibernate.cfg.NamingStrategy.foreignKeyColumnName(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; at org.hibernate.cfg.Ejb3JoinColumn.linkValueUsingDefaultColumnNaming(Ejb3JoinColumn.java:266) at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:198) at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:45) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:261) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1205) at net.innig.framework.persistence.hibernate.HibernateHelper.getSessionFactory(HibernateHelper.java:47) .... odysseus (hibernate-annotations-3.1.0.Beta10)$ ant jar Searching for build.xml ... Buildfile: /usr/local/java/hibernate-annotations-3.1.0.Beta10/build.xml Could not load definitions from resource clovertasks. It could not be found. init Build Hibernate Annotations-3.1.0.Beta10 (2006-05-11 07:13:14) Created dir: /usr/local/java/hibernate-annotations-3.1.0.Beta10/build/classes Created dir: /usr/local/java/hibernate-annotations-3.1.0.Beta10/build/testclasses Copying 1 file to /usr/local/java/hibernate-annotations-3.1.0.Beta10/build/classes Copying 2 files to /usr/local/java/hibernate-annotations-3.1.0.Beta10/build compile Compiling 174 source files to /usr/local/java/hibernate-annotations-3.1.0.Beta10/build/classes /usr/local/java/hibernate-annotations-3.1.0.Beta10/src/org/hibernate/cfg/Ejb3JoinColumn.java:258 foreignKeyColumnName(java.lang.String,java.lang.String,java.lang.String,java.lang.String) in org.hibernate.cfg.NamingStrategy cannot be applied to (java.lang.String,java.lang.String,java.lang.String) columnName = getMappings().getNamingStrategy().foreignKeyColumnName( ^ /usr/local/java/hibernate-annotations-3.1.0.Beta10/src/org/hibernate/cfg/Ejb3JoinColumn.java:266 foreignKeyColumnName(java.lang.String,java.lang.String,java.lang.String,java.lang.String) in org.hibernate.cfg.NamingStrategy cannot be applied to (java.lang.String,java.lang.String,java.lang.String) columnName = getMappings().getNamingStrategy().foreignKeyColumnName( ^ /usr/local/java/hibernate-annotations-3.1.0.Beta10/src/org/hibernate/cfg/Ejb3JoinColumn.java:412 foreignKeyColumnName(java.lang.String,java.lang.String,java.lang.String,java.lang.String) in org.hibernate.cfg.NamingStrategy cannot be applied to (java.lang.String,java.lang.String,java.lang.String) columnName = getMappings().getNamingStrategy().foreignKeyColumnName( ^ /usr/local/java/hibernate-annotations-3.1.0.Beta10/src/org/hibernate/cfg/Ejb3JoinColumn.java:420 foreignKeyColumnName(java.lang.String,java.lang.String,java.lang.String,java.lang.String) in org.hibernate.cfg.NamingStrategy cannot be applied to (java.lang.String,<nulltype>,java.lang.String) columnName = getMappings().getNamingStrategy().foreignKeyColumnName( ^ /usr/local/java/hibernate-annotations-3.1.0.Beta10/src/org/hibernate/cfg/annotations/TableBinder.java:92 collectionTableName(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String) in org.hibernate.cfg.NamingStrategy cannot be applied to (java.lang.String,java.lang.String,java.lang.String) mappings.getNamingStrategy() ^ /usr/local/java/hibernate-annotations-3.1.0.Beta10/src/org/hibernate/cfg/EJB3NamingStrategy.java:12 org.hibernate.cfg.EJB3NamingStrategy is not abstract and does not override abstract method foreignKeyColumnName(java.lang.String,java.lang.String,java.lang.String,java.lang.String) in org.hibernate.cfg.NamingStrategy public class EJB3NamingStrategy implements NamingStrategy { ^ Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 6 errors BUILD FAILED /usr/local/java/hibernate-annotations-3.1.0.Beta10/build.xml:40: Compile failed; see the compiler error output for details. Total time: 10 seconds

    Hibernate JIRA | 1 decade ago | Paul Cantrell
    java.lang.NoSuchMethodError: org.hibernate.cfg.NamingStrategy.foreignKeyColumnName(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
  2. 0

    I am encountering a NoSuchMethodError when Hibernate attempts to process my configuration. This suggests that my annotations and core jars are out of sync, but I do seem to have the latest versions of both. And indeed, when I try to build hibernate-annotations, I get compile errors suggesting that the annotations were built against some code other than what I have checked out, probably 3.2cr1. Looks like the published build of annotations is just out of sync with the latest core release...? java.lang.NoSuchMethodError: org.hibernate.cfg.NamingStrategy.foreignKeyColumnName(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String; at org.hibernate.cfg.Ejb3JoinColumn.linkValueUsingDefaultColumnNaming(Ejb3JoinColumn.java:266) at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:198) at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:45) at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:261) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1205) at net.innig.framework.persistence.hibernate.HibernateHelper.getSessionFactory(HibernateHelper.java:47) .... odysseus (hibernate-annotations-3.1.0.Beta10)$ ant jar Searching for build.xml ... Buildfile: /usr/local/java/hibernate-annotations-3.1.0.Beta10/build.xml Could not load definitions from resource clovertasks. It could not be found. init Build Hibernate Annotations-3.1.0.Beta10 (2006-05-11 07:13:14) Created dir: /usr/local/java/hibernate-annotations-3.1.0.Beta10/build/classes Created dir: /usr/local/java/hibernate-annotations-3.1.0.Beta10/build/testclasses Copying 1 file to /usr/local/java/hibernate-annotations-3.1.0.Beta10/build/classes Copying 2 files to /usr/local/java/hibernate-annotations-3.1.0.Beta10/build compile Compiling 174 source files to /usr/local/java/hibernate-annotations-3.1.0.Beta10/build/classes /usr/local/java/hibernate-annotations-3.1.0.Beta10/src/org/hibernate/cfg/Ejb3JoinColumn.java:258 foreignKeyColumnName(java.lang.String,java.lang.String,java.lang.String,java.lang.String) in org.hibernate.cfg.NamingStrategy cannot be applied to (java.lang.String,java.lang.String,java.lang.String) columnName = getMappings().getNamingStrategy().foreignKeyColumnName( ^ /usr/local/java/hibernate-annotations-3.1.0.Beta10/src/org/hibernate/cfg/Ejb3JoinColumn.java:266 foreignKeyColumnName(java.lang.String,java.lang.String,java.lang.String,java.lang.String) in org.hibernate.cfg.NamingStrategy cannot be applied to (java.lang.String,java.lang.String,java.lang.String) columnName = getMappings().getNamingStrategy().foreignKeyColumnName( ^ /usr/local/java/hibernate-annotations-3.1.0.Beta10/src/org/hibernate/cfg/Ejb3JoinColumn.java:412 foreignKeyColumnName(java.lang.String,java.lang.String,java.lang.String,java.lang.String) in org.hibernate.cfg.NamingStrategy cannot be applied to (java.lang.String,java.lang.String,java.lang.String) columnName = getMappings().getNamingStrategy().foreignKeyColumnName( ^ /usr/local/java/hibernate-annotations-3.1.0.Beta10/src/org/hibernate/cfg/Ejb3JoinColumn.java:420 foreignKeyColumnName(java.lang.String,java.lang.String,java.lang.String,java.lang.String) in org.hibernate.cfg.NamingStrategy cannot be applied to (java.lang.String,<nulltype>,java.lang.String) columnName = getMappings().getNamingStrategy().foreignKeyColumnName( ^ /usr/local/java/hibernate-annotations-3.1.0.Beta10/src/org/hibernate/cfg/annotations/TableBinder.java:92 collectionTableName(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String) in org.hibernate.cfg.NamingStrategy cannot be applied to (java.lang.String,java.lang.String,java.lang.String) mappings.getNamingStrategy() ^ /usr/local/java/hibernate-annotations-3.1.0.Beta10/src/org/hibernate/cfg/EJB3NamingStrategy.java:12 org.hibernate.cfg.EJB3NamingStrategy is not abstract and does not override abstract method foreignKeyColumnName(java.lang.String,java.lang.String,java.lang.String,java.lang.String) in org.hibernate.cfg.NamingStrategy public class EJB3NamingStrategy implements NamingStrategy { ^ Note: Some input files use unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 6 errors BUILD FAILED /usr/local/java/hibernate-annotations-3.1.0.Beta10/build.xml:40: Compile failed; see the compiler error output for details. Total time: 10 seconds

    Hibernate JIRA | 1 decade ago | Paul Cantrell
    java.lang.NoSuchMethodError: org.hibernate.cfg.NamingStrategy.foreignKeyColumnName(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
  3. 0
    I was using the library hibernate-entitymanager:4.3.5.Final with java persistence API 2.0 instead of using it with hibernate-entitymanager:4.2.8.Final.
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Resion 4.0.40 doesn't start

    GitHub | 2 years ago | making
    org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [META-INF/spring/terasoluna-gfw-functionaltest-env.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;
  6. 0

    Not able to use hibernate alongwith spring mvc on jboss 7.1.1 final

    Stack Overflow | 2 years ago | vishi
    StandardWrapper.Throwable: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/hibernateintro-servlet.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: javax.persistence.Table.indexes()[Ljavax/persistence/Index;

    28 unregistered visitors
    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.cfg.NamingStrategy.foreignKeyColumnName(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

      at org.hibernate.cfg.Ejb3JoinColumn.linkValueUsingDefaultColumnNaming()
    2. Hibernate
      Configuration.buildSessionFactory
      1. org.hibernate.cfg.Ejb3JoinColumn.linkValueUsingDefaultColumnNaming(Ejb3JoinColumn.java:266)
      2. org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:198)
      3. org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:45)
      4. org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:261)
      5. org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1205)
      5 frames
    3. net.innig.framework
      HibernateHelper.getSessionFactory
      1. net.innig.framework.persistence.hibernate.HibernateHelper.getSessionFactory(HibernateHelper.java:47)
      1 frame