Nirmal
Did some digging and the NPE is due to the fact that we are invoking a default
constructor for whatever connection factory class is provided (i.e.,
‘org.exolab.jms.client.JmsConnectionFactory’). And that works for most major
JMS providers, however for OpenJMS after looking at the code it is rather clear
that the default constructor that is exposed was not exposed to be actually
used by the developers but rather internal serialization use.
/**
* Default constructor required for serialization
*/
public JmsConnectionFactory() {
}
Not sure why it was done this way . . ., but the NPE is due to the fact that
the server proxy class is null so when it attempts to do
Class.forName(proxyClassName) in getProxy() method it fails with NPE.
One other thing I noticed is that all OpenJMS examples are based on obtaining
ConnectionFactory from JNDI for which we currently do not have support.
Once again, please raise the JIRA if you believe that it’s important to add
such feature.
Cheers
Oleg
On Nov 1, 2016, at 9:29 AM, Oleg Zhurakousky
<[email protected]<mailto:[email protected]>> wrote:
Nirmal
While ConsumeJMS was developed and tested with the idea of supporting multiple
providers, ‘openjms’ was not the one that it was tested with.
I will look at the error and will follow up, but the fact that it already shows
NPE means we have a bug somewhere, so please raise the JIRA
(https://issues.apache.org/jira/browse/NIFI) if you don’t mind or let m know
and I’ll do it.
Thank you for reporting it.
Cheers
Oleg
On Nov 1, 2016, at 8:35 AM, Nirmal Kumar
<[email protected]<mailto:[email protected]>> wrote:
Hi All,
I am trying to read messages from openjms-0.7.7 using the ConsumeJMS Processor
but getting following exception:
2016-11-01 14:43:17,260 ERROR [Timer-Driven Process Thread-4]
o.apache.nifi.jms.processors.ConsumeJMS ConsumeJMS -
JMSConsumer[destination:queue1; pub-sub:false;] ConsumeJMS -
JMSConsumer[destination:queue1; pub-sub:false;] failed to process session due
to org.springframework.jms.UncategorizedJmsException: Uncategorized exception
occured during JMS processing; nested exception is javax.jms.JMSException:
Failed to create proxy: java.lang.NullPointerException:
org.springframework.jms.UncategorizedJmsException: Uncategorized exception
occured during JMS processing; nested exception is javax.jms.JMSException:
Failed to create proxy: java.lang.NullPointerException
2016-11-01 14:43:17,265 ERROR [Timer-Driven Process Thread-4]
o.apache.nifi.jms.processors.ConsumeJMS
org.springframework.jms.UncategorizedJmsException: Uncategorized exception
occured during JMS processing; nested exception is javax.jms.JMSException:
Failed to create proxy: java.lang.NullPointerException
at
org.springframework.jms.support.JmsUtils.convertJmsAccessException(JmsUtils.java:316)
~[na:na]
at
org.springframework.jms.support.JmsAccessor.convertJmsAccessException(JmsAccessor.java:169)
~[na:na]
at
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:497) ~[na:na]
at
org.springframework.jms.core.JmsTemplate.receiveSelected(JmsTemplate.java:764)
~[na:na]
at
org.springframework.jms.core.JmsTemplate.receive(JmsTemplate.java:738) ~[na:na]
at
org.springframework.jms.core.JmsTemplate.receive(JmsTemplate.java:727) ~[na:na]
at
org.apache.nifi.jms.processors.JMSConsumer.consume(JMSConsumer.java:65) ~[na:na]
at
org.apache.nifi.jms.processors.ConsumeJMS.rendezvousWithJms(ConsumeJMS.java:79)
~[na:na]
at
org.apache.nifi.jms.processors.AbstractJMSProcessor.onTrigger(AbstractJMSProcessor.java:136)
~[na:na]
at
org.apache.nifi.jms.processors.ConsumeJMS.onTrigger(ConsumeJMS.java:50) ~[na:na]
at
org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)
~[nifi-api-1.0.0.jar:1.0.0]
at
org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1064)
~[nifi-framework-core-1.0.0.jar:1.0.0]
at
org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:136)
[nifi-framework-core-1.0.0.jar:1.0.0]
at
org.apache.nifi.controller.tasks.ContinuallyRunProcessorTask.call(ContinuallyRunProcessorTask.java:47)
[nifi-framework-core-1.0.0.jar:1.0.0]
at
org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:132)
[nifi-framework-core-1.0.0.jar:1.0.0]
at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[na:1.8.0_45]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
[na:1.8.0_45]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
[na:1.8.0_45]
at
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
[na:1.8.0_45]
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
[na:1.8.0_45]
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
[na:1.8.0_45]
at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]
Caused by: javax.jms.JMSException: Failed to create proxy:
java.lang.NullPointerException
at
org.exolab.jms.client.JmsConnectionFactory.getProxy(JmsConnectionFactory.java:169)
~[na:na]
at org.exolab.jms.client.JmsConnection.<init>(JmsConnection.java:174)
~[na:na]
at
org.exolab.jms.client.JmsConnectionFactory.createConnection(JmsConnectionFactory.java:284)
~[na:na]
at
org.exolab.jms.client.JmsConnectionFactory.createConnection(JmsConnectionFactory.java:266)
~[na:na]
at
org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.doCreateConnection(UserCredentialsConnectionFactoryAdapter.java:181)
~[na:na]
at
org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.createConnection(UserCredentialsConnectionFactoryAdapter.java:152)
~[na:na]
at
org.springframework.jms.connection.SingleConnectionFactory.doCreateConnection(SingleConnectionFactory.java:365)
~[na:na]
at
org.springframework.jms.connection.SingleConnectionFactory.initConnection(SingleConnectionFactory.java:305)
~[na:na]
at
org.springframework.jms.connection.SingleConnectionFactory.getConnection(SingleConnectionFactory.java:283)
~[na:na]
at
org.springframework.jms.connection.SingleConnectionFactory.createConnection(SingleConnectionFactory.java:224)
~[na:na]
at
org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:180)
~[na:na]
at
org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:484) ~[na:na]
... 19 common frames omitted
I have configured the JMSConnectionFactoryProvider with the following
properties:
MQ ConnectionFactory Implementation
org.exolab.jms.client.JmsConnectionFactory
Actual
MQ Client Libraries path (i.e., /usr/jms/lib)
/user/nirmal/OpenJMS/openjms-0.7.7/lib
The lib directory for OpenJMS
I also tried org.exolab.jms.client.JmsXAConnectionFactory in the above #1
property but again the same exception logs.
Not sure if somebody tested the ConsumeJMS / PublishJMS processors with OpenJMS?
Thanks,
-Nirmal
________________________________
NOTE: This message may contain information that is confidential, proprietary,
privileged or otherwise protected by law. The message is intended solely for
the named addressee. If received in error, please destroy and notify the
sender. Any use of this email is prohibited when received in error. Impetus
does not represent, warrant and/or guarantee, that the integrity of this
communication has been maintained nor that the communication is free of errors,
virus, interception or interference.