Spring 所需Jar包 测试

结果
spring-core.jar
    ——>依赖:spring-web.jar

        ——>依赖:spring-context.jar
        ——>依赖:spring-beans.jar
        ——>依赖:commons-logging.jar

 

 

 

开始,单加入spring-core.jar,配置web.xml

 <!-- ××××××××××××××× Spring配置和监听 Start ××××××××××××××× -->
 <context-param>
  <param-name>contextConfigLocation</param-name>
  <param-value>/WEB-INF/classes/application*.xml</param-value>
 </context-param>
 <listener>
  <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
 </listener>
 <!-- ×××××××××××××××× Spring配置和监听 End ×××××××××××××××× -->

 

运行——

严重: Error configuring application listener of class org.springframework.web.context.ContextLoaderListener
java.lang.ClassNotFoundException: org.springframework.web.context.ContextLoaderListener

 

解决——

缺少org.springframework.web.*,加入spring-web.jar

 

 

运行——

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContextException
Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContextException

 

解决——

缺少org.springframework.context.*,加入spring-context.jar

 

 

运行——

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: org/springframework/beans/FatalBeanException
Caused by: java.lang.ClassNotFoundException: org.springframework.beans.FatalBeanException

 

解决——

缺少org.springframework.beans.*,加入spring-beans.jar

 

 

运行——

严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory

 

解决——缺少org.apache.commons.logging.*,加入commons-logging.jar

 

 

 

struts.xml加入<constant name="struts.objectFactory" value="spring" />


运行——
2010-3-3 20:53:35 com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
严重: Dispatcher initialization failed
Unable to load configuration. - [unknown location]
Caused by: Cannot locate the chosen ObjectFactory implementation: spring - [unknown location]
......
2010-3-3 20:53:35 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
Unable to load configuration. - [unknown location]
......
Caused by: Unable to load configuration. - [unknown location]
......
Caused by: Cannot locate the chosen ObjectFactory implementation: spring - [unknown location]
......

 

解决——找不到ObjectFactory,加入struts2-spring-plugin-2.1.8.1.jar

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值