File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Parsing Error in web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Parsing Error in web.xml" Watch "Parsing Error in web.xml" New topic
Author

Parsing Error in web.xml

Harshada Deshmukh
Greenhorn

Joined: Mar 25, 2007
Posts: 12
I have developed web application in Eclipse IDE and running application on weblogic8.1 I am facing error as follows

Deployment descriptor "web.xml" is malformed. Check against the DTD: org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'web-app'. (line 2, column 10).>

could anybody help me for this
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Does you web.xml have a web-app element? If it does, is your web.xml file valid XML? Are all opening and closing brakets there?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Harshada Deshmukh
Greenhorn

Joined: Mar 25, 2007
Posts: 12
yes,all tags are correct. i think problem is related with dtd but i am not sure
Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1526
Originally posted by harshada deshmukh:
...(line 2, column 10)...


Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

May be you can post your web.xml file , and we figure out the problem !

or If you are using NetBeans, it provide the XML parser which checks your xml against the DTD ! I don't know about other IDE !


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Harshada Deshmukh
Greenhorn

Joined: Mar 25, 2007
Posts: 12
This is my web.xml file

<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

<web-app>
<servlet>
<servlet-name>basiclogging</servlet-name>
<servlet-class>be.fgov.minfin.training.log4jlogging.BasicLoggingServlet</servlet-class>
</servlet>
<servlet>
<servlet-name>logging</servlet-name>
<servlet-class>be.fgov.minfin.training.log4jlogging.LoggingServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>basiclogging</servlet-name>
<url-pattern>/basiclogging</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>logging</servlet-name>
<url-pattern>/logging</url-pattern>
</servlet-mapping>
</web-app>
Amit Ghorpade
Bartender

Joined: Jun 06, 2007
Posts: 2716
    
    6

Your web-app tag is invalid, it should look something like

I have deliberately put the space in http so that it is not displayed as a URL


Hope this helps
[ September 18, 2008: Message edited by: Amit Ghorpade ]

SCJP, SCWCD.
|Asking Good Questions|
Harshada Deshmukh
Greenhorn

Joined: Mar 25, 2007
Posts: 12
Thanks for helping me!
My problem is resolved!
It was J2EE version problem while creating application in Eclipse and integerating with weblogic 8.1. Also I have done changes web.xml as

<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
kriti jain
Greenhorn

Joined: Jun 19, 2012
Posts: 1
Please tell me how did you resolve this problem. I am facing the same problem. Please help me !
 
wood burning stoves
 
subject: Parsing Error in web.xml