[ 
https://issues.apache.org/jira/browse/ARTEMIS-5253?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Clebert Suconic closed ARTEMIS-5253.
------------------------------------

> ActiveMQRAConnectionFactoryImpl fails to implement getReference()
> -----------------------------------------------------------------
>
>                 Key: ARTEMIS-5253
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5253
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 2.39.0
>         Environment: Quarkus 3.17.7 with quarkus-artemis-jms-ra 3.3.0
>            Reporter: Vincent Sevel
>            Assignee: Justin Bertram
>            Priority: Minor
>              Labels: pull-request-available
>             Fix For: 2.41.0
>
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> ActiveMQRAConnectionFactoryImpl fails when being called on getReference():
>  * it returns null
>  * it displays an error message in the log
> this issue was discussed originally in 
> [https://camel.zulipchat.com/#narrow/channel/257302-camel-quarkus/topic/camel.20artemis.20with.20jca.20connector/near/494854318]
> this is brining some noise into the camel app initialization.
> to reproduce :
>  * create a new quarkus application: quarkus create app myapp
>  * add extension quarkus-artemis-jms-ra
>  * add imported boms as described in 
> [https://docs.quarkiverse.io/quarkus-artemis/dev/quarkus-artemis-ra.html#_installation]
>  
>  *  add the following properties: 
> {noformat}
> quarkus.ironjacamar.ra.kind=artemis
> quarkus.ironjacamar.ra.config.connection-parameters=host=localhost;port=5445;protocols=CORE
> quarkus.ironjacamar.ra.config.user=guest
> quarkus.ironjacamar.ra.config.password=guest
> quarkus.ironjacamar.ra.config.client-id=Quarkus
> quarkus.ironjacamar.activation-spec.myqueue.config.destination-type=jakarta.jms.Queue
> quarkus.ironjacamar.activation-spec.myqueue.config.destination=jms.queue.MyQueue
> quarkus.ironjacamar.activation-spec.myqueue.config.max-session=2
> quarkus.ironjacamar.activation-spec.myqueue.config.rebalance-connections=true{noformat}
> in the {{GreetingResource}} add the following code:
> {code:java}
> @Inject
> @Identifier(Defaults.DEFAULT_RESOURCE_ADAPTER_NAME
> ConnectionFactory factory;
> ...
> @GET
> @Path("/ref")
> @Produces(MediaType.TEXT_PLAIN)
> public String ref()
>  return "ref=" + 
> ((ActiveMQRAConnectionFactoryImpl)factory).getReference();{code}
> start the application with: {{mvn quarkus:dev}}
> try calling the endpoint: {{curl localhost:8080/hello/cf}}
> this will return {{ref=null}}, instead of a {{Reference}} object
> and the app log will show:
> {noformat}
> 2025-01-20 17:29:44,978 ERROR 
> [org.apache.activemq.artemis.ra.ActiveMQRALogger] (executor-thread-2) 
> AMQ154000: Error while creating object Reference.
> Exception in JMSResource.java:110
>       108      @Produces(MediaType.TEXT_PLAIN)
>       109      public String ref() {
>     → 110          return "ref=" + 
> ((ActiveMQRAConnectionFactoryImpl)factory).getReference();
>       111      }
>       112  }
> javax.naming.NamingException: Failed to serialize 
> object:org.apache.activemq.artemis.ra.ActiveMQRAConnectionFactoryImpl@433756ed,
>  org.jboss.jca.core.connectionmanager.ccm.CachedConnectionManagerImpl
>     at 
> org.apache.activemq.artemis.ra.referenceable.SerializableObjectRefAddr.<init>(SerializableObjectRefAddr.java:55)
>     at 
> org.apache.activemq.artemis.ra.ActiveMQRAConnectionFactoryImpl.getReference(ActiveMQRAConnectionFactoryImpl.java:116)
>     at com.x.myproduct.myapp.JMSResource.cf(JMSResource.java:110)
>     at 
> com.x.myproduct.myapp.JMSResource$quarkusrestinvoker$cf_61dff51ba123117b58ae69dd90953cc4e317284f.invoke(Unknown
>  Source)
>     at 
> org.jboss.resteasy.reactive.server.handlers.InvocationHandler.handle(InvocationHandler.java:29)
>     at 
> io.quarkus.resteasy.reactive.server.runtime.QuarkusResteasyReactiveRequestContext.invokeHandler(QuarkusResteasyReactiveRequestContext.java:141)
>     at 
> org.jboss.resteasy.reactive.common.core.AbstractResteasyReactiveContext.run(AbstractResteasyReactiveContext.java:147)
>     at 
> io.quarkus.vertx.core.runtime.VertxCoreRecorder$15.runWith(VertxCoreRecorder.java:637)
>     at 
> org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
>     at 
> org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
>     at 
> org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1591)
>     at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
>     at 
> org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
>     at 
> io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
>     at java.base/java.lang.Thread.run(Thread.java:1583){noformat}
> this should create a valid naming reference.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to