Return-Path: Delivered-To: apmail-camel-dev-archive@www.apache.org Received: (qmail 51928 invoked from network); 17 Nov 2010 17:55:16 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 17 Nov 2010 17:55:16 -0000 Received: (qmail 68891 invoked by uid 500); 17 Nov 2010 17:55:47 -0000 Delivered-To: apmail-camel-dev-archive@camel.apache.org Received: (qmail 68773 invoked by uid 500); 17 Nov 2010 17:55:46 -0000 Mailing-List: contact dev-help@camel.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@camel.apache.org Delivered-To: mailing list dev@camel.apache.org Received: (qmail 68765 invoked by uid 500); 17 Nov 2010 17:55:46 -0000 Delivered-To: apmail-activemq-camel-dev@activemq.apache.org Received: (qmail 68762 invoked by uid 99); 17 Nov 2010 17:55:46 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Nov 2010 17:55:46 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.22] (HELO thor.apache.org) (140.211.11.22) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 17 Nov 2010 17:55:45 +0000 Received: from thor (localhost [127.0.0.1]) by thor.apache.org (8.13.8+Sun/8.13.8) with ESMTP id oAHHtPfZ003726 for ; Wed, 17 Nov 2010 17:55:25 GMT Message-ID: <6311762.7161290016525380.JavaMail.jira@thor> Date: Wed, 17 Nov 2010 12:55:25 -0500 (EST) From: "Claus Ibsen (JIRA)" To: camel-dev@activemq.apache.org Subject: [jira] Commented: (CAMEL-3341) ProxyHelper and JMS component - need to start producer or fails with NPE In-Reply-To: <4536888.6981289995404669.JavaMail.jira@thor> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: ae95407df07c98740808b2ef9da0087c [ https://issues.apache.org/activemq/browse/CAMEL-3341?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=63384#action_63384 ] Claus Ibsen commented on CAMEL-3341: ------------------------------------ Thanks for reporting and well spotted. Yes the producer needs to be started beforehand. The patch looks good. However we can use ServiceHelper.startService to have it log the event that this service/producer is being started. > ProxyHelper and JMS component - need to start producer or fails with NPE > ------------------------------------------------------------------------ > > Key: CAMEL-3341 > URL: https://issues.apache.org/activemq/browse/CAMEL-3341 > Project: Apache Camel > Issue Type: Bug > Components: camel-core, camel-jms > Affects Versions: 2.5.0 > Environment: linux (debian) 2.6, maven 2.2.1, pax-exam 1.2.2 (using latest felix and equinox) > Reporter: Caspar MacRae > Attachments: ProxyHelper.diff > > > I've a very simple unit test (based on http://camel.apache.org/using-camelproxy.html) that works fine when using endpoint uri "direct:start" but fails with the following exception when using "activemq:somequeue" > java.lang.NullPointerException > at org.apache.camel.component.jms.JmsProducer.processInOut(JmsProducer.java:140) > at org.apache.camel.component.jms.JmsProducer.process(JmsProducer.java:90) > at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91) > at org.apache.camel.impl.DefaultAsyncProducer.process(DefaultAsyncProducer.java:37) > at org.apache.camel.component.bean.CamelInvocationHandler.invoke(CamelInvocationHandler.java:65) > at $Proxy7.sayWordTo(Unknown Source) > at net.earcam.cdosgi.remoteserviceadmin.CamelProxyTest.simpleArgTest(CamelProxyTest.java:93) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44) > at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) > at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41) > at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20) > at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76) > at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50) > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193) > at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52) > at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191) > at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42) > at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184) > at org.junit.runners.ParentRunner.run(ParentRunner.java:236) > at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49) > at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) > at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197) > Looks like the problem is simply that the producer isn't started so never creates a UuidGenerator (needed for the JMS Reply-To) > org.apache.camel.component.bean.ProxyHelper - lines 45 - 51, needs to start producer (for JmsProducer) > /** > * Creates a Proxy which sends PojoExchange to the endpoint. > */ > @SuppressWarnings("unchecked") > public static T createProxy(Endpoint endpoint, ClassLoader cl, Class[] interfaces, MethodInfoCache methodCache) throws Exception { > return (T) createProxyObject(endpoint, endpoint.createProducer(), cl, interfaces, methodCache); > } > As a workaround, simply create the producer, start it and use the overloaded method createProxy that takes a producer parameter. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.