Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error in web.xml

 
abinash das
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using Tomcat 4.1.24

my web.xml is
<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

</web-app>

but i am getting the following message at the console :





Apache Tomcat/4.1.24
2008/09/16 15:30:01 org.apache.commons.digester.Digester error
致命的: Parse Error at line 2 column 234: Document root element "web-app",
must match DOCTYPE root "null".
org.xml.sax.SAXParseException: Document root element "web-app", must match
DOCTYPE root "null".
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
at
org.apache.xerces.impl.dtd.XMLDTDValidator.rootElementSpecified(Unknown
Source)
at
org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown
Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1543)
at
org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:282)
at
org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:639)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:243)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3567)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
at
org.apache.catalina.core.StandardService.start(StandardService.java:497)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
2008/09/16 15:30:01 org.apache.commons.digester.Digester error
致命的: Parse Error at line 2 column 234: Document is invalid: no grammar
found.
org.xml.sax.SAXParseException: Document is invalid: no grammar found.
at
org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown
Source)
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown
Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown
Source)
at
org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(Unknown
Source)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at org.apache.xerces.parsers.DTDConfiguration.parse(Unknown
Source)
at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown
Source)
at org.apache.commons.digester.Digester.parse(Digester.java:1543)
at
org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfig.java:282)
at
org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:639)
at
org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:243)
at
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)
at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3567)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at
org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
at
org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
at
org.apache.catalina.core.StandardService.start(StandardService.java:497)
at
org.apache.catalina.core.StandardServer.start(StandardServer.java:2190)
at org.apache.catalina.startup.Catalina.start(Catalina.java:512)
at org.apache.catalina.startup.Catalina.execute(Catalina.java:400)
at org.apache.catalina.startup.Catalina.process(Catalina.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
2008/09/16 15:30:04 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=true
2008/09/16 15:30:04 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing, config='org.apache.struts.action.ActionResources',
returnNull=true
2008/09/16 15:30:04 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing, config='resources.application', returnNull=true
2008/09/16 15:30:04 org.apache.struts.tiles.TilesPlugin init
情報: Tiles definition factory loaded for module ''.
2008/09/16 15:30:04 org.apache.struts.validator.ValidatorPlugIn
initResources
情報: Loading validation rules file from '/WEB-INF/validator-rules.xml'
2008/09/16 15:30:04 org.apache.struts.validator.ValidatorPlugIn
initResources
情報: Loading validation rules file from '/WEB-INF/validation.xml'
2008/09/16 15:30:06 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=true
2008/09/16 15:30:06 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing, config='org.apache.struts.action.ActionResources',
returnNull=true
2008/09/16 15:30:06 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing,
config='org.apache.struts.webapp.example.AlternateApplicationResources',
returnNull=true
2008/09/16 15:30:06 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing,
config='org.apache.struts.webapp.example.ApplicationResources',
returnNull=true
2008/09/16 15:30:06
org.apache.struts.webapp.example.memory.MemoryDatabasePlugIn init
情報: Initializing memory database plug in from '/WEB-INF/database.xml'
2008/09/16 15:30:06 org.apache.struts.validator.ValidatorPlugIn
initResources
情報: Loading validation rules file from '/WEB-INF/validator-rules.xml'
2008/09/16 15:30:06 org.apache.struts.validator.ValidatorPlugIn
initResources
情報: Loading validation rules file from '/WEB-INF/validation.xml'
2008/09/16 15:30:08 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=true
2008/09/16 15:30:08 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing, config='org.apache.struts.action.ActionResources',
returnNull=true
2008/09/16 15:30:08 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing,
config='org.apache.struts.webapp.exercise.ApplicationResources',
returnNull=true
2008/09/16 15:30:10 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=true
2008/09/16 15:30:10 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing, config='org.apache.struts.action.ActionResources',
returnNull=true
2008/09/16 15:30:10 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing,
config='org.apache.struts.webapp.upload.UploadResources', returnNull=true
2008/09/16 15:30:11 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=true
2008/09/16 15:30:11 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing, config='org.apache.struts.action.ActionResources',
returnNull=true
2008/09/16 15:30:11 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing,
config='org.apache.struts.webapp.validator.ApplicationResources',
returnNull=true
2008/09/16 15:30:11 org.apache.struts.validator.ValidatorPlugIn
initResources
情報: Loading validation rules file from '/WEB-INF/validator-rules.xml'
2008/09/16 15:30:11 org.apache.struts.validator.ValidatorPlugIn
initResources
情報: Loading validation rules file from '/WEB-INF/validation.xml'
2008/09/16 15:30:12 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing, config='org.apache.struts.util.LocalStrings',
returnNull=true
2008/09/16 15:30:12 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing, config='org.apache.struts.action.ActionResources',
returnNull=true
2008/09/16 15:30:13 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing,
config='org.apache.struts.webapp.tiles.dev1-1.ApplicationResources',
returnNull=true
2008/09/16 15:30:13 org.apache.struts.tiles.TilesPlugin init
情報: Tiles definition factory loaded for module ''.
2008/09/16 15:30:13 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing,
config='org.apache.struts.webapp.tiles.dev1-1.ApplicationResources',
returnNull=true
2008/09/16 15:30:13 org.apache.struts.tiles.TilesPlugin init
情報: Tiles definition factory loaded for module '/tutorial'.
2008/09/16 15:30:13 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing,
config='org.apache.struts.webapp.tiles.dev1-1.ApplicationResources',
returnNull=true
2008/09/16 15:30:13 org.apache.struts.tiles.TilesPlugin init
情報: Tiles definition factory loaded for module '/test'.
2008/09/16 15:30:13 org.apache.struts.util.PropertyMessageResources <init>
情報: Initializing,
config='org.apache.struts.webapp.tiles.dev1-1.ApplicationResources',
returnNull=true
2008/09/16 15:30:13 org.apache.struts.tiles.TilesPlugin init
情報: Tiles definition factory loaded for module '/examples'.
2008/09/16 15:30:13 org.apache.coyote.http11.Http11Protocol start
情報: Coyote HTTP/1.1をポート 8080 で起動します
2008/09/16 15:30:13 org.apache.jk.common.ChannelSocket init
情報: JK2: ajp13 listening on /0.0.0.0:8009
2008/09/16 15:30:13 org.apache.jk.server.JkMain start
情報: Jk running ID=0 time=0/15 config=D:\WebDB\Tomcat\conf\jk2.properties



Can anybody tell me what to do to avoid this message.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

Can you post your full web.xml file? I ran your snippet against validators and it worked OK, so there might be something in the content that is causing the error.

Also perhaps check for hidden whitespace characters, especially the ^M DOS character that can cause *IX files to be misread
 
abinash das
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my web.xml is like
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, I've validated that as well and it all seemed OK. Have you checked the file for hidden characters? Also make sure the web-app version="2.4" is correct/valid for that version of Tomcat.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic