You just need to start the ProducerTemplate, you don't need to start the camel context as it is already started. Can you check the camel log to see if there is any information shows what's the cause exception?
-- Willem Jiang Red Hat, Inc. FuseSource is now part of Red Hat Web: http://www.fusesource.com | http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Thursday, January 10, 2013 at 10:43 PM, Zemin Hu wrote: > I added a line: > template.start() > before sending request, it did not help, got same exception. I changed to > context.start() it did not work either. > The code is within bean implementation, so context is build-in variable, and > started already, why do I need to start it again? From other example code, > the pattern to use it should be simple as 2 lines: > > def template = context.createProducerTemplate() > def response = template.requestBodyAndHeaders(endpointUri, xbody, xheaders, > java.lang.String.class) > > Can someone post working code to use producerTemplate to POST request? > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/recipientList-with-POST-and-request-body-tp5725142p5725283.html > Sent from the Camel - Users mailing list archive at Nabble.com > (http://Nabble.com).
