File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

ServletContextListener Deployment

 
Dave Thomas
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all.
I have created a ServletContextListener and placed it in my classes directory. I have added the entry into the deployment descriptor but am getting the error message:
PARSE error at line 7 column 14
org.xml.sax.SAXParseException: Element type "listener" must be declared.
Heres mt descriptor code:
<listener>
<listener-class>DBContextListener</listener-class>
</listener>
Any ideas?
Thanks in advance
Oh yeah. I am using Tomcat
[ June 04, 2002: Message edited by: Caveman Thomas ]
 
Dave Thomas
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In case anyone is interested I found the problem.
I changed my DTD to this:
<?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">
and removed <description> and <display-name> tags.
Also, the listener tags must come before the servlet tags.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic