camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Stiles (JIRA)" <>
Subject [jira] Created: (CAMEL-2942) CamelHttpTransportServlet.destroy causes java.lang.IllegalArgumentException: Cannot find the deployed servlet
Date Tue, 13 Jul 2010 17:18:51 GMT
CamelHttpTransportServlet.destroy causes java.lang.IllegalArgumentException: Cannot find the
deployed servlet

                 Key: CAMEL-2942
             Project: Apache Camel
          Issue Type: Bug
          Components: camel-servlet
    Affects Versions: 2.3.0
            Reporter: Brian Stiles

CamelHttpTransportServlet.destroy removes the servlet from a static map named CAMEL_SERVLET_MAP
prior to stopping its associated Spring application context.  If that context defines a route
using a servletEndpoint, the route is shutdown AFTER the servlet is removed from the map.
 The shutdown code then looks for the servlet in the map by calling CamelHttpTransportServlet.getCamelServlet.
 The servlet can't be found, and the ensuing exception is logged (copied below).

It seems to me that CamelHttpTransportServlet.destroy should be defined like this:
    public void destroy() {
        // Removal was here
        if (applicationContext != null) {
        // Moved the removal to here

so that the servlet is removed from the map after the context is stopped.

I know for sure that removal of the servlet from the map before the context is stopped causes
this problem when my route is shutdown.  I DON'T know for sure that my overall configuration
is correct, though I think it is valid.

If the above change is not obviously correct, or if there are further questions, please let
me know, and I'll work up a sample that demonstrates the problem to help answer any questions.


2010-07-13 09:06:23,918 [Camel Thread 0 - ShutdownTask] WARN  org.apache.camel.impl.DefaultShutdownStrategy
at org.apache.camel.impl.DefaultShutdownStrategy.shutdownNow(
         Error occurred while shutting down route: Consumer[/relay]. This exception will be
java.lang.IllegalArgumentException: Cannot find the deployed servlet, please configure the
ServletComponent or configure a org.apache.camel.component.servlet.CamelHttpTransportServlet
servlet in web.xml 
	at org.apache.camel.component.servlet.ServletComponent.getCamelServlet(
	at org.apache.camel.component.servlet.ServletComponent.disconnect(
	at org.apache.camel.component.http.HttpEndpoint.disconnect(
	at org.apache.camel.component.http.HttpConsumer.doStop(
	at org.apache.camel.impl.ServiceSupport.stop(
	at org.apache.camel.impl.ServiceSupport.stop(
	at org.apache.camel.util.ServiceHelper.stopService(
	at org.apache.camel.impl.DefaultShutdownStrategy.shutdownNow(
	at org.apache.camel.impl.DefaultShutdownStrategy$
	at java.util.concurrent.Executors$
	at java.util.concurrent.FutureTask$Sync.innerRun(
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
	at java.util.concurrent.ThreadPoolExecutor$

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message