Java EE之Struts2异常[No mapping found for dependency [type=java.lang.String, name='actionPackages'#java.lang.RuntimeException]【摘抄】

发布时间:2019-05-12 | 分类:Struts2

标签: Java EE

本博文摘自:http://www.blogjava.net/nkjava/archive/2009/03/29/262705.html

 

出现这个问题,可能是添加了struts2-codebehind包,去除这个包就可以了

 

No mapping found for dependency [type=java.lang.String, name='actionPackages']
java.lang.RuntimeException: java.lang.RuntimeException: com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=java.lang.String, name='actionPackages'] in public void org.apache.struts2.config.ClasspathPackageProvider.setActionPackages(java.lang.String).
    at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132)
    at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
    at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:507)
    at com.opensymphony.xwork2.inject.ContainerImpl$8.call(ContainerImpl.java:540)
    at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)
    at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:538)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:198)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
    at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
    at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:620)
    at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1233)
    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:460)
    at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:124)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.plugin.AbstractJettyRunMojo.restartWebApp(AbstractJettyRunMojo.java:441)
    at org.mortbay.jetty.plugin.AbstractJettyRunMojo$1.filesChanged(AbstractJettyRunMojo.java:402)
    at org.mortbay.util.Scanner.reportBulkChanges(Scanner.java:486)
    at org.mortbay.util.Scanner.reportDifferences(Scanner.java:352)
    at org.mortbay.util.Scanner.scan(Scanner.java:280)
    at org.mortbay.util.Scanner$1.run(Scanner.java:232)
    at java.util.TimerThread.mainLoop(Timer.java:512)
    at java.util.TimerThread.run(Timer.java:462)
Caused by: java.lang.RuntimeException: com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=java.lang.String, name='actionPackages'] in public void org.apache.struts2.config.ClasspathPackageProvider.setActionPackages(java.lang.String).
    at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:495)
    at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:532)
    at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)
    at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:530)
    at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)
    at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)
    ... 27 more
Caused by: com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=java.lang.String, name='actionPackages'] in public void org.apache.struts2.config.ClasspathPackageProvider.setActionPackages(java.lang.String).
    at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:144)
    at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMethods(ContainerImpl.java:113)
    at com.opensymphony.xwork2.inject.ContainerImpl.addInjectors(ContainerImpl.java:90)
    at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:71)
    at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:69)
    at com.opensymphony.xwork2.inject.util.ReferenceCache$CallableCreate.call(ReferenceCache.java:150)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:76)
    at com.opensymphony.xwork2.inject.util.ReferenceCache.get(ReferenceCache.java:116)
    at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.<init>(ContainerImpl.java:348)
    at com.opensymphony.xwork2.inject.ContainerImpl$5.create(ContainerImpl.java:305)
    at com.opensymphony.xwork2.inject.ContainerImpl$5.create(ContainerImpl.java:304)
    at com.opensymphony.xwork2.inject.util.ReferenceCache$CallableCreate.call(ReferenceCache.java:150)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:76)
    at com.opensymphony.xwork2.inject.util.ReferenceCache.get(ReferenceCache.java:116)
    at com.opensymphony.xwork2.inject.ContainerImpl.getConstructor(ContainerImpl.java:594)
    at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:491)
    ... 32 more
Caused by: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=java.lang.String, name='actionPackages'] in public void org.apache.struts2.config.ClasspathPackageProvider.setActionPackages(java.lang.String).
    at com.opensymphony.xwork2.inject.ContainerImpl.createParameterInjector(ContainerImpl.java:235)
    at com.opensymphony.xwork2.inject.ContainerImpl.getParametersInjectors(ContainerImpl.java:225)
    at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.<init>(ContainerImpl.java:287)
    at com.opensymphony.xwork2.inject.ContainerImpl$3.create(ContainerImpl.java:117)
    at com.opensymphony.xwork2.inject.ContainerImpl$3.create(ContainerImpl.java:115)
    at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:141)
    ... 51 more
