我无法部署war文件。启动服务器时出现以下错误。当我启动Apache tomcat之外它运行正常,但我想配置eclipse进行调试。
[2018-02-19 09:32:20:437] ERROR org.springframework.web.context.ContextLoader :initWebApplicationContext :: Context initialization failed ::(ContextLoader.java:331) [localhost-startStop-1]
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'serviceDirectory' defined in ServletContext resource [/WEB-INF/context/coreContext.xml]: Cannot resolve reference to bean 'userBO' while setting bean property 'bizMap' with key [TypedStringValue: value [user], target type [null]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userBO' defined in ServletContext resource [/WEB-INF/context/applicationContext.xml]: Cannot resolve reference to bean 'userBOTarget' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userBOTarget' defined in ServletContext resource [/WEB-INF/context/applicationContext.xml]: Cannot resolve reference to bean 'userDAO' while setting bean property 'userDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDAO' defined in ServletContext resource [/WEB-INF/context/applicationContext.xml]: Cannot resolve reference to bean 'hibernateTemplate' while setting bean property 'hibernateTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in ServletContext resource [/WEB-INF/context/applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/context/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:334)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
... 72 more
Feb 19, 2018 9:32:20 AM org.apache.catalina.core.StandardContext listenerStart
SEVERE: 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 'serviceDirectory' defined in ServletContext resource [/WEB-INF/context/coreContext.xml]: Cannot resolve reference to bean 'userBO' while setting bean property 'bizMap' with key [TypedStringValue: value [user], target type [null]]; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userBO' defined in ServletContext resource [/WEB-INF/context/applicationContext.xml]: Cannot resolve reference to bean 'userBOTarget' while setting bean property 'target'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userBOTarget' defined in ServletContext resource [/WEB-INF/context/applicationContext.xml]: Cannot resolve reference to bean 'userDAO' while setting bean property 'userDAO'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userDAO' defined in ServletContext resource [/WEB-INF/context/applicationContext.xml]: Cannot resolve reference to bean 'hibernateTemplate' while setting bean property 'hibernateTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'hibernateTemplate' defined in ServletContext resource [/WEB-INF/context/applicationContext.xml]: Cannot resolve reference to bean 'sessionFactory' while setting bean property 'sessionFactory'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactory' defined in ServletContext resource [/WEB-INF/context/applicationContext.xml]: Initialization of bean failed; nested exception is java.lang.NullPointerException
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:334)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:108)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveManagedMap(BeanDefinitionValueResolver.java:384)
的applicationContext.xml
<bean id="userBO"
class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces"
value="com.sp.cms.sfdist.biz.UserBO" />
<property name="target">
<ref local="userBOTarget" />
</property>
</bean>
<bean id="userBOTarget" class="com.sp.cms.sfdist.biz.UserBOImpl">
<property name="userDAO">
<ref local="userDAO" />
</property>
<property name="companyDAO">
<ref local="companyDAO" />
</property>
<property name="licenseDAO">
<ref local="licenseDAO" />
</property>
<property name="productDAO">
<ref local="productDAO" />
</property>
</bean>
coreContext.xml
<!-- Begin Service Directory definition -->
<bean id="serviceDirectory"
class="com.sp.cms.core.ServiceDirectory">
<property name="bizMap">
<map>
<entry key="user" value-ref="userBO" />
<!--entry key="deal" value-ref="dealBO" /-->
</map>
</property>
</bean>
<!-- End of ServiceDirectory definition -->