You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Justin Bertram (Jira)" <ji...@apache.org> on 2022/05/19 21:18:00 UTC
[jira] [Comment Edited] (ARTEMIS-3841) createConnectorService ClassCastException
[ https://issues.apache.org/jira/browse/ARTEMIS-3841?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17539803#comment-17539803 ]
Justin Bertram edited comment on ARTEMIS-3841 at 5/19/22 9:17 PM:
------------------------------------------------------------------
I don't believe this is a bug. You appear to by trying to create a connector _service_, but you're specifying the configuration for a _connector_. These are two different things. The broker doesn't currently support creating connectors via management.
If you have additional questions or concerns about this matter I recommend you send an email to the[ ActiveMQ users mailing list|https://activemq.apache.org/contact].
was (Author: jbertram):
I don't believe this is a bug. You appear to by trying to create a connector _service_, but you're specifying the configuration for a _connector_. These are two different things. The broker doesn't currently support creating connectors via management.
> createConnectorService ClassCastException
> -----------------------------------------
>
> Key: ARTEMIS-3841
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3841
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: Configuration, JMX, Web Console
> Affects Versions: 2.20.0, 2.22.0
> Environment: {{Linux xxxxx 5.17.6-1-MANJARO #1 SMP PREEMPT Mon May 9 07:52:43 UTC 2022 x86_64 GNU/L}}
> {{openjdk 11.0.14 2022-01-18}}
> {{OpenJDK Runtime Environment GraalVM CE 22.0.0.2 (build 11.0.14+9-jvmci-22.0-b05)}}
> {{OpenJDK 64-Bit Server VM GraalVM CE 22.0.0.2 (build 11.0.14+9-jvmci-22.0-b05, mixed mode, sharing)}}
> {{{}{}}}{{{}Apache ActiveMQ Artemis 2.22.0{}}}
> {{ActiveMQ Artemis home: /home/hartmut/Programme/activemq-0}}
> {{ActiveMQ Artemis instance: /home/hartmut/Programme/activemq-0/broker-0}}
> Reporter: Hartmut Horrer
> Priority: Major
> Attachments: Screenshot 2022-05-19 160154.png
>
>
> h1. Problem with the createConnectorService() call via WebConsole or REST - Jolokia
> h2. Versions, we tested
> - Artemis 2.20.0, 2.22.0
> - Java 11
>
> h2. The Problem
>
> {quote}
> Caused by: org.jolokia.client.exception.J4pRemoteException: java.lang.ClassCastException : class org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory cannot be cast to class org.apache.activemq.artemis.core.server.ConnectorServiceFactory (org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory and org.apache.activemq.artemis.core.server.ConnectorServiceFactory are in unnamed module of loader java.net.URLClassLoader @4e9ba398)
> at org.jolokia.client.request.ValidatingResponseExtractor.extract(ValidatingResponseExtractor.java:63)
> at org.jolokia.client.J4pClient.execute(J4pClient.java:195)
> at org.jolokia.client.J4pClient.execute(J4pClient.java:168)
> at org.jolokia.client.J4pClient.execute(J4pClient.java:117)
> at de.wilken.p5.fw.communication.impl.messaging.management.JolokiaManagementBean.execute(JolokiaManagementBean.java:577)
> ... 73 more
> `
> {quote}
> *java.lang.ClassCastException :*
> class *org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory* cannot be cast to
> class *org.apache.activemq.artemis.core.server.ConnectorServiceFactory*
> org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory and
> org.apache.activemq.artemis.core.server.ConnectorServiceFactory are in unnamed module of loader java.net.URLClassLoader @4e9ba398)
>
> h2. Analysis
> After a look in the Artemis source code we come to the following conclusion:
> * {{org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory}}
> ** implements
> *** {{org.apache.activemq.artemis.spi.core.remoting.ConnectorFactory}}
> ** and not
> *** {{org.apache.activemq.artemis.core.server.ConnectorServiceFactory}}
> ** ConnectorService which is created by the ConnectorServiceFactory is deprecated!
> *** is there an alternative way to add a connector via REST Jolokia API?
>
> h2. Example (how it should work (,as I understand))
> from Web Console:
> {{createConnectorService(java.lang.String, java.lang.String, java.util.Map)}}
> # test-connector
> # org.apache.activemq.artemis.core.remoting.impl.netty.NettyConnectorFactory
> # {"host": "127.0.0.1", "port": 61616}
>
--
This message was sent by Atlassian Jira
(v8.20.7#820007)