camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Stiles (JIRA)" <>
Subject [jira] Commented: (CAMEL-2942) CamelHttpTransportServlet.destroy causes java.lang.IllegalArgumentException: Cannot find the deployed servlet
Date Wed, 14 Jul 2010 01:41:52 GMT


Brian Stiles commented on CAMEL-2942:

Fantastic.  Thanks for the quick response!

> CamelHttpTransportServlet.destroy causes java.lang.IllegalArgumentException: Cannot find
the deployed servlet
> -------------------------------------------------------------------------------------------------------------
>                 Key: CAMEL-2942
>                 URL:
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-servlet
>    Affects Versions: 2.3.0
>            Reporter: Brian Stiles
>            Assignee: Willem Jiang
>             Fix For: 2.5.0
> 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) {
>             applicationContext.stop();
>         }
>         // Moved the removal to here
>         CAMEL_SERVLET_MAP.remove(servletName);
>     }
> 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 ignored.
> 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
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(
> 	at java.util.concurrent.ThreadPoolExecutor$
> 	at

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

View raw message