• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tomcat listener tag

 
Abhinav mathur
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I have written a context listener and ported it under the web-inf/classes folder.
While declaring it in the web app using <listener> tag the tomcat complains of
PARSE error at line 60 column 15
org.xml.sax.SAXParseException: Element type "listener" must be declared.
Can anyone let me know where the problem is.
Abhinav Mathur
 
Trish Wu
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
post code
 
shwetha bol
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Even i was facing same problem
with one of my applications
I had made 2 mistakes
1. listerner should be configured even
before the element servlet. Please
refer the web.xml dtd for exact
order of various elements in web.xml
2.Since listeners are introduced in
servlet spec v 2.3, if your web.xml
is pointing to older dtds it will create
problem

<!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
if its '2.2' instead of '2.3' it will not work

Hope this helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic