How to deploy pulsarra.rar in Jboss?

83 Views Asked by At

I'm trying to deploy and configure DataStax Apache Pulsar JMS Client Resource Adapter in JBoss but I'm getting the following error:

2023-08-28 11:21:30,684 INFO  [org.jboss.weld.deployer] (MSC service thread 1-5) WFLYWELD0003: Processing weld deployment pulsarra.rar
2023-08-28 11:21:30,810 INFO  [io.jaegertracing.internal.JaegerTracer] (MSC service thread 1-5) No shutdown hook registered: Please call close() manually on application shutdown.
2023-08-28 11:21:30,848 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 83) WFLYCLINF0002: Started client-mappings cache from ejb container
2023-08-28 11:21:30,991 INFO  [com.datastax.oss.pulsar.jms.rar.PulsarResourceAdapter] (MSC service thread 1-3) setConfiguration {"brokerServiceUrl":"pulsar://localhost:6650","webServiceUrl":"http://localhost:8080"}
2023-08-28 11:21:31,002 INFO  [com.datastax.oss.pulsar.jms.rar.PulsarResourceAdapter] (MSC service thread 1-3) startPulsarConnectionFactory {"brokerServiceUrl":"pulsar://localhost:6650","webServiceUrl":"http://localhost:8080"}
2023-08-28 11:21:31,079 INFO  [io.smallrye.metrics] (MSC service thread 1-4) MicroProfile: Metrics activated
2023-08-28 11:21:31,305 WARN  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-3) IJ020013: Connection factory not bound: com.datastax.oss.pulsar.jms.rar.PulsarManagedConnectionFactory
2023-08-28 11:21:31,306 INFO  [org.jboss.as.connector.deployers.RaXmlDeployer] (MSC service thread 1-3) IJ020015: Connection factory not specification compliant. See 6.5.1.3 for additional details: com.datastax.oss.pulsar.jms.PulsarConnectionFactory
2023-08-28 11:21:31,314 ERROR [org.jboss.msc.service.fail] (ServerService Thread Pool -- 83) MSC000001: Failed to start service jboss.ra.deployment."pulsarra.rar_PulsarRA": org.jboss.msc.service.StartException in service jboss.ra.deployment."pulsarra.rar_PulsarRA": WFLYJCA0046: Failed to start RA deployment [pulsarra.rar]
    at [email protected]//org.jboss.as.connector.services.resourceadapters.deployment.AbstractResourceAdapterDeploymentService$2.run(AbstractResourceAdapterDeploymentService.java:340)
    at [email protected]//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at [email protected]//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
    at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    at java.base/java.lang.Thread.run(Thread.java:829)
    at [email protected]//org.jboss.threads.JBossThread.run(JBossThread.java:485)
Caused by: org.jboss.jca.deployers.common.DeployException: IJ020056: Deployment failed: file:/home/manuel/tools/jboss-eap-7.3/standalone/tmp/vfs/temp/temp7ade9d00bcac3529/content-6b5e2cac829e1ded/contents/
    at [email protected]//org.jboss.jca.deployers.common.AbstractResourceAdapterDeployer.createObjectsAndInjectValue(AbstractResourceAdapterDeployer.java:2058)
    at [email protected]//org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService$WildFlyRaXmlDeployer.doDeploy(ResourceAdapterXmlDeploymentService.java:190)
    at [email protected]//org.jboss.as.connector.services.resourceadapters.deployment.ResourceAdapterXmlDeploymentService.start(ResourceAdapterXmlDeploymentService.java:128)
    at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1739)
    at [email protected]//org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1701)
    at [email protected]//org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1559)
    at [email protected]//org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
    at [email protected]//org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1982)
    at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1486)
    at [email protected]//org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1377)
    at java.base/java.lang.Thread.run(Thread.java:829)
Caused by: org.jboss.jca.validator.ValidatorException: Severity: ERROR
Section: 17.5.1.1
Description: ConnectionFactory must implement javax.resource.Referenceable
Code: com.datastax.oss.pulsar.jms.PulsarConnectionFactory

    ... 11 more


My procedure is:

1-Deploy pulsarra.rar

enter image description here

2-Configure the Resource Adapter (Configuration -> Subsytems -> Resource Adapter -> Add Resource Adapter)

enter image description here

So far no errors.

3-Specify a Connection Definition (Resource Adapter -> PulsarRA -> Connection Definitions -> Add)

enter image description here

Now, when I restart JBoss I get the error shown.

JBoss is expecting a javax.resource.cci.ConnectionFactory but I'm passing a javax.jms.ConnectionFactory.

From the ra.xml:

 <connectionfactory-interface>javax.jms.TopicConnectionFactory</connectionfactory-interface>
 <connectionfactory-impl-class>com.datastax.oss.pulsar.jms.PulsarConnectionFactory</connectionfactory-impl-class>
 <connection-interface>javax.jms.TopicConnection</connection-interface>
 <connection-impl-class>com.datastax.oss.pulsar.jms.PulsarConnection</connection-impl-class>

I don't know what I'm doing wrong.

1

There are 1 best solutions below

0
Marinos An On

Indeed, a validation rule of the Connection Factory Validator of the ironjacmar 1.4.19 jboss submodule (that implements Java EE Connector Architecture 1.7 ), mandates that the provided connection factory implements Referenceable (e.g. by implementing javax.resource.cci.ConnectionFactory).

Though, no class from the pulsar-jms repo seems to implement javax.resource.Referencable or use javax.resource.cci.* anywhere.

I think opening an issue/question to the pulsar-jms issues section regarding the above would be justifiable.

The title could be: "Connection factory not specification compliant. See 6.5.1.3 for additional details: com.datastax.oss.pulsar.jms.PulsarConnectionFactory"

You can note that the referenced section above (from the Jakarta Connectors 1.7) says the following:

A connection factory implementation class must implement the interface javax.resource.Referenceable. Note that the javax.resource.Referenceable interface extends the javax.naming.Referenceable interface. Refer to section Section 20.6.3, “Scenario: Referenceable” on page 20-19 for details on the JNDI reference mechanism.

but the provided connection factory does not implement it, resulting in the exception that you have provided.

I guess they should provide some additional classes for supporting the Connector Architecture spec.