Tomcat问题启动struts应用程序

时间:2017-02-09 03:52:55

标签: java eclipse tomcat struts2

我在 eclipse-jee-indigo-SR2-win32-x86_64 上开发的Struts上有一个简单的应用程序。 Eclipse构建路径和Java_Home都指向 JRE7 。我已经在Webapps lib中使用了所有Struts jar。我的Struts版本是 Struts 2.5.10 ,而Tomcat版本是 apache-tomcat-7.0.75-windows-x64 在创建Dynamic webapp时,运行时被称为Tomcat7 < / p>

在尝试启动应用程序时,我收到以下错误:

Feb 08, 2017 4:26:39 PM org.apache.catalina.core.ApplicationContext log
INFO: No Spring WebApplicationInitializer types detected on classpath
Feb 08, 2017 4:26:42 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
Unable to load configuration. - bean - jar:file:/D:/tomcat/apache-tomcat-7.0.75-windows-x64/apache-tomcat-7.0.75/webapps/ServiceValidatorUI/WEB-INF/lib/struts2-gxp-plugin-2.5.10.jar!/struts-plugin.xml:8:162
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:499)
    at org.apache.struts2.dispatcher.InitOperations.initDispatcher(InitOperations.java:75)
    at org.apache.struts2.dispatcher.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:63)
    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4958)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5652)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:899)
    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
    at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1092)
    at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1984)
    at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
Caused by: Unable to load configuration. - bean - jar:file:/D:/tomcat/apache-tomcat-7.0.75-windows-x64/apache-tomcat-7.0.75/webapps/ServiceValidatorUI/WEB-INF/lib/struts2-gxp-plugin-2.5.10.jar!/struts-plugin.xml:8:162
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
    at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:906)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:445)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:486)
    ... 18 more
Caused by: Unable to load bean: type:org.apache.struts2.views.gxp.inject.InjectedObjectContainer class:org.apache.struts2.views.gxp.inject.InjectedObjectContainer - bean - jar:file:/D:/tomcat/apache-tomcat-7.0.75-windows-x64/apache-tomcat-7.0.75/webapps/ServiceValidatorUI/WEB-INF/lib/struts2-gxp-plugin-2.5.10.jar!/struts-plugin.xml:8:162
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:271)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:98)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:165)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
    ... 21 more
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.views.gxp.inject.InjectedObjectContainer
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1892)
    at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1735)
    at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:176)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:244)
    ... 24 more

Feb 08, 2017 4:26:50 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Feb 08, 2017 4:26:50 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Feb 08, 2017 4:26:50 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@4c7b39a1')

有没有人遇到类似的问题?任何帮助将不胜感激

Souvik

1 个答案:

答案 0 :(得分:0)

看起来你缺少struts2所需的插件之一。

如果项目是maven,请添加以下依赖

<dependency>
  <groupId>org.apache.struts</groupId>
  <artifactId>struts2-gxp-plugin</artifactId>
  <version>2.5.1</version>
</dependency>

如果您的项目不是maven,您可以从这里下载jar并将其下载到您的路径。

http://central.maven.org/maven2/org/apache/struts/struts2-gxp-plugin/2.5.1/struts2-gxp-plugin-2.5.1.jar