struts2和spring整合问题
2014-04-13 13:07
435 查看
1.启动tomcat项目出现以下红色错误处理,原因是没有导入struts-spring-plug.jar包
2014-4-13 12:35:06 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\bin;.;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;D:\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\bin;D:\oracle11.2\app\Administrator\product\11.2.0\dbhome_1\bin;C:\Program
Files (x86)\Java\jdk1.6.0_10\bin;C:\Program Files (x86)\Java\jdk1.6.0_10\jre6\bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Microsoft\Web
Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Java\jdk1.6.0_10\bin;
2014-4-13 12:35:06 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2014-4-13 12:35:06 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 948 ms
2014-4-13 12:35:07 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2014-4-13 12:35:07 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.39
2014-4-13 12:35:07 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(D:\MyEclipse\WorkSpace\web\WebContent\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
log4j:WARN No appenders could be found for logger (org.springframework.core.CollectionFactory).
log4j:WARN Please initialize the log4j system properly.
2014-4-13 12:35:08 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
2014-4-13 12:35:09 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
Action class [imageChallengeAction] not found - action - file:/D:/MyEclipse/WorkSpace/com.xbs.framework/WebRoot/WEB-INF/classes/struts.xml:8:26
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:374)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:329)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:429)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:239)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:152)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:424)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4076)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4730)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
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:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2014-4-13 12:35:09 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2014-4-13 12:35:09 org.apache.catalina.core.StandardContext start
严重: Context [/framework] startup failed due to previous errors
2014-4-13 12:35:09 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2014-4-13 12:35:09 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
严重: The web application [/framework] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@15f7dbd8]) and a value of type [com.opensymphony.xwork2.inject.InternalContext[]]
(value [[Lcom.opensymphony.xwork2.inject.InternalContext;@43824d2c]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
2014-4-13 12:35:09 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
严重: The web application [/framework] created a ThreadLocal with key of type [com.opensymphony.xwork2.ActionContext.ActionContextThreadLocal] (value [com.opensymphony.xwork2.ActionContext$ActionContextThreadLocal@5ecfe500]) and a value of type [com.opensymphony.xwork2.ActionContext]
(value [com.opensymphony.xwork2.ActionContext@22c393a1]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
2014-4-13 12:35:09 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor host-manager.xml
2014-4-13 12:35:09 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor manager.xml
2014-4-13 12:35:10 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory docs
2014-4-13 12:35:10 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory examples
2014-4-13 12:35:10 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2014-4-13 12:35:10 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2014-4-13 12:35:10 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory ROOT
2014-4-13 12:35:10 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2014-4-13 12:35:10 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2014-4-13 12:35:10 org.apache.jk.server.JkMain start
4000
信息: Jk running ID=0 time=0/48 config=null
2014-4-13 12:35:10 org.apache.catalina.startup.Catalina start
信息: Server startup in 3475 ms
2.java.lang.NoClassDefFoundError: com/opensymphony/xwork2/util/classloader/ReloadingClassLoader错误原因是xwork.jar、struts-core.jar和struts2-spring-plugin.jar版本不一致的原因,把三个jar包的版本改成一致就行
示例:可用这三个jar包版本一致
struts2-core-2.0.11.jar
struts2-spring-plugin-2.0.11.jar
xwork-2.0.4.jar
2014-4-13 12:35:06 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: D:\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\bin;.;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;D:\MyEclipse\Common\binary\com.sun.java.jdk.win32.x86_64_1.6.0.013\jre\bin;D:\oracle11.2\app\Administrator\product\11.2.0\dbhome_1\bin;C:\Program
Files (x86)\Java\jdk1.6.0_10\bin;C:\Program Files (x86)\Java\jdk1.6.0_10\jre6\bin;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files\Microsoft\Web
Platform Installer\;C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET Web Pages\v1.0\;C:\Program Files (x86)\Windows Kits\8.0\Windows Performance Toolkit\;C:\Program Files\Microsoft SQL Server\110\Tools\Binn\;C:\Program Files (x86)\Java\jdk1.6.0_10\bin;
2014-4-13 12:35:06 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-8080
2014-4-13 12:35:06 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 948 ms
2014-4-13 12:35:07 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2014-4-13 12:35:07 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.39
2014-4-13 12:35:07 org.apache.catalina.loader.WebappClassLoader validateJarFile
信息: validateJarFile(D:\MyEclipse\WorkSpace\web\WebContent\WEB-INF\lib\servlet-api.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offending class: javax/servlet/Servlet.class
log4j:WARN No appenders could be found for logger (org.springframework.core.CollectionFactory).
log4j:WARN Please initialize the log4j system properly.
2014-4-13 12:35:08 org.apache.catalina.core.ApplicationContext log
信息: Initializing Spring root WebApplicationContext
2014-4-13 12:35:09 org.apache.catalina.core.StandardContext filterStart
严重: Exception starting filter struts2
Action class [imageChallengeAction] not found - action - file:/D:/MyEclipse/WorkSpace/com.xbs.framework/WebRoot/WEB-INF/classes/struts.xml:8:26
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyAction(XmlConfigurationProvider.java:374)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addAction(XmlConfigurationProvider.java:329)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:429)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:239)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:152)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:424)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4076)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4730)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:822)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463)
at org.apache.catalina.core.StandardService.start(StandardService.java:525)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:754)
at org.apache.catalina.startup.Catalina.start(Catalina.java:595)
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:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
2014-4-13 12:35:09 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2014-4-13 12:35:09 org.apache.catalina.core.StandardContext start
严重: Context [/framework] startup failed due to previous errors
2014-4-13 12:35:09 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
2014-4-13 12:35:09 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
严重: The web application [/framework] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10@15f7dbd8]) and a value of type [com.opensymphony.xwork2.inject.InternalContext[]]
(value [[Lcom.opensymphony.xwork2.inject.InternalContext;@43824d2c]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
2014-4-13 12:35:09 org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
严重: The web application [/framework] created a ThreadLocal with key of type [com.opensymphony.xwork2.ActionContext.ActionContextThreadLocal] (value [com.opensymphony.xwork2.ActionContext$ActionContextThreadLocal@5ecfe500]) and a value of type [com.opensymphony.xwork2.ActionContext]
(value [com.opensymphony.xwork2.ActionContext@22c393a1]) but failed to remove it when the web application was stopped. This is very likely to create a memory leak.
2014-4-13 12:35:09 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor host-manager.xml
2014-4-13 12:35:09 org.apache.catalina.startup.HostConfig deployDescriptor
信息: Deploying configuration descriptor manager.xml
2014-4-13 12:35:10 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory docs
2014-4-13 12:35:10 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory examples
2014-4-13 12:35:10 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
2014-4-13 12:35:10 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
2014-4-13 12:35:10 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory ROOT
2014-4-13 12:35:10 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-8080
2014-4-13 12:35:10 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2014-4-13 12:35:10 org.apache.jk.server.JkMain start
4000
信息: Jk running ID=0 time=0/48 config=null
2014-4-13 12:35:10 org.apache.catalina.startup.Catalina start
信息: Server startup in 3475 ms
2.java.lang.NoClassDefFoundError: com/opensymphony/xwork2/util/classloader/ReloadingClassLoader错误原因是xwork.jar、struts-core.jar和struts2-spring-plugin.jar版本不一致的原因,把三个jar包的版本改成一致就行
示例:可用这三个jar包版本一致
struts2-core-2.0.11.jar
struts2-spring-plugin-2.0.11.jar
xwork-2.0.4.jar
相关文章推荐
- ssh整合出现的一些问题总结(spring4+struts2+hibernate4)
- spring 整合struts2 使用 aop 碰到的问题
- struts2 spring整合fieldError问题
- Struts2整合Spring有关问题
- psring_Struts2_Spring3整合问题
- struts2 整合spring,问题及特性
- 关于struts2与spring的整合问题
- struts2-spring2-hibernate3整合的一个问题
- Struts2整合Spring创建的Action同步问题
- Struts2 和spring整合的 Action层托管问题
- struts2 spring整合fieldError问题
- struts2与spring整合问题,访问struts2链接时,spring会负责创建Action
- Struts2与Spring整合时Action的创建问题
- struts2 + spring 整合的问题
- struts2,spring整合中使用spring 管理struts2的action,springaop 常见问题
- spring整合struts2遇到的问题一:scope设置
- Spring和Struts2整合见问题之一
- Struts2和Spring整合中的一些问题
- SSH整合问题:struts2-spring-plugin自动注入action的属性所产生的问题
- Spring 与Struts2整合遇到的问题以及解决方案