2009-03-29 11:23:51.305::WARN:  Failed startup of context org.mortbay.jetty.plugin.Jetty6PluginWebAppContext@8932e8{/ssh,D:"workplace"ssh"src"main"webapp}
java.lang.RuntimeException: java.lang.RuntimeException: com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=java.lang.String, name='actionPackages'] in public void org.apache.struts2.config.ClasspathPackageProvider.setActionPackages(java.lang.String).
    at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:132)
    at com.opensymphony.xwork2.inject.Scope$2$1.create(Scope.java:51)
    at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:507)
    at com.opensymphony.xwork2.inject.ContainerImpl$8.call(ContainerImpl.java:540)
    at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:574)
    at com.opensymphony.xwork2.inject.ContainerImpl.getInstance(ContainerImpl.java:538)
    at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:198)
    at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:55)
    at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:360)
    at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:403)
    at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:190)
    at org.mortbay.jetty.servlet.FilterHolder.doStart(FilterHolder.java:97)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:620)
    at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
    at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1233)
    at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
    at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:460)
    at org.mortbay.jetty.plugin.Jetty6PluginWebAppContext.doStart(Jetty6PluginWebAppContext.java:124)
    at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
    at org.mortbay.jetty.plugin.AbstractJettyRunMojo.restartWebApp(AbstractJettyRunMojo.java:441)
    at org.mortbay.jetty.plugin.AbstractJettyRunMojo$1.filesChanged(AbstractJettyRunMojo.java:402)
    at org.mortbay.util.Scanner.reportBulkChanges(Scanner.java:486)
    at org.mortbay.util.Scanner.reportDifferences(Scanner.java:352)
    at org.mortbay.util.Scanner.scan(Scanner.java:280)
    at org.mortbay.util.Scanner$1.run(Scanner.java:232)
    at java.util.TimerThread.mainLoop(Timer.java:512)
    at java.util.TimerThread.run(Timer.java:462)
Caused by: java.lang.RuntimeException: com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=java.lang.String, name='actionPackages'] in public void org.apache.struts2.config.ClasspathPackageProvider.setActionPackages(java.lang.String).
    at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:495)
    at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:532)
    at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:581)
    at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:530)
    at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)
    at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)
    ... 27 more
Caused by: com.opensymphony.xwork2.inject.DependencyException: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=java.lang.String, name='actionPackages'] in public void org.apache.struts2.config.ClasspathPackageProvider.setActionPackages(java.lang.String).
    at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:144)
    at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMethods(ContainerImpl.java:113)
    at com.opensymphony.xwork2.inject.ContainerImpl.addInjectors(ContainerImpl.java:90)
    at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:71)
    at com.opensymphony.xwork2.inject.ContainerImpl$1.create(ContainerImpl.java:69)
    at com.opensymphony.xwork2.inject.util.ReferenceCache$CallableCreate.call(ReferenceCache.java:150)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:76)
    at com.opensymphony.xwork2.inject.util.ReferenceCache.get(ReferenceCache.java:116)
    at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.<init>(ContainerImpl.java:348)
    at com.opensymphony.xwork2.inject.ContainerImpl$5.create(ContainerImpl.java:305)
    at com.opensymphony.xwork2.inject.ContainerImpl$5.create(ContainerImpl.java:304)
    at com.opensymphony.xwork2.inject.util.ReferenceCache$CallableCreate.call(ReferenceCache.java:150)
    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
    at com.opensymphony.xwork2.inject.util.ReferenceCache.internalCreate(ReferenceCache.java:76)
    at com.opensymphony.xwork2.inject.util.ReferenceCache.get(ReferenceCache.java:116)
    at com.opensymphony.xwork2.inject.ContainerImpl.getConstructor(ContainerImpl.java:594)
    at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:491)
    ... 32 more
Caused by: com.opensymphony.xwork2.inject.ContainerImpl$MissingDependencyException: No mapping found for dependency [type=java.lang.String, name='actionPackages'] in public void org.apache.struts2.config.ClasspathPackageProvider.setActionPackages(java.lang.String).
    at com.opensymphony.xwork2.inject.ContainerImpl.createParameterInjector(ContainerImpl.java:235)
[INFO] Restart completed at Sun Mar 29 11:23:51 CST 2009
    at com.opensymphony.xwork2.inject.ContainerImpl.getParametersInjectors(ContainerImpl.java:225)
    at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.<init>(ContainerImpl.java:287)
    at com.opensymphony.xwork2.inject.ContainerImpl$3.create(ContainerImpl.java:117)
    at com.opensymphony.xwork2.inject.ContainerImpl$3.create(ContainerImpl.java:115)
    at com.opensymphony.xwork2.inject.ContainerImpl.addInjectorsForMembers(ContainerImpl.java:141)
    ... 51 more

  

java编程学习网专注于java编程技术分享