struts2错误初步2

当把struts2下所有的包放在lib下,启动时的确会报错(啥错给忘了),最好是用到什么包自己加什么包,我最常用ssh所以~~~,一下错误经验分享一下。
1。没有加入spring包以前,只加入了struts2-spring-plugin-2.0.6.jar
  2007-3-21 17:37:29 org.apache.catalina.core.StandardContext filterStart
   严重: Exception starting filter struts2
   Unable to load bean: type:com.opensymphony.xwork2.ObjectFactory
    class:org.apache.struts2.spring.StrutsSpringObjectFactory - bean - jar:file:/C:/Program%
    20Files/tomcat5.5.23/webapps/Hello/WEB-INF/lib/struts2-spring-plugin-2.0.6.jar!/struts-
   plugin.xml:8:132
2。加入了spring包以后的工程
    java.lang.NullPointerException
   at com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance
  (SpringObjectFactory.java:188)at
   com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyResultType
   (XmlConfigurationProvider.java:479)
3。/在web.xml文件中加入,问题解决
<context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
//listenre会自动在web-inf文件夹下寻找applicationcontext.xml文件,如果你的spring配置文件配置了好多,可以采取
  context-param的参数来解决
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
   </listener>
4。struts2的标签无法读取
  Servlet.service() for servlet jsp threw exception
   java.lang.NullPointerException
   at org.apache.struts2.views.jsp.TagUtils.getStack(TagUtils.java:58)
   at org.apache.struts2.views.jsp.StrutsBodyTagSupport.getStack(StrutsBodyTagSupport.java:52)
   在web.xml中加入
<filter-mapping>
  <filter-name>struts2</filter-name>
  <url-pattern>/*</url-pattern>
 </filter-mapping〉
 
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值