You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by helander <le...@gmail.com> on 2013/03/04 10:34:12 UTC

Camel contexts not removed when WAR deployed on JBoss AS 7

I have a web application that creates a couple of camel contexts. I was
surprised to see that when I redeployed my application, the camel contexts
created by the "old" application instance was still visible via jconsole
after having redeployed the application (along with the set of contexts
created by the "new" application instance. I was even more surprised when I
found that after having undeployed the application (no instance available on
the server) the camel contexts are still visible via jconsole.

Is this behaviour to be expected, or ....?

Thanks

Lars



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-contexts-not-removed-when-WAR-deployed-on-JBoss-AS-7-tp5728435.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel contexts not removed when WAR deployed on JBoss AS 7

Posted by Lars-Erik Helander <le...@gmail.com>.
Just confirming that stopping the contexts in my bean destructors (@PreDestroy) fixed the problem ;)

Thanks
Lars

Skickat från min iPhone

4 mar 2013 kl. 15:37 skrev helander <le...@gmail.com>:

> I did suspect that, especially sine the contexts disappeared from jconsole
> once i stopped them (using jconsole). I will add proper desctruction code on
> my beans and hopefully the problem will go away.
> 
> Thanks
> 
> Lars
> 
> 
> 
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-contexts-not-removed-when-WAR-deployed-on-JBoss-AS-7-tp5728435p5728461.html
> Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel contexts not removed when WAR deployed on JBoss AS 7

Posted by helander <le...@gmail.com>.
I did suspect that, especially sine the contexts disappeared from jconsole
once i stopped them (using jconsole). I will add proper desctruction code on
my beans and hopefully the problem will go away.

Thanks

Lars



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-contexts-not-removed-when-WAR-deployed-on-JBoss-AS-7-tp5728435p5728461.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel contexts not removed when WAR deployed on JBoss AS 7

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Mar 4, 2013 at 12:48 PM, helander <le...@gmail.com> wrote:
> JBoss AS 7 (version 7.1.1 Final)
>
> I do not use any Spring.
>
> Context#1:
>    Singleton EJB. The bean class extends DefaultCamelContext
>
> Context#2:
>    SessionScoped CDI bean. The bean class extends DefaultCamelContext
>
>
> All deployed by a single WAR.
>

You would need to make sure that the CamelContext is stopped when your
applications is stopped.
eg call the .stop() method on your CamelContext instance.



>
> Thanks
>
> Lars
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-contexts-not-removed-when-WAR-deployed-on-JBoss-AS-7-tp5728435p5728444.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Camel contexts not removed when WAR deployed on JBoss AS 7

Posted by helander <le...@gmail.com>.
JBoss AS 7 (version 7.1.1 Final)

I do not use any Spring.

Context#1:
   Singleton EJB. The bean class extends DefaultCamelContext

Context#2:
   SessionScoped CDI bean. The bean class extends DefaultCamelContext


All deployed by a single WAR.


Thanks

Lars 



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-contexts-not-removed-when-WAR-deployed-on-JBoss-AS-7-tp5728435p5728444.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel contexts not removed when WAR deployed on JBoss AS 7

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Mar 4, 2013 at 10:34 AM, helander <le...@gmail.com> wrote:
> I have a web application that creates a couple of camel contexts. I was
> surprised to see that when I redeployed my application, the camel contexts
> created by the "old" application instance was still visible via jconsole
> after having redeployed the application (along with the set of contexts
> created by the "new" application instance. I was even more surprised when I
> found that after having undeployed the application (no instance available on
> the server) the camel contexts are still visible via jconsole.
>
> Is this behaviour to be expected, or ....?
>

Yes as Camel is so self-aware that it has a built-in defense mehanism
to stay alive ;)

Well of course this is not desired.

What version of JBoss AS do you use?
And how do you deploy Camel? as a WAR or some other way?

And if you use WAR do you use a spring xml file or something as we show here
http://camel.apache.org/tutorial-on-using-camel-in-a-web-application.html



> Thanks
>
> Lars
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-contexts-not-removed-when-WAR-deployed-on-JBoss-AS-7-tp5728435.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
Red Hat, Inc.
FuseSource is now part of Red Hat
Email: cibsen@redhat.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen