Struts错误笔记

▼魔方 西西 提交于 2020-12-06 05:53:18

错误一

严重: Exception starting filter ServiceStruts2
java.lang.reflect.InvocationTargetException - Class: com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector
File: ContainerImpl.java
Method: inject
Line: 301 - com/opensymphony/xwork2/inject/ContainerImpl.java:301:-1
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:483)
 at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:193)
 at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:278)
 at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:259)
 at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:383)
 at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:104)
 at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
 at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)
 at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1673)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
 at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:301)
 at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:438)
 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:584)
 at com.opensymphony.xwork2.inject.ContainerBuilder.create(ContainerBuilder.java:484)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.createBootstrapContainer(DefaultConfiguration.java:305)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:210)
 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
 at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:471)
 ... 19 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:299)
 ... 32 more
Caused by: java.lang.ExceptionInInitializerError
 at com.opensymphony.xwork2.ognl.OgnlValueStackFactory.setContainer(OgnlValueStackFactory.java:84)
 ... 37 more
Caused by: java.lang.IllegalArgumentException: Javassist library is missing in classpath! Please add missed dependency!
 at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:168)
 ... 38 more
Caused by: java.lang.ClassNotFoundException: javassist.ClassPool
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
 at java.lang.Class.forName0(Native Method)
 at java.lang.Class.forName(Class.java:169)
 at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:165)
 ... 38 more

解决办法:加入javassist-3.11.0.GA.jar架包

错误二:

严重: Exception starting filter ServiceStruts2
java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:211)
 at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:215)
 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
 at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:471)
 at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:193)
 at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:278)
 at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:259)
 at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:383)
 at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:104)
 at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4650)
 at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5306)
 at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
 at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
 at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
 at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:633)
 at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1114)
 at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1673)
 at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
 at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
 at java.util.concurrent.FutureTask.run(FutureTask.java:138)
 at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
 at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1714)
 at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
 ... 25 more

解决办法:加入commons-lang3-3.1.jar

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!