Index: web/web-core/src/main/java/org/apache/catalina/core/StandardContext.java =================================================================== --- web/web-core/src/main/java/org/apache/catalina/core/StandardContext.java (revision 23208) +++ web/web-core/src/main/java/org/apache/catalina/core/StandardContext.java (working copy) @@ -4567,16 +4567,8 @@ Object results[] = new Object[listeners.length]; boolean ok = true; for (int i = 0; i < results.length; i++) { - if (log.isLoggable(Level.FINE)) - log.fine(" Configuring event listener class '" + - listeners[i] + "'"); try { - Class clazz = loader.loadClass(listeners[i]); - results[i] = clazz.newInstance(); - // START PWC 1.2 6310695 - fireContainerEvent(ContainerEvent.AFTER_LISTENER_INSTANTIATED, - results[i]); - // END PWC 1.2 6310695 + results[i] = loadListener(loader, listeners[i]); } catch (Throwable t) { getServletContext().log (sm.getString("standardContext.applicationListener", @@ -4646,6 +4638,33 @@ /** + * Instantiates and returns the listener with the specified classname + * + * @param loader the classloader to use + * @param listenerClassName the fully qualified classname to instantiate + * + * @return the instantiated listener + * + * @throws Exception if the specified classname fails to be loaded or + * instantiated + */ + protected Object loadListener(ClassLoader loader, String listenerClassName) + throws Exception { + if (log.isLoggable(Level.FINE)) { + log.fine(" Configuring event listener class '" + + listenerClassName + "'"); + } + Class clazz = loader.loadClass(listenerClassName); + Object listener = clazz.newInstance(); + // START PWC 1.2 6310695 + fireContainerEvent(ContainerEvent.AFTER_LISTENER_INSTANTIATED, + listener); + // END PWC 1.2 6310695 + return listener; + } + + + /** * Send an application stop event to all interested listeners. * Return true if all events were sent successfully, * or false otherwise. Index: web/war-util/src/main/resources/com/sun/logging/enterprise/system/container/web/LogStrings.properties =================================================================== --- web/war-util/src/main/resources/com/sun/logging/enterprise/system/container/web/LogStrings.properties (revision 23208) +++ web/war-util/src/main/resources/com/sun/logging/enterprise/system/container/web/LogStrings.properties (working copy) @@ -66,6 +66,7 @@ webcontainer.invalidListener=WEB0147: An invalid listener has been defined [{0}]. webcontainer.unableToLoadExtension=WEB0148: Unable to load extension class [{0}] from web module [{1}] webcontainer.defaultWebModuleError=WEB0149: Unable to set default web module [{0}] for virtual server [{1}] +webcontainer.missingmetro=Webservice based application, requires Metro to be installed. Run updatecenter client located in bin folder to install Metro # # com.sun.enterprise.web.SchemaUpdater messages Index: web/web-glue/src/main/java/com/sun/enterprise/web/WebModule.java =================================================================== --- web/web-glue/src/main/java/com/sun/enterprise/web/WebModule.java (revision 23208) +++ web/web-glue/src/main/java/com/sun/enterprise/web/WebModule.java (working copy) @@ -119,6 +119,9 @@ private static final BASE64Encoder gfEncoder = new BASE64Encoder(); private static final BASE64Decoder gfDecoder = new BASE64Decoder(); + private static final String WS_SERVLET_CONTEXT_LISTENER = + "com.sun.xml.ws.transport.http.servlet.WSServletContextListener"; + // ----------------------------------------------------- Instance Variables // Object containing sun-web.xml information @@ -1438,6 +1441,31 @@ /** + * Instantiates and returns the listener with the specified classname + * + * @param loader the classloader to use + * @param listenerClassName the fully qualified classname to instantiate + * + * @return the instantiated listener + * + * @throws Exception if the specified classname fails to be loaded or + * instantiated + */ + @Override + protected Object loadListener(ClassLoader loader, String listenerClassName) + throws Exception { + try { + return super.loadListener(loader, listenerClassName); + } catch (Exception e) { + if (WS_SERVLET_CONTEXT_LISTENER.equals(listenerClassName)) { + logger.log(Level.WARNING, "webcontainer.missingmetro", e); + } + throw e; + } + } + + + /** * Create and configure the session manager for this web application * according to the persistence type specified. *