Line: 220 - com/opensymphony/xwork2/spring/SpringObjectFactory.java:220:-1

严重: Exception starting filter struts2
Class: com.opensymphony.xwork2.spring.SpringObjectFactory
File: SpringObjectFactory.java
Method: getClassInstance
Line: 220 - com/opensymphony/xwork2/spring/SpringObjectFactory.java:220:-1
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:437)
 at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:195)
 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:3709)
 at org.apache.catalina.core.StandardContext.start(StandardContext.java:4356)
 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.deployDescriptor(HostConfig.java:626)
 at org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:553)
 at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:488)
 at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1215)
 at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:293)
 at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
 at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
 at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
 at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
 at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
 at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
 at com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance(SpringObjectFactory.java:220)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.verifyResultType(XmlConfigurationProvider.java:530)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addResultTypes(XmlConfigurationProvider.java:501)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:457)
 at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:275)
 at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:111)
 at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:204)
 at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:66)
 at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:380)
 at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:424)
 ... 20 more
2011-8-28 1:19:47 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2011-8-28 1:19:47 org.apache.catalina.core.StandardContext start
严重: Context [] startup failed due to previous errors

 

原因及解决办法:

不要引入包:struts2-spring-plugin-2.2.3.jar.

就是这么简单。

当存在这个jar包时,不管你用不用spring,它都会去需找Spring相关的内容,启动Spring容器,当没有Spring的相关内容时,那样就会报这个错了

你可能感兴趣的:(String,struts)