[问题] struts新手问题

楼主: alex90236 (洋葱)   2016-03-17 21:18:55
请教各位版上先进门,小弟刚配置完struts2的基本配置,
但是要去执行的时候一直出现
2016/3/17 下午 08:51:22 org.apache.catalina.core.AprLifecycleListener init
资讯: The Apache Tomcat Native library which allows optimal performance in
production environments was not found on the java.library.path:
C:\Users\onion\AppData\Local\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\bin;C:\Users\onion\AppData\Local\MyEclipse\Common\plugins\com.genuitec.eclipse.easie.tomcat.myeclipse_9.0.0.me201109141806\tomcat\bin
2016/3/17 下午 08:51:22 org.apache.coyote.http11.Http11Protocol init
资讯: Initializing Coyote HTTP/1.1 on http-8080
2016/3/17 下午 08:51:22 org.apache.catalina.startup.Catalina load
资讯: Initialization processed in 205 ms
2016/3/17 下午 08:51:22 org.apache.catalina.core.StandardService start
资讯: Starting service Catalina
2016/3/17 下午 08:51:22 org.apache.catalina.core.StandardEngine start
资讯: Starting Servlet Engine: Apache Tomcat/6.0.13
2016/3/17 下午 08:51:22 org.apache.struts2.dispatcher.Dispatcher error
严重的: Dispatcher initialization failed
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:351)
at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:235)
at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:967)
at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:435)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:479)
at
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
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:299)
... 43 more
Caused by: java.lang.ExceptionInInitializerError
at
com.opensymphony.xwork2.ognl.OgnlValueStackFactory.setContainer(OgnlValueStackFactory.java:84)
... 48 more
Caused by: java.lang.IllegalArgumentException: Javassist library is missing
in classpath! Please add missed dependency!
at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:168)
... 49 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:165)
... 49 more
2016/3/17 下午 09:23:51 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: 301 - com/opensymphony/xwork2/inject/ContainerImpl.java:301:-1
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:493)
at
org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
at
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
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: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:351)
at
com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:235)
at
com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:967)
at
org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:435)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:479)
... 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:299)
... 43 more
Caused by: java.lang.ExceptionInInitializerError
at
com.opensymphony.xwork2.ognl.OgnlValueStackFactory.setContainer(OgnlValueStackFactory.java:84)
... 48 more
Caused by: java.lang.IllegalArgumentException: Javassist library is missing
in classpath! Please add missed dependency!
at ognl.OgnlRuntime.<clinit>(OgnlRuntime.java:168)
... 49 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:165)
... 49 more
2016/3/17 下午 09:23:51 org.apache.catalina.core.StandardContext start
严重的: Error filterStart
2016/3/17 下午 09:23:51 org.apache.catalina.core.StandardContext start
严重的: Context [/struts2] startup failed due to previous errors
2016/3/17 下午 09:23:51
com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
资讯: Parsing configuration file [struts-default.xml]
2016/3/17 下午 09:23:51
com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
资讯: Parsing configuration file [struts-plugin.xml]
2016/3/17 下午 09:23:51
com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
资讯: Parsing configuration file [struts.xml]
2016/3/17 下午 09:23:52 org.apache.coyote.http11.Http11Protocol start
资讯: Starting Coyote HTTP/1.1 on http-8080
2016/3/17 下午 09:23:52 org.apache.jk.common.ChannelSocket init
资讯: JK: ajp13 listening on /0.0.0.0:8009
2016/3/17 下午 09:23:52 org.apache.jk.server.JkMain start
资讯: Jk running ID=0 time=0/9 config=null
2016/3/17 下午 09:23:52 org.apache.catalina.startup.Catalina start
资讯: Server startup in 1174 ms
不明白为何会一直失败,我在lib内只加了几个项目,
lib底下放了commons-fileupload-1.3.1.jar
commons-logging-1.1.3.jar
freemarker-2.3.22.jar
ognl-3.0.6.jar
struts2-core-2.3.24.1.jar
xwork-core-2.3.24.1.jar
src资料夹底下的struts.xml如下
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.3//EN"
"http://struts.apache.org/dtds/struts-2.3.dtd">
<struts>
</struts>
备注:
另外呈现出来的画面是 HTTP Status 404 - /struts2/
type Status report
message /struts2/
description The requested resource (/struts2/) is not available
Apache Tomcat/6.0.13
希望上面的备注有用
求解~!! 试了很久
作者: qrtt1 (有些事,有时候。。。)   2016-03-17 21:20:00
后面的 log 没有了!?
楼主: alex90236 (洋葱)   2016-03-17 21:24:00
我把全部都贴上来了 本来想说到刚刚那一行应该就是KEY
作者: haha02 (来人!上夹棍!)   2016-03-17 21:55:00
structs不熟 但看起来是少 Javassist的jar
楼主: alex90236 (洋葱)   2016-03-17 21:57:00
是喔..我是看YOUTUBE的教学,看他也没放那个档案 好怪QQ 刚刚试了 依然fail有没有人会....拜托 看了很久........
作者: icydream (巧虎)   2016-03-17 23:49:00
https://goo.gl/pQWcfm 看了一下少了那些jar
作者: yyc1217 (somo)   2016-03-18 00:10:00
是用eclipse或其他IDE吗? 可以试着clean看看也顺便用解压缩软件打开那个jar档 确认是否真有那个class建议使用maven或gradle来管理套件~eclipse的话 也看一下那个jar是否有在classpath内
楼主: alex90236 (洋葱)   2016-03-18 16:37:00
谢谢ICY大的网址,好奇怪啊YOUTUBE上的教学只放六个JAR教学上面六个JAR就成功,真是超怪异的 总之谢谢大大话说我是用myeclipse

Links booklink

Contact Us: admin [ a t ] ucptt.com