[
https://issues.apache.org/jira/browse/NIFI-13522?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18061119#comment-18061119
]
Daniel Chaffelson commented on NIFI-13522:
------------------------------------------
The ClassCastException in this ticket occurs because
org.apache.activemq.ActiveMQSslConnectionFactory is from Classic ActiveMQ and
implements javax.jms.ConnectionFactory, which is incompatible with NiFi 2.x
(Jakarta JMS).
For ActiveMQ Artemis, the correct connection factory class is:
{code}
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory
{code}
This class is available in the artemis-jakarta-client-all JAR (e.g.
artemis-jakarta-client-all-2.44.0.jar) and implements
jakarta.jms.ConnectionFactory as required by NiFi 2.x.
However, even with the correct class, SSL configuration from NiFi's
SSLContextService was not being applied to Artemis connections. Artemis does
not use bean-style setters for SSL; instead it parses SSL parameters from the
broker URL query string. This has been filed as NIFI-15647 and a fix is
available in [PR #10936|https://github.com/apache/nifi/pull/10936], which
augments the broker URL with the appropriate SSL transport parameters
(sslEnabled, trustStorePath, keyStorePath, etc.) from the configured
SSLContextService.
> ConsumeJMS JMSConnectionFactoryProvider service fails with SSL implementation
> of JMS Connection Factory Implementation Class
> ----------------------------------------------------------------------------------------------------------------------------
>
> Key: NIFI-13522
> URL: https://issues.apache.org/jira/browse/NIFI-13522
> Project: Apache NiFi
> Issue Type: Bug
> Components: Core Framework
> Affects Versions: 2.0.0-M3
> Environment: Linux
> Reporter: Ron Ridgely
> Priority: Major
>
> Error message attempting to run ConsumeJMS with Connection Factory Provider
> service SSL Implementation
> "Failed to configure JMSConnectionFactoryHandler:
> java.lang.classCastException: class
> org.apache.activemq.ActiveMQSslConnectionFactoryProvider cannot be cast to
> class jakarta.jms.ConnectionFactory
> (org.apache.activemq.ActiveMQSslConnectionFactory is in unnamed module of
> loader org.apache.nifi.nar.NarClassLoader)
> This happens when the ConsumeJMS processor is configured with
> ConnectionFactoryService = JMSConnectionFactoryProvider and the JMS
> Connection Factory Implementation Class =
> org.apache.activemq.ActiveMQSslConnectionFactory and the JMS Client Libaries
> = ./apache-artemis/lib
> The artemis distro is apache-artemis-2.32.0
--
This message was sent by Atlassian Jira
(v8.20.10#820010)