调度程序初始化失败。 java.lang.ClassNotFoundException:org.apache.struts2.views.gxp.inject.InjectedObjectContainer

时间:2013-06-02 12:28:48

标签: java struts2 xml-configuration gxp

我正在使用Struts 2.3.14.2 jar,但是当我创建简单的应用程序时,我收到以下错误/异常。 我几乎完成了一切。我在类路径中添加了几乎所有的jar。但仍然得到这个例外。

我错过了什么吗?

SEVERE: Dispatcher initialization failed
Unable to load configuration. - bean - jar:file:/C:/Users/Nisha/Downloads/ecplise/util/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/StrutsUtil/WEB-INF/lib/struts2-gxp-plugin-2.3.14.2.jar!/struts-plugin.xml:8:162
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:473)
    at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:193)
    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4624)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5281)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
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:/C:/Users/Nisha/Downloads/ecplise/util/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/StrutsUtil/WEB-INF/lib/struts2-gxp-plugin-2.3.14.2.jar!/struts-plugin.xml:8:162
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:245)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:226)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
    ... 17 more
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.views.gxp.inject.InjectedObjectContainer
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
    at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:152)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:216)
    ... 20 more
2 Jun, 2013 5:40:11 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts3
Unable to load configuration. - bean - jar:file:/C:/Users/Nisha/Downloads/ecplise/util/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/StrutsUtil/WEB-INF/lib/struts2-gxp-plugin-2.3.14.2.jar!/struts-plugin.xml:8:162
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:485)
    at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:193)
    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4624)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5281)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(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:/C:/Users/Nisha/Downloads/ecplise/util/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/StrutsUtil/WEB-INF/lib/struts2-gxp-plugin-2.3.14.2.jar!/struts-plugin.xml:8:162
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:473)
    ... 15 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:/C:/Users/Nisha/Downloads/ecplise/util/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/StrutsUtil/WEB-INF/lib/struts2-gxp-plugin-2.3.14.2.jar!/struts-plugin.xml:8:162
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:245)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:226)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
    ... 17 more
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.views.gxp.inject.InjectedObjectContainer
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
    at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:152)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:216)
    ... 20 more
2 Jun, 2013 5:40:11 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-default.xml]
2 Jun, 2013 5:40:12 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger info
INFO: Parsing configuration file [struts-plugin.xml]
2 Jun, 2013 5:40:12 PM com.opensymphony.xwork2.util.logging.commons.CommonsLogger error
SEVERE: Dispatcher initialization failed
Unable to load configuration. - bean - jar:file:/C:/Users/Nisha/Downloads/ecplise/util/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/StrutsUtil/WEB-INF/lib/struts2-gxp-plugin-2.3.14.2.jar!/struts-plugin.xml:8:162
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:473)
    at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4624)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5281)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
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:/C:/Users/Nisha/Downloads/ecplise/util/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/StrutsUtil/WEB-INF/lib/struts2-gxp-plugin-2.3.14.2.jar!/struts-plugin.xml:8:162
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:245)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:226)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
    ... 18 more
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.views.gxp.inject.InjectedObjectContainer
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
    at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:152)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:216)
    ... 21 more
2 Jun, 2013 5:40:12 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
Unable to load configuration. - bean - jar:file:/C:/Users/Nisha/Downloads/ecplise/util/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/StrutsUtil/WEB-INF/lib/struts2-gxp-plugin-2.3.14.2.jar!/struts-plugin.xml:8:162
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:485)
    at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
    at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:51)
    at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
    at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
    at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
    at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:103)
    at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4624)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5281)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)
    at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
    at java.util.concurrent.FutureTask.run(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(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:/C:/Users/Nisha/Downloads/ecplise/util/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/StrutsUtil/WEB-INF/lib/struts2-gxp-plugin-2.3.14.2.jar!/struts-plugin.xml:8:162
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:70)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:429)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:473)
    ... 16 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:/C:/Users/Nisha/Downloads/ecplise/util/.metadata/.plugins/org.eclipse.wst.server.core/tmp1/wtpwebapps/StrutsUtil/WEB-INF/lib/struts2-gxp-plugin-2.3.14.2.jar!/struts-plugin.xml:8:162
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:245)
    at org.apache.struts2.config.StrutsXmlConfigurationProvider.register(StrutsXmlConfigurationProvider.java:102)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:226)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
    ... 18 more
Caused by: java.lang.ClassNotFoundException: org.apache.struts2.views.gxp.inject.InjectedObjectContainer
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1688)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1533)
    at com.opensymphony.xwork2.util.ClassLoaderUtil.loadClass(ClassLoaderUtil.java:152)
    at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.register(XmlConfigurationProvider.java:216)
    ... 21 more
2 Jun, 2013 5:40:12 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error filterStart
2 Jun, 2013 5:40:12 PM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/StrutsUtil] startup failed due to previous errors
2 Jun, 2013 5:40:12 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8089"]
2 Jun, 2013 5:40:12 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8099"]
2 Jun, 2013 5:40:12 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 3171 ms

2 个答案:

答案 0 :(得分:2)

如果您没有使用GXP插件,请将其从类路径中删除。分发中缺少引用的类org.apache.struts2.views.gxp.inject.InjectedObjectContainer。但是,如果需要,您可以从SVN存储库下载它。

答案 1 :(得分:1)

您必须使用插件库,除非:

  1. 他们确实需要;有些人从根本上改变了S2的行为。
  2. 他们的依赖感很满意;一些插件需要额外的库。
  3. 他们的版本与S2核心库版本相匹配;混合和匹配版本可能会失败。
  4. 使用Maven或等效解决版本和依赖性问题。

    仅使用您的应用所需的插件即可解决其他插件。