File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes ServletContextListener Deployment Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "ServletContextListener Deployment" Watch "ServletContextListener Deployment" New topic

ServletContextListener Deployment

Dave Thomas
Ranch Hand

Joined: Nov 05, 2001
Posts: 30
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:
Any ideas?
Thanks in advance
Oh yeah. I am using Tomcat
[ June 04, 2002: Message edited by: Caveman Thomas ]
Dave Thomas
Ranch Hand

Joined: Nov 05, 2001
Posts: 30
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"
and removed <description> and <display-name> tags.
Also, the listener tags must come before the servlet tags.
I agree. Here's the link:
subject: ServletContextListener Deployment
It's not a secret anymore!