[
https://issues.apache.org/jira/browse/NIFI-5741?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16661108#comment-16661108
]
ASF GitHub Bot commented on NIFI-5741:
--------------------------------------
GitHub user markap14 opened a pull request:
https://github.com/apache/nifi/pull/3106
NIFI-5741: When returning a ConnectionFactory from the JndiJmsConnect…
…ionFactoryProvider, ensure that we wrap the ConnectionFactory so that any
calls to the ConnectionFactory happen within the context of the Controller
Service's Class Loader
Thank you for submitting a contribution to Apache NiFi.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
- [ ] Does your PR title start with NIFI-XXXX where XXXX is the JIRA number
you are trying to resolve? Pay particular attention to the hyphen "-" character.
- [ ] Has your PR been rebased against the latest commit within the target
branch (typically master)?
- [ ] Is your initial contribution a single, squashed commit?
### For code changes:
- [ ] Have you ensured that the full suite of tests is executed via mvn
-Pcontrib-check clean install at the root nifi folder?
- [ ] Have you written or updated unit tests to verify your changes?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the LICENSE file, including the main
LICENSE file under nifi-assembly?
- [ ] If applicable, have you updated the NOTICE file, including the main
NOTICE file found under nifi-assembly?
- [ ] If adding new Properties, have you added .displayName in addition to
.name (programmatic access) for each of the new properties?
### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in
which it is rendered?
### Note:
Please ensure that once the PR is submitted, you check travis-ci for build
issues and submit an update to your PR as soon as possible.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/markap14/nifi NIFI-5741
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi/pull/3106.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #3106
----
commit a618a6d1ab3c1aa053c5e67a6aa89485a792bd60
Author: Mark Payne <markap14@...>
Date: 2018-10-23T18:42:32Z
NIFI-5741: When returning a ConnectionFactory from the
JndiJmsConnectionFactoryProvider, ensure that we wrap the ConnectionFactory so
that any calls to the ConnectionFactory happen within the context of the
Controller Service's Class Loader
----
> JndiJmsConnectionFactory does not properly wrap returned ConnectionFactory
> with ClassLoader-specific proxy
> ----------------------------------------------------------------------------------------------------------
>
> Key: NIFI-5741
> URL: https://issues.apache.org/jira/browse/NIFI-5741
> Project: Apache NiFi
> Issue Type: Bug
> Components: Extensions
> Affects Versions: 1.8.0
> Reporter: Mark Payne
> Assignee: Mark Payne
> Priority: Major
>
> The JndiJmsConnectionFactory controller service looks up a JMS Connection
> Factory via JNDI. It then returns this Connection Factory to be used by the
> JMS Processors. While the JMS Processors live in the same NAR, the instance
> of the JMS Processor will live have a different NAR Context Class Loader if
> the JNDI JMS Connection Factory is configured with classes that modify its
> class path.
> As a result, the JMS Processors can have the wrong class path when calling
> ConnectionFactory#createConnection, which can cause some very odd behavior.
> When attempting to connect to WebLogic, for instance, I got the following
> stack trace:
> {{2018-10-23 11:53:53,803 ERROR [Timer-Driven Process Thread-6]
> o.apache.nifi.jms.processors.PublishJMS
> PublishJMS[id=a191db80-0166-1000-77ff-aaaf7616fcb1] Failed while sending
> message to JMS via JMSPublisher[destination:null; pub-sub:true;]:
> org.springframework.jms.UncategorizedJmsException: Uncategorized exception
> occurred during JMS processing; nested exception is
> weblogic.jms.common.JMSException: [JMSClientExceptions:055053]Error creating
> connection to the server: java.rmi.UnmarshalException: failed to unmarshal
> class weblogic.jms.client.JMSConnection; nested exception is:}}
> {{ java.io.UTFDataFormatException.}}
> {{java.rmi.UnmarshalException: failed to unmarshal class
> weblogic.jms.client.JMSConnection; nested exception is:}}
> {{ java.io.UTFDataFormatException}}
> {{ at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:266)}}
> {{ at
> weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:477)}}
> {{ at
> weblogic.rmi.cluster.ClusterableRemoteRef.invoke(ClusterableRemoteRef.java:285)}}
> {{ at
> weblogic.jms.frontend.FEConnectionFactoryImpl_12213_WLStub.connectionCreate(Unknown
> Source)}}
> {{ at
> weblogic.jms.client.JMSConnectionFactory.setupJMSConnection(JMSConnectionFactory.java:269)}}
> {{ at
> weblogic.jms.client.JMSConnectionFactory.createConnectionInternal(JMSConnectionFactory.java:359)}}
> {{ at
> weblogic.jms.client.JMSConnectionFactory.createConnection(JMSConnectionFactory.java:210)}}
> {{ at
> org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.doCreateConnection(UserCredentialsConnectionFactoryAdapter.java:181)}}
> {{ at
> org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter.createConnection(UserCredentialsConnectionFactoryAdapter.java:152)}}
> {{ at
> org.springframework.jms.connection.SingleConnectionFactory.doCreateConnection(SingleConnectionFactory.java:366)}}
> {{ at
> org.springframework.jms.connection.SingleConnectionFactory.initConnection(SingleConnectionFactory.java:306)}}
> {{ at
> org.springframework.jms.connection.SingleConnectionFactory.getConnection(SingleConnectionFactory.java:284)}}
> {{ at
> org.springframework.jms.connection.SingleConnectionFactory.createConnection(SingleConnectionFactory.java:225)}}
> {{ at
> org.springframework.jms.support.JmsAccessor.createConnection(JmsAccessor.java:180)}}
> {{ at org.springframework.jms.core.JmsTemplate.execute(JmsTemplate.java:474)}}
> {{ at org.springframework.jms.core.JmsTemplate.send(JmsTemplate.java:570)}}
> {{ at
> org.apache.nifi.jms.processors.JMSPublisher.publish(JMSPublisher.java:56)}}
> {{ at
> org.apache.nifi.jms.processors.PublishJMS.rendezvousWithJms(PublishJMS.java:131)}}
> {{ at
> org.apache.nifi.jms.processors.PublishJMS.rendezvousWithJms(PublishJMS.java:60)}}
> {{ at
> org.apache.nifi.jms.processors.AbstractJMSProcessor.onTrigger(AbstractJMSProcessor.java:159)}}
> {{ at
> org.apache.nifi.jms.processors.PublishJMS.onTrigger(PublishJMS.java:60)}}
> {{ at
> org.apache.nifi.processor.AbstractProcessor.onTrigger(AbstractProcessor.java:27)}}
> {{ at
> org.apache.nifi.controller.StandardProcessorNode.onTrigger(StandardProcessorNode.java:1165)}}
> {{ at
> org.apache.nifi.controller.tasks.ConnectableTask.invoke(ConnectableTask.java:203)}}
> {{ at
> org.apache.nifi.controller.scheduling.TimerDrivenSchedulingAgent$1.run(TimerDrivenSchedulingAgent.java:117)}}
> {{ at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)}}
> {{ at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)}}
> {{ at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)}}
> {{ at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)}}
> {{ at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)}}
> {{ at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)}}
> {{ at java.lang.Thread.run(Thread.java:745)}}
> {{Caused by: java.io.UTFDataFormatException}}
> {{ at
> java.io.ObjectInputStream$BlockDataInputStream.readUTFSpan(ObjectInputStream.java:3137)}}
> {{ at
> java.io.ObjectInputStream$BlockDataInputStream.readUTFBody(ObjectInputStream.java:3062)}}
> {{ at
> java.io.ObjectInputStream$BlockDataInputStream.readUTF(ObjectInputStream.java:2874)}}
> {{ at java.io.ObjectInputStream.readUTF(ObjectInputStream.java:1073)}}
> {{ at
> weblogic.messaging.dispatcher.DispatcherUtils.readVersionedPartitionInfo(DispatcherUtils.java:185)}}
> {{ at
> weblogic.messaging.dispatcher.DispatcherWrapper.readExternal(DispatcherWrapper.java:236)}}
> {{ at
> weblogic.jms.client.JMSConnection.readExternal(JMSConnection.java:2481)}}
> {{ at
> java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1842)}}
> {{ at
> java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1799)}}
> {{ at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1351)}}
> {{ at java.io.ObjectInputStream.readObject(ObjectInputStream.java:371)}}
> {{ at
> weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:208)}}
> {{ at
> weblogic.rjvm.MsgAbbrevInputStream.readObject(MsgAbbrevInputStream.java:602)}}
> {{ at
> weblogic.utils.io.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:204)}}
> {{ at weblogic.rmi.internal.ObjectIO.readObject(ObjectIO.java:62)}}
> {{ at weblogic.rjvm.ResponseImpl.unmarshalReturn(ResponseImpl.java:264)}}
> {{ ... 31 more}}
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)