当前位置: 代码迷 >> Java Web开发 >> 100分相送,求高手解决org.springframework.beans.factory.BeanCreationException解决方案
  详细解决方案

100分相送,求高手解决org.springframework.beans.factory.BeanCreationException解决方案

热度:198   发布时间:2016-04-17 13:30:00.0
100分相送,求高手解决org.springframework.beans.factory.BeanCreationException
我的程序在tomacat5。0和JDK1。50下可以运行
但换到tomacat6。0和JDK1。60下就出现异常
我的application.xml是
<bean   id= "sessionFactory "
class= "org.springframework.orm.hibernate3.LocalSessionFactoryBean ">
<property   name= "configLocation ">
<value> hibernate.cfg.xml </value>
</property>
</bean>

<!--配置hibernate   transactonmanager   -->
<bean   id= "transactionManager "   class= "org.springframework.orm.hibernate3.HibernateTransactionManager ">
<property   name= "sessionFactory ">
<ref   local= "sessionFactory "   />
</property>
</bean>

<!--对象dao配置   -->
<bean   id= "userDAO "   class= "com.xingkong.hibernate.dao.impl.UserDAOImpl ">
<property   name= "sessionFactory ">
<ref   local= "sessionFactory "   />
</property>
</bean>
<bean   id= "booktypeDAO "   class= "com.xingkong.hibernate.dao.impl.BookTypeDAOImpl ">
<property   name= "sessionFactory ">
<ref   local= "sessionFactory "/>
</property>
</bean>

org.springframework.beans.factory.BeanCreationException:   Error   creating   bean   with   name   'sessionFactory '   defined   in   class   path   resource   [applicationContext.xml]:   Initialization   of   bean   failed;   nested   exception   is   java.lang.NoClassDefFoundError:   org/hibernate/cfg/HbmBinder$SecondPass
java.lang.NoClassDefFoundError:   org/hibernate/cfg/HbmBinder$SecondPass
at   java.lang.ClassLoader.defineClass1(Native   Method)
at   java.lang.ClassLoader.defineClass(ClassLoader.java:620)
at   java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at   org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1814)
at   org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:868)
at   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1321)
at   org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1200)
at   java.lang.ClassLoader.loadClassInternal(ClassLoader.java:319)
at   org.hibernate.cfg.Configuration.add(Configuration.java:386)
at   org.hibernate.cfg.Configuration.addInputStream(Configuration.java:427)
at   org.hibernate.cfg.Configuration.addResource(Configuration.java:482)
at   org.hibernate.cfg.Configuration.parseMappingElement(Configuration.java:1465)
at   org.hibernate.cfg.Configuration.parseSessionFactory(Configuration.java:1433)
at   org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1414)
at   org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1390)
at   org.hibernate.cfg.Configuration.configure(Configuration.java:1325)
at   org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:651)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1091)
at   org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:396)
at   org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:233)
  相关解决方案