tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Steffan <>
Subject Bug with contextInitialized using otherServletContext.getContext ?
Date Sat, 13 Nov 2004 16:41:41 GMT
Hallo tomcat developers,

we are using Vignette Application Portal v7.1 on tomcat 4.1.27, and we
are encountering a problem using a ServletContext to obtain a reference
to another one.

The whole story goes as follows:

The portal (which is a web-application) is configured in server.xml to
make sure it gets started before the portlet-application. Both
applications have crossContext set to true. The portlet application uses
a ServletContextListener (provided by Vignette) to register with the
portal (which also is a web-application). In contextInitialized(), this
ServletContextListener uses the portals ServletContext object invoking
getContext("/portlet-app-context") to obtain a reference to the
portlet-applications ServletContext. This call sometimes (seems to
depend on timing) returns null and makes application unavailable.
Obtaining the ServletContext from the event on the other hand always
returns the expected object.

The spec says that getContext() may return null if the context does not
exist or the container wishes to restrict access and
contextInitialized() is called when the web-application is ready to
process requests.

The spec and its reference implementation don't seem to make a good
match here.

Is it a bug in tomcat that this call returns null ?

We are very late on a project and need to get out fast. I see three
possibilities here:

1. Use tomcat 5.0 if it is a bug in tomcat 4.1 (assuming v5.0 has
diffrent behaviour and Vignette will support it)

2. Fix tomcat 4.1

3. Move initialization to a Servlets init method (assuming that would
make getContext not return null)

What would you suggest ?

Andreas Steffan

T: +49.40.80 81 69-634
F: +49.40.80 81 69-808

SinnerSchrader Neue Informatik	
 >> Software. Design. Interfaces.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message