注册 登录
编程论坛 J2EE论坛

struts2 + spring2.5 spring配置出错

xy_arrow 发布于 2010-09-29 10:15, 964 次点击
applicationContext.xml 配置代码
 
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.
    xmlns:aop="http://www. xmlns:p="http://www.
    xmlns:tx="http://www. xmlns:xsi="http://www.
    xsi:schemaLocation="http://www.
    http://www.
    http://www.
    http://www.
    http://www.
    http://www.
   <bean id="loginService" class="com.ss.xy.service.impl.LoginServiceImpl"></bean>
   <!--
      <bean id="loginAction" class="com.ss.xy.action.LoginAction" scope="prototype">
           依赖注入业务逻辑
          <property name="loginServiceImpl" ref="loginService" />
       </bean>
    -->
</beans>

运行:
Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 10 in XML document from ServletContext resource [/WEB-INF/applicationContext.xml] is invalid; nested exception is org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.
Caused by: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'beans'.

什么原因啊  查了下 说法不同
查了2种解决办法 都不行 其他的都是转别人的...
有遇到的没
怎么解决?
2 回复
#2
liusuifeng2010-09-29 11:16
也许是包冲突了。看看网上struts2+spring2.5环境所需要的包。
#3
xy_arrow2010-09-29 12:18
昨天跑的还是好的 今天在运行 就出这个错了
1