Make sure your DTD is the correct servlet 2.3 DTD. The listener element was
introduced in version 2.3 of the servlet spec.

-----Original Message-----
From: Mufaddal Khumri [mailto:[EMAIL PROTECTED] 
Sent: 15 July 2003 04:58
To: Tomcat Users List
Subject: Re: Servlet Context Listener problem...


Yes , my listener has been declared before anything else under  
<web-app> .. the problem persists .. any clues ?
On Tuesday, July 15, 2003, at 07:00  AM, Januski, Ken wrote:

> Listeners must be declared before any servlets in web.xml. I'd check  
> that
> first.
>
>
> -----Original Message-----
> From: Mufaddal Khumri [mailto:[EMAIL PROTECTED]
> Sent: Monday, July 14, 2003 6:41 AM
> To: Tomcat List
> Subject: Servlet Context Listener problem...
>
>
> 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(Erro 
> r
> HandlerWrapper.java:232)
>       at
> org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.ja 
> v
> a:173)
>       at
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.ja 
> v
> a:371)
>       at
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.ja 
> v
> a:305)
>       at
> org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDVal 
> i
> 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$FragmentContentDi 
> s
> patcher.dispatch(XMLDocumentFragmentScannerImpl.java:1477)
>       at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLD 
> o
> 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.jav 
> a
> :1175)
>       at org.apache.commons.digester.Digester.parse(Digester.java:1495)
>       at
> org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConf 
> i
> 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(LifecycleS 
> u
> pport.java:166)
>       at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:356 
> 7
> )
>       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.ja 
> v
> a:39)
>       at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso 
> r
> 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(Erro 
> r
> HandlerWrapper.java:232)
>       at
> org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.ja 
> v
> a:173)
>       at
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.ja 
> v
> a:371)
>       at
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.ja 
> v
> a:305)
>       at
> org.apache.xerces.impl.dtd.XMLDTDValidator.handleStartElement(XMLDTDVal 
> i
> 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$FragmentContentDi 
> s
> patcher.dispatch(XMLDocumentFragmentScannerImpl.java:1477)
>       at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLD 
> o
> 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.jav 
> a
> :1175)
>       at org.apache.commons.digester.Digester.parse(Digester.java:1495)
>       at
> org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConf 
> i
> 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(LifecycleS 
> u
> pport.java:166)
>       at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:356 
> 7
> )
>       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.ja 
> v
> a:39)
>       at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso 
> r
> 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(Erro 
> r
> HandlerWrapper.java:232)
>       at
> org.apache.xerces.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.ja 
> v
> a:173)
>       at
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.ja 
> v
> a:371)
>       at
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.ja 
> v
> a:305)
>       at
> org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValid 
> a
> tor.java:1918)
>       at
> org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.j 
> a
> va:851)
>       at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XM 
> L
> DocumentFragmentScannerImpl.java:1008)
>       at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDi 
> s
> patcher.dispatch(XMLDocumentFragmentScannerImpl.java:1469)
>       at
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLD 
> o
> 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.jav 
> a
> :1175)
>       at org.apache.commons.digester.Digester.parse(Digester.java:1495)
>       at
> org.apache.catalina.startup.ContextConfig.applicationConfig(ContextConf 
> i
> 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(LifecycleS 
> u
> pport.java:166)
>       at
> org.apache.catalina.core.StandardContext.start(StandardContext.java:356 
> 7
> )
>       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.ja 
> v
> a:39)
>       at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccesso 
> r
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to