org.springframework.beans.BeanInstantiationException: Could not instantiate bean BeanJavaWebXMLORM
程序员文章站
2022-06-12 09:54:17
...
2010-11-3 15:23:24 org.apache.catalina.core.StandardContext listenerStart
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.LocalSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
Caused by: java.lang.NoClassDefFoundError: org/dom4j/DocumentException
是比如,在
定义了映射test.hbm.xml,但是找不到test.java。
才出现了上面的错误。
严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.orm.hibernate3.LocalSessionFactoryBean]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/dom4j/DocumentException
Caused by: java.lang.NoClassDefFoundError: org/dom4j/DocumentException
是比如,在
<hibernate-configuration> <session-factory> <mapping resource="com/myProject/hbm/test.hbm.xml" /> </session-factory> </hibernate-configuration>
定义了映射test.hbm.xml,但是找不到test.java。
才出现了上面的错误。