Tag Archives: StandardContext

Error when Struts2 started Tomcat: org.apache.catalina.core.StandardContext filterStart

Use Struts2 + JSP to do a website, to the website production later, started Tomcat was unable to start, hung. It has been useful for a long time, but today I added something and it hung up. After deleting it, I still couldn’t start the Tomcat server.
Here is the error code:

<span style="color:#ff0000;"> org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts</span>
<span style="color:#ff0000;">include - file:/C:/tomcat7.059/webapps/MusicWeb/WEB-INF/classes/struts.xml:41:43</span>
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:833)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:864)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadDocuments(XmlConfigurationProvider.java:131)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.init(XmlConfigurationProvider.java:100)
	at com.opensymphony.xwork2.config.impl.DefaultConfiguration.reload(DefaultConfiguration.java:130)
	at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:52)
	at org.apache.struts2.dispatcher.Dispatcher.init_PreloadConfiguration(Dispatcher.java:395)
	at org.apache.struts2.dispatcher.Dispatcher.init(Dispatcher.java:452)
	at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:201)
	at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
	at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
	at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
	at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4854)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5542)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.StandardContext.reload(StandardContext.java:4033)
	at org.apache.catalina.startup.HostConfig.reload(HostConfig.java:1479)
	at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1462)
	at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1646)
	at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:328)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1374)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1546)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1556)
	at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1524)
	at java.lang.Thread.run(Thread.java:722)
Caused by: Connection timed out: connect - [unknown location]
	at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:123)
	at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.loadConfigurationFiles(XmlConfigurationProvider.java:830)
	... 26 more
Caused by: java.net.ConnectException: Connection timed out: connect
	at java.net.DualStackPlainSocketImpl.connect0(Native Method)
	at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:69)
	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
	at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:157)
	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)
	at java.net.Socket.connect(Socket.java:579)
	at java.net.Socket.connect(Socket.java:528)
	at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:378)
	at sun.net.www.http.HttpClient.openServer(HttpClient.java:473)
	at sun.net.www.http.HttpClient.<init>(HttpClient.java:203)
	at sun.net.www.http.HttpClient.New(HttpClient.java:290)
	at sun.net.www.http.HttpClient.New(HttpClient.java:306)
	at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:995)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:931)
	at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:849)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1299)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:632)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startEntity(XMLEntityManager.java:1270)
	at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.startDTDEntity(XMLEntityManager.java:1237)
	at com.sun.org.apache.xerces.internal.impl.XMLDTDScannerImpl.setInputSource(XMLDTDScannerImpl.java:260)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1153)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1049)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:962)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
	at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
	at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:489)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
	at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)
	at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
	at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1210)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:568)
	at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:302)
	at com.opensymphony.xwork2.util.DomHelper.parse(DomHelper.java:121)
	... 27 more

<span style="color:#ff0000;">Apr 09, 2015 9:23:59 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Error filterStart
Apr 09, 2015 9:23:59 AM org.apache.catalina.core.StandardContext startInternal
SEVERE: Context [/MusicWeb] startup failed due to previous errors</span>

 

The imported jar package :(it is said on the Internet that there are fewer or more jars, which are useful before, but some jar packages have been changed properly later, which is still useless)

Configuration of web.xml :(Filter Filter is a problem, but I don’t use any Filter)

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" 
xmlns="http://java.sun.com/xml/ns/javaee" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

<!-- org.apache.struts2.dispatcher.FilterDispatcher
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter
org.apache.struts2.dispatcher.ng.filter.StrutsPrepareFilter
 -->
<filter>
<filter-name>struts</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>

<filter-mapping><span style="color:#ff0000;">
</span><filter-name>struts</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

  <display-name></display-name>	
  <welcome-file-list>
    <welcome-file>login.jsp</welcome-file>
  </welcome-file-list>
  
  <error-page> 
<error-code>404</error-code> 
<location>/error.jsp</location> 
</error-page> 
</web-app>

because it feels either
Jar packages are inconsistent or conflicting, struts.xml configuration file is problematic, and Web.xml configuration file is problematic, and I’ve been working on these three areas for a long time without failing to launch.

Who knows the next day to open the computer, restart tomcat server did not hang up, the project can also be deployed, everything is normal.

Then I had to pick up where I left off yesterday and finally found the cause of the server error in my Struts.xml configuration file

		<action name="multiFileUpload_*" class="com.action.UploadAction" method="{1}">
			<result name="addMusicInfo" type="redirect-action">Another Action method </result> If you write it this way, you get the above error
		</action>

But if the

Put <span style="color:#ff0000;"><result name="addMusicInfo" type="redirect-action"></span>another Action method. lt;/result> change it to <span style="color:#ff0000;"><result name="addMusicInfo" >/error.jsp</result></span> and it won't. The server still can't be started even after the error is reported and corrected.
The reason for the problem has been found, but it is still unclear why and how to solve it, so I hope those who have errors can discuss it with us

.
Add the log file when the error occurs:

127.0.0.1 - - [09/Apr/2015:09:19:36 +0800] "GET /gg_bd_ad_720x90.js HTTP/1.1" 404 -
127.0.0.1 - - [09/Apr/2015:09:19:36 +0800] "GET /follow.js HTTP/1.1" 404 -
127.0.0.1 - - [09/Apr/2015:09:19:36 +0800] "GET /MusicWeb/upload//%E5%87%BA%E9%94%99%E5%A3%81%E7%BA%B8.jpg HTTP/1.1" 304 -