首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Exception >

org.springframework.beans.factory.BeanCreationException: Error creating bean wit

2014-01-26 
我的程序在tomacat5。0和JDK1。50下可以运行 但换到tomacat6。0和JDK1。60下就出现异常 我的application.xml是

我的程序在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)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:145)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:277)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:313)
at org.springframework.context.support.ClassPathXmlApplicationContext. <init> (ClassPathXmlApplicationContext.java:87)
at org.springframework.context.support.ClassPathXmlApplicationContext. <init> (ClassPathXmlApplicationContext.java:72)
at org.springframework.context.support.ClassPathXmlApplicationContext. <init> (ClassPathXmlApplicationContext.java:63)
at com.xingkong.struts.action.AppContext. <init> (AppContext.java:20)
at com.xingkong.struts.action.AppContext.getInstace(AppContext.java:13)
at com.xingkong.struts.action.BaseAction.getBooktypeService(BaseAction.java:17)         

热点排行