STRUTS 2.2.1报错,启动不了

转载 2011年01月13日 11:00:00

 

严重: Dispatcher initialization failed
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
 at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:295)
 at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:431)
 at com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.java:207)
 at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
 at com.opensymphony.xwork2.inject.ContainerBuilder$3.create(ContainerBuilder.java:93)
 at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:487)
 at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:484)
 at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)
 at com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:484)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(DefaultConfiguration.java:252)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:193)
 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
 at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415)
 at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
 at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
 at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
 at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
 at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
 at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4340)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
 at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
 at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
 at org.apache.catalina.core.StandardService.start(StandardService.java:516)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:293)
 ... 42 more
Caused by: java.lang.ExceptionInInitializerError
 at com.opensymphony.xwork2.ognl.OgnlValueStackFactory.setContainer(OgnlValueStackFactory.java:85)
 ... 47 more
Caused by: java.lang.IllegalArgumentException: Javassist library is missing in classpath! Please add missed dependency!
 at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:165)
 ... 48 more
Caused by: java.lang.ClassNotFoundException: javassist.ClassPool
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:169)
 at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:162)
 ... 48 more
2010-12-9 17:23:07 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
java.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector
File: ContainerImpl.java
Method: inject
Line: 295 - com/opensymphony/xwork2/inject/ContainerImpl.java:295:-1
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:428)
 at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:69)
 at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
 at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:275)
 at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:397)
 at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:108)
 at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3693)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4340)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
 at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:920)
 at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:883)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)
 at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1138)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
 at org.apache.catalina.core.StandardService.start(StandardService.java:516)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:566)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
 at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:295)
 at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:431)
 at com.opensymphony.xwork2.inject.ContainerBuilder$5.create(ContainerBuilder.java:207)
 at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
 at com.opensymphony.xwork2.inject.ContainerBuilder$3.create(ContainerBuilder.java:93)
 at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:487)
 at com.opensymphony.xwork2.inject.ContainerBuilder$7.call(ContainerBuilder.java:484)
 at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)
 at com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:484)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(DefaultConfiguration.java:252)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:193)
 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
 at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:371)
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:415)
 ... 29 more
Caused by: java.lang.reflect.InvocationTargetException
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:293)
 ... 42 more
Caused by: java.lang.ExceptionInInitializerError
 at com.opensymphony.xwork2.ognl.OgnlValueStackFactory.setContainer(OgnlValueStackFactory.java:85)
 ... 47 more
Caused by: java.lang.IllegalArgumentException: Javassist library is missing in classpath! Please add missed dependency!
 at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:165)
 ... 48 more
Caused by: java.lang.ClassNotFoundException: javassist.ClassPool
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1358)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1204)
 at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:169)
 at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:162)
 ... 48 more

 

在使用struts-2.2.1时,需要引入javassist-3.7.ga.jar,而这个在struts-2.2.1/lib下是没有的,需要在struts-2.2.1/apps/struts2-blank-2.2.1.war下的lib中找。

 

通过这个总结出一点经验:每个版本需要的包可能不一样,所以最快捷的方式是下载struts-2.2.1-all.zip,应用实例中最简单的struts2-blank中导入的包就是最基本的包。比如,2.1.x版本中需要commons-logging-1.0.4.jar,2.2.1中就不需要了。

 

菜鸟学习Struts2遇到的问题

1、ClassNotFoundException StrutsPrepareAndExecuteFilter工程中需要引入struts2的jar包,因为要建许多工程,为了避免重复复制jar包,所以用了...
  • h4x0r_007
  • h4x0r_007
  • 2015年04月21日 20:30
  • 948

Guice依赖注入的三种方式和injectMembers方法的使用

package com.ilucky.guice.test4;import com.google.inject.Guice; import com.google.inject.Injector;/**...
  • sidongxue2
  • sidongxue2
  • 2017年05月22日 14:58
  • 596

时间类(2)

#include   using namespace std;  class Time  {  public:      void set_time();      void show_time();...
  • buliangrencai
  • buliangrencai
  • 2016年04月05日 18:53
  • 104

Webwork Result失效的一个错误

访问Action.不能跳转到指定的jsp页面,有如下异常java.lang.NoSuchMethodException: ch7.example6.TestJaserReport.getTtt.jsp...
  • daryl715
  • daryl715
  • 2007年04月12日 23:44
  • 800

spring下应用@Resource, @Autowired 和 @Inject注解进行依赖注入的差

代码:为了探寻 ‘@Resource’, ‘@Autowired’, 和‘@Inject’如何解决依赖注入中的问题,我创建了一个“Party”接口,和它的两个实现类“Person”,“Organiz...
  • u014087286
  • u014087286
  • 2015年07月18日 16:26
  • 900

zookeeper——启动zookeeper中的常见问题

原文地址:http://hi.baidu.com/luhao8415/item/23c6e7f075aa18b730c1993a 最近常有启动zookeeper出现问题的,整理下贴出来,以后也可以参考...
  • qinglu000
  • qinglu000
  • 2013年08月07日 13:46
  • 69900

com.opensymphony.xwork2.inject.DependencyException

 Caused by: java.lang.RuntimeException: java.lang.RuntimeException: com.opensymphony.xwork2.inject.D...
  • jianw2007
  • jianw2007
  • 2011年06月09日 22:19
  • 5998

[Struts2]Caused by: com.opensymphony.xwork2.inject.DependencyException:

Exception description: 七月 17, 2012 10:14:26 下午 org.apache.catalina.core.StandardContext filterStart...
  • suplxj
  • suplxj
  • 2012年07月17日 22:32
  • 8827

struts2無法继承json-default的解决方法

struts2的json plugin可以实现struts2和json的完美结合,由于本篇主要是介绍整合过程中遇到的问题,所以编程实现的方法这里就不重复了,具体可以参看struts2的官方文档:htt...
  • tigerdsh
  • tigerdsh
  • 2013年04月06日 07:49
  • 1681

Spring,ehcache整合报错

摘要:在做Spring整合ehcache配置的时候出现了下面的错误,提示如下:java.lang.ClassNotFoundException: org.springframework.cache.e...
  • sxdtzhaoxinguo
  • sxdtzhaoxinguo
  • 2016年05月26日 15:53
  • 2674
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:STRUTS 2.2.1报错,启动不了
举报原因:
原因补充:

(最多只允许输入30个字)