facebook

Hibernate inconsistency, method not found error

  1. MyEclipse Archived
  2.  > 
  3. Database Tools (DB Explorer, Hibernate, etc.)
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #273916 Reply

    Version: 6.0.0 M1
    Build id: 20070629-6.0.0-M1

    I have the hibernate 3.2 libraries from myeclipse on my build path. Along with an alarming number of very micellaneous jar files that MyEclipse has dumped into the path. When I try to initialize with the bean below, I get the stack trace even further below.

    The hiberate property page for the project shows version 3.1 in spite of the fact that I’ve got 3.2 in my classpath.

    <bean id=”hibernate-session-factory-nametokens” class=”org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean”>
    <property name=”annotatedClasses”>
    <list>
    <value>com.basistech.namedatabase.NameToken</value>
    </list>
    </property>
    </bean>

    Exception in thread “main” org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘hibernate-session-factory-nametokens’ defined in file [C:\x\rlp54\greenhouse\NameDatabase\src\applicationContext.xml]: Invocation of init method failed; nested exception is java.lang.NoSuchMethodError: org.hibernate.cfg.SecondPass.doSecondPass(Ljava/util/Map;)V
    Caused by: java.lang.NoSuchMethodError: org.hibernate.cfg.SecondPass.doSecondPass(Ljava/util/Map;)V
    at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:301)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1168)
    at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:915)
    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:805)
    at org.springframework.orm.hibernate3.LocalSessionFactoryBean.buildSessionFactory(LocalSessionFactoryBean.java:745)
    at org.springframework.orm.hibernate3.AbstractSessionFactoryBean.afterPropertiesSet(AbstractSessionFactoryBean.java:134)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1202)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1172)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:428)
    at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
    at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:284)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
    at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:93)
    at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:77)
    at org.springframework.context.support.FileSystemXmlApplicationContext.<init>(FileSystemXmlApplicationContext.java:67)
    at com.basistech.namedatabase.tools.CopyOffToNameDatabase.initialize(CopyOffToNameDatabase.java:64)
    at com.basistech.namedatabase.tools.CopyOffToNameDatabase.operate(CopyOffToNameDatabase.java:56)
    at com.basistech.namedatabase.tools.CopyOffToNameDatabase.main(CopyOffToNameDatabase.java:52)

    #273969 Reply

    Riyad Kalla
    Member

    java.lang.NoSuchMethodError: org.hibernate.cfg.SecondPass.doSecondPass(Ljava/util/Map;)V
    Caused by: java.lang.NoSuchMethodError: org.hibernate.cfg.SecondPass.doSecondPass(Ljava/util/Map;)V

    Any time you see stuff like this you know there is a library conflict going on somewhere. A few things to check for:

    1. You might have the MyEclipse 3.2 libraries in your build path, but you may also have some of the 3.1 libraries there too. Double check.
    2. In addition to MyEclipse libs, you might have your own JARs from your own Hibernate setup in your build path.
    3. Similar to #2 you might have a user library in your build path that contributes additional conflicting hibernate JARs.
    4. You might have hibernate JArs in your application server /lib dir that are conflicting with what your project is deploying.

    #273970 Reply

    When I cleaned out the very random collection of jars that had been ‘copied to the lib directory’ and added to the class path, I got past this, thanks.

    #274005 Reply

    Riyad Kalla
    Member

    Glad it’s working now.

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Hibernate inconsistency, method not found error

You must be logged in to post in the forum log in