Apache camel 内未收到OUT消息

Apache camel 内未收到OUT消息,apache-camel,Apache Camel,我正在试用与ApacheCamel捆绑的JMS示例 ApplicationContext context = new ClassPathXmlApplicationContext("camel-config.xml"); producer) ProducerTemplate camelTemplate = context.getBean("camelTemplate", ProducerTemplate.class); System.out.println("Invoking the mul

我正在试用与ApacheCamel捆绑的JMS示例

ApplicationContext context = new ClassPathXmlApplicationContext("camel-config.xml");

producer)
ProducerTemplate camelTemplate = context.getBean("camelTemplate", ProducerTemplate.class);

System.out.println("Invoking the multiply with 22");
int responseData = (Integer)camelTemplate.sendBody("jms:queue:numbers", ExchangePattern.InOut, 22);
System.out.println("... the result is: " + responseData);
这是代码。当我作为一个独立的应用程序运行时,这非常有效

同样的事情,我只是放进一个servlet并试着运行它。我犯了这个错误

内未收到OUT消息这确实是我犯的一个错误

我想删除这个问题。但许多人可能会犯同样的错误

camelTemplate.sendBody("jms:queue:numbers", ExchangePattern.InOut, 22);
问题出在上面这一行。Am将22作为一个整数参数传递,但JSM中的实方法接收一个InputStream作为参数


当我更改它时,问题得到了解决。

示例中的设置有点复杂。请提供有关如何在servlet中设置服务器部件的信息。您看过servlet日志中的错误了吗?尝试启用更多日志详细信息-如果路由启动或不启动,应该非常清楚。()