博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Line: 220 - com/opensymphony/xwork2/spring/SpringObjectFactory.java:220:-1
阅读量:6607 次
发布时间:2019-06-24

本文共 4040 字,大约阅读时间需要 13 分钟。

转自:http://blog.51cto.com/alinazh/1276363

在启动tomcat的时候出现错误:

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

原因及解决办法:

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

就是这么简单。

需要注意的是,这里指的不要引入,是在web工程的WEBROOT/WEB-INF/lib中也不要有多余的包,之前我的问题是lib中的包有冲突,

只在工程的buildpath中不引入,这个是不能控制包的冲突的!!

类似的问题及解决

启动服务器时出现异常:

警告: Failed startup of context }

Class: com.opensymphony.xwork2.spring.SpringObjectFactory

File: SpringObjectFactory.java
Method: getClassInstance
Line: 209 - com/opensymphony/xwork2/spring/SpringObjectFactory.java:209:-1
Caused by: java.lang.NullPointerException  at com.opensymphony.xwork2.spring.SpringObjectFactory.getClassInstance(SpringObjectFactory.java:209)

原因两个:

1.lib中多导入包的大原因:去掉struts2-spring-plugin-2.1.8包即可,因为没有用到spring。
2.还有的原因是用spring了,却没加监听器,在web.xml里面加上
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener> 

转载于:https://www.cnblogs.com/sharpest/p/7587524.html

你可能感兴趣的文章
layer 不居中的坑爹问题
查看>>
input file样式,文件路径、文件名的获取
查看>>
while循环和 do while 的区别
查看>>
android 运行时出现The connection to adb is down, and a severe error has occured.(转)
查看>>
Oracle数据库修改表结构
查看>>
问题:关于贴友一个用js传递value默认值的简单实现
查看>>
Python dict dictionaries Python 数据结构——字典
查看>>
【SICP练习】151 练习4.7
查看>>
MySQL高可用架构之Keepalived+主从架构部署
查看>>
如何在分组时,连接多个行数据
查看>>
Codeforces 1149 B - Three Religions
查看>>
js中的scrollTop、offsetTop、clientTop
查看>>
11-border(边框)
查看>>
4.字符串(2-6/2-7)
查看>>
bugfree3.0.1-邮件配置
查看>>
ASP.Net MVC View(视图)
查看>>
有关git clone 下载速度变慢的解决方法
查看>>
Papervision3D Essentials中文版,附Papervision3D_2.1.920.swc和章节练习源码
查看>>
Mysql汉字乱码的解决
查看>>
FMDB增删改查小Demo
查看>>