- This topic has 3 replies, 2 voices, and was last updated 17 years, 4 months ago by Riyad Kalla.
-
AuthorPosts
-
benson_marguliesMemberVersion: 6.0.0 M1
Build id: 20070629-6.0.0-M1I 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)
Riyad KallaMemberjava.lang.NoSuchMethodError: org.hibernate.cfg.SecondPass.doSecondPass(Ljava/util/Map;)V
Caused by: java.lang.NoSuchMethodError: org.hibernate.cfg.SecondPass.doSecondPass(Ljava/util/Map;)VAny 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.
benson_marguliesMemberWhen 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.
Riyad KallaMemberGlad it’s working now.
-
AuthorPosts