struts2升级之后出现的问题
一次struts2爆高危漏洞,升级之后启动tomcat出现:
?
2013-10-08 14:11:54 [com.opensymphony.xwork2.spring.SpringObjectFactory]-[INFO] Setting autowire strategy to name
2013-10-08 14:11:54 [org.apache.struts2.spring.StrutsSpringObjectFactory]-[INFO] ... initialized Struts-Spring integration successfully
2013-10-08 14:11:55 [com.opensymphony.xwork2.config.providers.InterceptorBuilder]-[WARN] Unable to load config class org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor at interceptor - jar:file:/F:/apache-tomcat-6.0.26/webapps/selfservice/WEB-INF/lib/struts2-core-2.3.15.1.jar!/struts-default.xml:168:127 probably due to a missing jar, which might be fine if you never plan to use the validation interceptor
2013-10-08 14:11:55 [com.opensymphony.xwork2.config.providers.InterceptorBuilder]-[ERROR] Actual exception
Caught Exception while registering Interceptor class org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor - interceptor - jar:file:/F:/apache-tomcat-6.0.26/webapps/selfservice/WEB-INF/lib/struts2-core-2.3.15.1.jar!/struts-default.xml:168:127
?at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:214)
?at com.opensymphony.xwork2.config.providers.InterceptorBuilder.constructInterceptorReference(InterceptorBuilder.java:70)
?at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.lookupInterceptorReference(XmlConfigurationProvider.java:1110)
?at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStack(XmlConfigurationProvider.java:928)
?at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptorStacks(XmlConfigurationProvider.java:941)
?at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadInterceptors(XmlConfigurationProvider.java:964)
?at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.addPackage(XmlConfigurationProvider.java:533)
?at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadPackages(XmlConfigurationProvider.java:292)
?at org.apache.struts2.config.StrutsXmlConfigurationProvider.loadPackages(StrutsXmlConfigurationProvider.java:112)
?at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reloadContainer(DefaultConfiguration.java:250)
?at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:67)
?at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:446)
?at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:490)
?at org.apache.struts2.dispatcher.ng.InitOperations.initDispatcher(InitOperations.java:74)
?at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.init(StrutsPrepareAndExecuteFilter.java:57)
?at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295)
?at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
?at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)
?at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3838)
?at org.apache.catalina.core.StandardContext.start(StandardContext.java:4488)
?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:546)
?at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)
?at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)
?at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
?at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
?at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
?at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
?at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
?at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
?at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
?at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
?at org.apache.catalina.core.StandardService.start(StandardService.java:519)
?at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
?at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
?at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
?at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
?at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
?at java.lang.reflect.Method.invoke(Method.java:597)
?at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
?at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
?at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:301)
?at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:492)
?at com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:530)
?at com.opensymphony.xwork2.inject.ContainerImpl$6.call(ContainerImpl.java:528)
?at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:584)
?at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:528)
?at com.opensymphony.xwork2.ObjectFactory.injectInternalBeans(ObjectFactory.java:139)
?at com.opensymphony.xwork2.spring.SpringObjectFactory.autoWireBean(SpringObjectFactory.java:208)
?at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:183)
?at com.opensymphony.xwork2.spring.SpringObjectFactory.buildBean(SpringObjectFactory.java:154)
?at com.opensymphony.xwork2.ObjectFactory.buildBean(ObjectFactory.java:151)
?at com.opensymphony.xwork2.ObjectFactory.buildInterceptor(ObjectFactory.java:192)
?... 41 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
?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$ParameterInjector.inject(ContainerImpl.java:469)
?at com.opensymphony.xwork2.inject.ContainerImpl.getParameters(ContainerImpl.java:484)
?at com.opensymphony.xwork2.inject.ContainerImpl.access$000(ContainerImpl.java:34)
?at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:299)
?... 52 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
?at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:502)
?at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:539)
?at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:593)
?at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:537)
?at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)
?at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)
?... 57 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
?at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:301)
?at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:438)
?at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:499)
?... 62 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
?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$ParameterInjector.inject(ContainerImpl.java:469)
?at com.opensymphony.xwork2.inject.ContainerImpl.getParameters(ContainerImpl.java:484)
?at com.opensymphony.xwork2.inject.ContainerImpl.access$000(ContainerImpl.java:34)
?at com.opensymphony.xwork2.inject.ContainerImpl$MethodInjector.inject(ContainerImpl.java:299)
?... 64 more
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
?at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:502)
?at com.opensymphony.xwork2.inject.ContainerImpl$7.call(ContainerImpl.java:539)
?at com.opensymphony.xwork2.inject.ContainerImpl.callInContext(ContainerImpl.java:593)
?at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:537)
?at com.opensymphony.xwork2.config.impl.LocatableFactory.create(LocatableFactory.java:32)
?at com.opensymphony.xwork2.inject.ContainerBuilder$4.create(ContainerBuilder.java:130)
?... 69 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
?at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:447)
?at com.opensymphony.xwork2.inject.ContainerImpl.inject(ContainerImpl.java:499)
?... 74 more
Caused by: java.lang.reflect.InvocationTargetException
?at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
?at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
?at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
?at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
?at com.opensymphony.xwork2.inject.ContainerImpl$ConstructorInjector.construct(ContainerImpl.java:426)
?... 75 more
Caused by: http://www.opensymphony.com/xwork/xwork-validator-config-1.0.dtd - Class: sun.net.www.protocol.http.HttpURLConnection
File: HttpURLConnection.java
Method: getInputStream
Line: 1434 - sun/net/www/protocol/http/HttpURLConnection.java:1434:-1
?at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:119)
?at com.opensymphony.xwork2.validator.DefaultValidatorFileParser.parseValidatorDefinitions(DefaultValidatorFileParser.java:119)
?at com.opensymphony.xwork2.validator.DefaultValidatorFactory.retrieveValidatorConfiguration(DefaultValidatorFactory.java:201)
?at com.opensymphony.xwork2.validator.DefaultValidatorFactory.parseValidators(DefaultValidatorFactory.java:190)
?at com.opensymphony.xwork2.validator.DefaultValidatorFactory.<init>(DefaultValidatorFactory.java:61)
?... 80 more
Caused by: java.io.FileNotFoundException: http://www.opensymphony.com/xwork/xwork-validator-config-1.0.dtd
?at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1434)
?at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:675)
?at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1313)
?at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1280)
?at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:283)
?at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1191)
?at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1087)
?at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:1000)
?at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
?at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
?at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
?at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
?at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
?at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
?at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
?at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
?at javax.xml.parsers.SAXParser.parse(SAXParser.java:395)
?at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:117)
?... 84 more
?
?
解决方案:
删除 validators.xm l即可
参考资料:
http://stackoverflow.com/questions/17177112/struts2-annotationvalidationinterceptor
?
?
?
?
?
?