java.lang.NoSuchMethodError

If you like a tip written by other Samebug users, mark is as helpful! Marks help our algorithm provide you better solutions and also help other users.
tip

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.

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

  • 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
    via by Paul Cantrell,
  • 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
    via by Paul Cantrell,
  • Hibernate NoMethod Error in Java
    via Stack Overflow by Noor
    ,
  • Hibernate exception JPA
    via Stack Overflow by user1187719
    ,
  • Resion 4.0.40 doesn't start
    via GitHub by making
    ,
    • 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)

    Users with the same issue

    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    Unknown visitor1 times, last one,
    24 more bugmates