[jboss-jira] [JBoss JIRA] (WFLY-3211) java:app resources can not be shared between ejb and appclient modules
Wolfgang Knauf (Jira)
issues at jboss.org
Wed Apr 22 14:05:43 EDT 2020
[ https://issues.redhat.com/browse/WFLY-3211?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14052038#comment-14052038 ]
Wolfgang Knauf edited comment on WFLY-3211 at 4/22/20 2:05 PM:
---------------------------------------------------------------
My original sample is still not working in WildFly 19.
But: I managed to make it functioning - don't know whether my solution/workaround is correct:
a) in "jboss-client.xml" of the ApplicationClient project, use the JNDI name "java:/jms/queue/MessageBeanQueue" instead of "java:app/jms/queue/MessageBeanQueue".
<jboss-client ...>
<jndi-name>MessageClient</jndi-name>
<resource-ref>
<res-ref-name>jms/MBConnectionFactory</res-ref-name>
<!-- <jndi-name>ConnectionFactory</jndi-name> -->
<jndi-name>java:/ConnectionFactory</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>jms/MBQueueRef</res-ref-name>
<jndi-name>java:/jms/queue/MessageBeanQueue</jndi-name>
</resource-ref>
</jboss-client>
b) in "%WILDFLY_HOME%\appclient\configuration\appclient.xml", also declare the Queue and point it to "java:/jms/queue/MessageBeanQueue":
<subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
<server name="default">
...
<jms-queue name="MessageBeanQueue" entries="java:/jms/queue/MessageBeanQueue"/>
<connection-factory name="RemoteConnectionFactory" entries="java:/ConnectionFactory" connectors="http-connector"/>
</server>
</subsystem>
was (Author: wolfgangknauf):
My original sample is still not working in WildFly 19.
But: I managed to make it functioning - don't know whether my solution/workaround is correct:
a) in "jboss-client.xml" of the ApplicationClient project, use the JNDI name "java:/jms/queue/MessageBeanQueue" instead of "java:app/jms/queue/MessageBeanQueue".
{{<jboss-client ...>
<jndi-name>MessageClient</jndi-name>
<resource-ref>
<res-ref-name>jms/MBConnectionFactory</res-ref-name>
<!-- <jndi-name>ConnectionFactory</jndi-name> -->
<jndi-name>java:/ConnectionFactory</jndi-name>
</resource-ref>
<resource-ref>
<res-ref-name>jms/MBQueueRef</res-ref-name>
<jndi-name>java:/jms/queue/MessageBeanQueue</jndi-name>
</resource-ref>
</jboss-client>}}
b) in "%WILDFLY_HOME%\appclient\configuration\appclient.xml", also declare the Queue and point it to "java:/jms/queue/MessageBeanQueue":
{{ <subsystem xmlns="urn:jboss:domain:messaging-activemq:1.0">
<server name="default">
...
<jms-queue name="MessageBeanQueue" entries="java:/jms/queue/MessageBeanQueue"/>
<connection-factory name="RemoteConnectionFactory" entries="java:/ConnectionFactory" connectors="http-connector"/>
</server>
</subsystem>}}
> java:app resources can not be shared between ejb and appclient modules
> ----------------------------------------------------------------------
>
> Key: WFLY-3211
> URL: https://issues.redhat.com/browse/WFLY-3211
> Project: WildFly
> Issue Type: Bug
> Components: Naming
> Affects Versions: 8.0.0.Final, 11.0.0.Final
> Reporter: Jeff Mesnil
> Assignee: Eduardo Martins
> Priority: Major
> Attachments: Sample_WildFly10.zip
>
>
> use case:
> 1 ear composed of:
> 1 appclient module that defines 2 JMS queues (one in java:app, the other in java:global)
> 1 ejb modules with 2 MDBs (one listening to the java:app queue and the other to the java:global queue)
> When the ear is deployed:
> 1. the ejb module is deployed, the MDBs are created and wait for the creations of their respective queues (defined in the appclient module)
> 2. the appclient module is deployed, its 2 queues are deployed
> 3. the appclient main is run
> When the appclient uses the java:global queue, it looks it up, sends the message and the corresponding MDB receives it fine.
> When the appclient uses the java:app queue, it looks it up, sends the message but the corresponding MDB never receives it
> => the MDB was never deployed because it did not see the java:app queue deployed from the appclient module.
> Note that if I move the destination definitions to the ejb module, the MDBs are correctly activated but the appclient module is no longer deployed with errors:
> {noformat}
> [APPCLIENT-out] {"JBAS014771: Services with missing/unavailable dependencies" => [
> [APPCLIENT-out] "jboss.naming.context.java.module.simple-jms-appclient-test.appclient.env.jms.queueInGlobal is missing [jboss.naming.context.java.global.jms.queu
> e.queue1]",
> [APPCLIENT-out] "jboss.naming.context.java.module.simple-jms-appclient-test.appclient.env.jms.queueInApp is missing [jboss.naming.context.java.app.simple-jms-app
> client-test.jms.queue.queue2]"
> [APPCLIENT-out] ]}
> {noformat}
> Steps to reproduce:
> 1. fetch git branch https://github.com/jmesnil/wildfly/tree/jms_appclient
> 2. build WildFly
> 3. run ./integration-tests.sh -Dts.basic -Dtest=org.jboss.as.test.integration.ee.appclient.jms.basic.SimpleJMSApplicationClientTestCase -DnoWebProfile
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list