Syed, if you post your actual code and config we will likely see some misuse or misconfiguration. Its not typical to create threads in a web application, especially not for every request. And it's not typical to start/stop the producer or the camel context for each request.
Taariq On Mon, Jul 29, 2013 at 7:41 AM, SyedBhai <[email protected]>wrote: > Hello everyone. > Please. Try to understand my problem. > Lets forget about web application or standalone application or tomcat. > > The problem is very simple. I have a WSDL based webservice. I want to > invoke this service using Camel and get the results. > > The code for doing this is here. > > public class Run { > > public static void main(String str[]) { > try { > CamelContext cc = new DefaultCamelContext(); > cc.addRoutes(new RouteBuilder() { > public void configure() { > from("direct:start1"). > > to("cxf:// > http://localhost:8080/JAXWS1/MyInterfaceImpl?serviceClass=com.syed.MyInterface&serviceName={http://syed.com/}MyInterfaceImplService&portName={http://syed.com/}MyInterfaceImplPort > "); > } > }); > > cc.start(); > ProducerTemplate t = cc.createProducerTemplate(); > int annsal = t.requestBody("direct:start1", 10000, > Integer.class); > System.out.println("annsal:" + annsal); > t.stop(); > cc.stop(); > } catch (Exception i) { > i.printStackTrace(); > } > } > } > > When I run the above program I am able to get the results. But the > program is still running. Even though I shutdown template first followed > by > context the program is still running. > > I wanted to print the list of threads that are running. The list of > threads is available in my first message. > > With this I concluded there is a bug in camel. Camel is creating some > threads and not stopping them. Or the bug could be with utilities used by > camel such as CXF, etc. > > I have similar piece of code in my web application. Because the > standalone program is not terminating my thread in web application is also > not terminating. > > Can you guys just help me how to gracefully shut down the camel in the > above piece of code. > > Please do not suggest System.exit(). That will not help me. > > Thanks, > Syed. > > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Is-it-Camel-Bug-tp5736288p5736391.html > Sent from the Camel - Users mailing list archive at Nabble.com. >
