Recently, we have been debugging the web. XML inherits from the web. XML, the web. the XML file is modified on a framework automatically generated by netbeans 3.6. There is a configuration like this:
-
Code: select all
-
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
From the perspective of this configuration, it seems that the program will run on Tomcat 4.1.x from ipvv1.2, and the system can run normally even if it cannot be connected to the Internet.
However, this is a problem with EC 2.0. EC 2.0 is running on Tomcat 5.5.23. We tested it today. When the network is disconnected, Tomcat is started and the following error occurs when loading easycluster:
-
Code: select all
-
=[ERROR]2007-04-09 15:54:51,267 [org.apache.struts.action.ActionServlet:1732] The /WEB-INF/web.xml was not found.
java.net.UnknownHostException: java.sun.com
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:177)
at java.net.Socket.connect(Socket.java:519)
at java.net.Socket.connect(Socket.java:469)
at sun.net.NetworkClient.doConnect(NetworkClient.java:157)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:382)
at sun.net.www.http.HttpClient.openServer(HttpClient.java:509)
at sun.net.www.http.HttpClient.<init>(HttpClient.java:231)
at sun.net.www.http.HttpClient.New(HttpClient.java:304)
at sun.net.www.http.HttpClient.New(HttpClient.java:316)
at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:817)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:769)
at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:694)
From this error, Struts cannot find our web. XML file, in fact, this file exists. The key error lies in the following line, and java.sun.com cannot be found, so I began to doubt the web. XML file. Therefore, we have referenced a web provided by Tomcat. XML (in $ catalina_home/CONF/web. XML, the web. XML is automatically loaded by Tomcat. That is to say, the configuration affects all web applications. Tomcat first loads the web. XML before loading the web. XML. there is no such configuration in XML.
So in EC 2.0, we removed the above configuration in Web. XML, started tomcat, loaded our application, and got OK. Of course, the network was disconnected.
It seems that there are some differences between Tomcat 5 and 4.x. In the future, you cannot write the Web. xml configuration.