• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Parsing Error in web.xml

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Harshada Deshmukh
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes,all tags are correct. i think problem is related with dtd but i am not sure
 
Ranch Hand
Posts: 1609
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by harshada deshmukh:
...(line 2, column 10)...

 
Ranch Hand
Posts: 2908
1
Spring Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 !
 
Harshada Deshmukh
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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>
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your web-app tag is invalid, it should look something like


<web-app version="2.5" xmlns="ht tp://java.sun.com/xml/ns/javaee" xmlns:xsi="ht tp://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="ht tp://java.sun.com/xml/ns/javaee ht tp://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">


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 ]
 
Harshada Deshmukh
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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">
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please tell me how did you resolve this problem. I am facing the same problem. Please help me !
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic