Win a copy of Micro Frontends in Action this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

any clue about 'web.xml' ?

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am getting the following error in startup.bat window(i have windows NT)-- please help me:
**********************
ERROR reading C:\tomcat\webapps\test\WEB-INF\web.xml
At Document root element is missing.
ERROR reading C:\tomcat\webapps\test\WEB-INF\web.xml
org.xml.sax.SAXParseException: Document root element is missing.
at com.sun.xml.parser.Parser.fatal(Parser.java:2817)
at com.sun.xml.parser.Parser.fatal(Parser.java:2805)
at com.sun.xml.parser.Parser.parseInternal(Parser.java:493)
at com.sun.xml.parser.Parser.parse(Parser.java:284)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:155)
at javax.xml.parsers.SAXParser.parse(SAXParser.java:126)
at org.apache.tomcat.util.xml.XmlMapper.readXml(XmlMapper.java:214)
at org.apache.tomcat.context.WebXmlReader.processWebXmlFile(WebXmlReader
.java:202)
at org.apache.tomcat.context.WebXmlReader.contextInit(WebXmlReader.java:
109)
at org.apache.tomcat.core.ContextManager.initContext(ContextManager.java
, Compiled Code)
at org.apache.tomcat.core.ContextManager.init(ContextManager.java, Compi
led Code)
at org.apache.tomcat.startup.Tomcat.execute(Tomcat.java:195)
at org.apache.tomcat.startup.Tomcat.main(Tomcat.java:235)
2001-05-17 02:31:31 - PoolTcpConnector: Starting HttpConnectionHandler on 8080
2001-05-17 02:31:31 - PoolTcpConnector: Starting Ajp12ConnectionHandler on 8007
**********************
-advait chitalia.
 
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like you have a strangely formatted web.xml file. web.xml is the definition file for what is contained in a web application and how it all fits together. Please show us your web.xml file, and we'll try to spot what's wrong with it.
 
Advait Chitalia
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Frank,
I am actually not able to open the web.xml file. when I try to open it through an editor like Edit Plus, it shows me squares and notext. By the way, i am able to see the contents of the web.xml file located under C:\tomcat\conf\web.xml where c:\tomcat is my TOMCAT_HOME
following is the file content of web.xml located under ..\conf\
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>
default
</servlet-name>
<servlet-class>
org.apache.tomcat.servlets.DefaultServlet
</servlet-class>
<load-on-startup>
-2147483646
</load-on-startup>
........
........
........
<welcome-file-list>
<welcome-file>
index.jsp
</welcome-file>
<welcome-file>
index.html
</welcome-file>
<welcome-file>
index.htm
</welcome-file>
</welcome-file-list>
</web-app>
*************************
thanx,
advait chitalia
[This message has been edited by Advait Chitalia (edited May 17, 2001).]
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well if you can't open and read the web.xml file it's complaining about, that's why it is complaining! web.xml should be a readable text file, formatted as xml.
Do you know how it became overwritten with a non-text file? Did you edit it with something non-text like Microsoft Word?
 
Advait Chitalia
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear Frank,
thanx for your prompt reply at this time of the night there!
i don't know how it happened, but i tried to copy tomcat from a CD . It didn't work. finally, i downloaded the tomcat3.2.1 from the net. Should I copy the web.xml file from the conf directory and paste to the test\WEB-INF directory?
thanx,
-advait.
 
Advait Chitalia
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the web.xml file residing under the test\web-inf folder is not readable whereas the web.xml file residing under root\conf folder is readable. Why is it so?
 
Frank Carver
Sheriff
Posts: 6920
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For a web.xml to not be readable is a mistake of some sort. Try replacing it with this very simple one and see what happens:
 
If you were a tree, what sort of tree would you be? This tiny ad is a poop beast.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic