tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Wingfield <jon.wingfi...@mkodo.com>
Subject Re: Servlet Context Listener problem...
Date Tue, 15 Jul 2003 09:13:06 GMT
Is that the entirety of your web.xml? The error looks like the parser 
can't find the definition of the "listener" element, it hasn't even got 
to the point of worrying about element order yet.
Have you got an xml prolog and a doctype at the top of the file? eg:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 
2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">

(Apologies for line-wrap)

Jon

Mufaddal Khumri wrote:

> Hi:
> 
> I implemented ServletContextListener in my class. I then wrote the xml  
> in the web.xml file and started tomcat. The error tomcat threw tells me  
> that it did not recognize the listener and listener-class elements ?? i  
> have them declared in the web.xml as:
> 
> <web-app>
>     
>     <!-- ServletContextListener -->
>     <listener>
>         <listener-class>
>             
> com.wavesinmotion.cw.classes.jsphelpers.CourseWizardContextListener
>         </listener-class>
>     </listener>
> </web-app>
> 
> Any ideas where I am going wrong ?
> Thanks.
> 
> Tomcat threw this error below:
> 
> SEVERE: Parse Error at line 10 column 12: Element type "listener" must  
> be declared.
> org.xml.sax.SAXParseException: Element type "listener" must be declared.
>     at  
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Error 
> HandlerWrapper.java:232)
>     at  
> org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.jav 
> a:173)
>     at  
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.jav 
> a:371)
>     at  
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.jav 
> a:305)
>     at  
> org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDVali 
> dator.java:1833)
>     at  
> org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator. 
> java:724)
>     at  
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(X 
> MLDocumentFragmentScannerImpl.java:759)
>     at  
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis 
> patcher.dispatch(XMLDocumentFragmentScannerImpl.java:1477)
>     at  
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDo 
> cumentFragmentScannerImpl.java:329)
>     at  
> org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:5 
> 25)
>     at  
> org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:5 
> 81)
>     at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
>     at  
> org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java 
> :1175)
>     at org.apache.commons.digester.Digester.parse(Digester.java:1495)
>     at  
> org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfi 
> g.java:282)
>     at  
> org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:639)
>     at  
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.j 
> ava:243)
>     at  
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu 
> pport.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:2189)
>     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(NativeMethodAccessorImpl.jav 
> a:39)
>     at  
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor 
> Impl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:324)
>     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
> Jul 14, 2003 3:56:11 PM org.apache.commons.digester.Digester error
> SEVERE: Parse Error at line 11 column 19: Element type "listener-class"  
> must be declared.
> org.xml.sax.SAXParseException: Element type "listener-class" must be  
> declared.
>     at  
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Error 
> HandlerWrapper.java:232)
>     at  
> org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.jav 
> a:173)
>     at  
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.jav 
> a:371)
>     at  
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.jav 
> a:305)
>     at  
> org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDVali 
> dator.java:1833)
>     at  
> org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator. 
> java:724)
>     at  
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(X 
> MLDocumentFragmentScannerImpl.java:759)
>     at  
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis 
> patcher.dispatch(XMLDocumentFragmentScannerImpl.java:1477)
>     at  
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDo 
> cumentFragmentScannerImpl.java:329)
>     at  
> org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:5 
> 25)
>     at  
> org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:5 
> 81)
>     at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
>     at  
> org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java 
> :1175)
>     at org.apache.commons.digester.Digester.parse(Digester.java:1495)
>     at  
> org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfi 
> g.java:282)
>     at  
> org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:639)
>     at  
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.j 
> ava:243)
>     at  
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu 
> pport.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:2189)
>     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(NativeMethodAccessorImpl.jav 
> a:39)
>     at  
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor 
> Impl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:324)
>     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
> Jul 14, 2003 3:56:11 PM org.apache.commons.digester.Digester error
> SEVERE: Parse Error at line 190 column 11: The content of element type  
> "web-app" must match  
> "(icon?,display-name?,description?,distributable?,context- 
> param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome- 
> file-list?,error-page*,taglib*,resource-ref*,security- 
> constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
> org.xml.sax.SAXParseException: The content of element type "web-app"  
> must match  "(icon?,display-name?,description?,distributable?,context- 
> param*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welcome- 
> file-list?,error-page*,taglib*,resource-ref*,security- 
> constraint*,login-config?,security-role*,env-entry*,ejb-ref*)".
>     at  
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Error 
> HandlerWrapper.java:232)
>     at  
> org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.jav 
> a:173)
>     at  
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.jav 
> a:371)
>     at  
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.jav 
> a:305)
>     at  
> org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValida 
> tor.java:1918)
>     at  
> org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.ja 
> va:851)
>     at  
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XML 
> DocumentFragmentScannerImpl.java:1008)
>     at  
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDis 
> patcher.dispatch(XMLDocumentFragmentScannerImpl.java:1469)
>     at  
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDo 
> cumentFragmentScannerImpl.java:329)
>     at  
> org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:5 
> 25)
>     at  
> org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:5 
> 81)
>     at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
>     at  
> org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java 
> :1175)
>     at org.apache.commons.digester.Digester.parse(Digester.java:1495)
>     at  
> org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConfi 
> g.java:282)
>     at  
> org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:639)
>     at  
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.j 
> ava:243)
>     at  
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSu 
> pport.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:2189)
>     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(NativeMethodAccessorImpl.jav 
> a:39)
>     at  
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor 
> Impl.java:25)
>     at java.lang.reflect.Method.invoke(Method.java:324)
>     at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message