geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Jencks <david_jen...@yahoo.com>
Subject Re: Accessing JMS Resources From J2EE Application Client
Date Tue, 22 Jul 2008 17:29:17 GMT
You are correct that you need to deploy the resource adapter on the  
app client as well as the server.  I think the problem is that your  
external-rar tag is pointing to the server's broker configuration  
rather than the actibvemq rar file in the geronimo repository.

I think there's correct configuration in one of the daytrader app  
clients.

This would make a great subject for a wiki page (I haven't searched  
much, maybe there already is one?)

thanks
david jencks

On Jul 22, 2008, at 2:47 AM, Stella Lok wrote:

> Hi,
>
> I am trying to access a server-scoped JMS TopicConnectionFactory and  
> Topic on Geronimo 2.02, from a J2EE Application Client, but am  
> encountering problems. Here are the steps I took:
>
> 1) Deployed JMS TopicConnectionFactory & Topic in Resource Adapter:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/ 
> connector-1.2">
>     <dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2 
> ">
>         <dep:moduleId>
>             <dep:groupId>console.jms</dep:groupId>
>             <dep:artifactId>topic</dep:artifactId>
>             <dep:version>1.0</dep:version>
>             <dep:type>rar</dep:type>
>         </dep:moduleId>
>         <dep:dependencies>
>             <dep:dependency>
>                 <dep:groupId>org.apache.geronimo.configs</dep:groupId>
>                 <dep:artifactId>activemq-broker</dep:artifactId>
>                 <dep:type>car</dep:type>
>             </dep:dependency>
>         </dep:dependencies>
>     </dep:environment>
>     <resourceadapter>
>         <resourceadapter-instance>
>             <resourceadapter-name>eventTopicResourceAdapter</ 
> resourceadapter-name>
>         <config-property-setting
>         name="ServerUrl">tcp://localhost:61616</config-property- 
> setting>
>         <config-property-setting name="UserName">system</config- 
> property-setting> <config-property-setting          
> name="Password">manager</config-property-setting>
>             <nam:workmanager xmlns:nam="http://geronimo.apache.org/xml/ns/naming-1.2

> ">
>                 <nam:gbean-link>DefaultWorkManager</nam:gbean-link>
>             </nam:workmanager>
>         </resourceadapter-instance>
>         <outbound-resourceadapter>
>             <connection-definition>
>                 <connectionfactory- 
> interface>javax.jms.TopicConnectionFactory</connectionfactory- 
> interface>
>                 <connectiondefinition-instance>
>                     <name>jms/topicConnectionFactory</name>
>                     <connectionmanager>
>                         <xa-transaction>
>                             <transaction-caching/>
>                         </xa-transaction>
>                         <single-pool>
>                             <match-one/>
>                         </single-pool>
>                     </connectionmanager>
>                 </connectiondefinition-instance>
>             </connection-definition>
>         </outbound-resourceadapter>
>     </resourceadapter>
>     <adminobject>
>         <adminobject-interface>javax.jms.Queue</adminobject-interface>
>         <adminobject- 
> class>org.apache.activemq.command.ActiveMQQueue</adminobject-class>
>     </adminobject>
>     <adminobject>
>         <adminobject-interface>javax.jms.Topic</adminobject-interface>
>         <adminobject- 
> class>org.apache.activemq.command.ActiveMQTopic</adminobject-class>
>         <adminobject-instance>
>             <message-destination-name>topic</message-destination-name>
>             <config-property-setting name="PhysicalName">topic</ 
> config-property-setting>
>         </adminobject-instance>
>     </adminobject>
> </connector>
>
> 2) I created a dummy J2EE application client with the following  
> deployment descriptors:
> application.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <application-client version="5" xmlns="http://java.sun.com/xml/ns/javaee 
> " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  
> xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application-client_5.xsd

> ">
>     <resource-ref>
>         <res-ref-name>jms/topicConnectionFactory</res-ref-name>
>         <res-type>javax.jms.TopicConnectionFactory</res-type>
>         <res-auth>Container</res-auth>
>         <res-sharing-scope>Shareable</res-sharing-scope>
>     </resource-ref>
>     <message-destination-ref>
>         <message-destination-ref-name>topic</message-destination-ref- 
> name>
>         <message-destination-type>javax.jms.Topic</message- 
> destination-type>
>         <message-destination-usage>Consumes</message-destination- 
> usage>
>         <message-destination-link>topic</message-destination-link>
>     </message-destination-ref>
>     <message-destination>
>         <message-destination-name>topic</message-destination-name>
>     </message-destination>
> </application-client>
>
> and geronimo-application-client.xml:
> <?xml version="1.0" encoding="UTF-8"?>
>
> <application-client xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-client-2.0

> "
>   xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"
>   xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.2"
>   xmlns:security="http://geronimo.apache.org/xml/ns/security-2.0"
>   xmlns:connector="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2 
> ">
>
>   <dep:client-environment>
>     <dep:moduleId>
>       <dep:groupId>client</dep:groupId>
>       <dep:artifactId>jmsClient</dep:artifactId>
>       <dep:version>1</dep:version>
>       <dep:type>car</dep:type>
>     </dep:moduleId>
>     <dep:dependencies/>
>     <dep:hidden-classes/>
>     <dep:non-overridable-classes/>
>   </dep:client-environment>
>   <dep:server-environment>
>     <dep:moduleId>
>       <dep:groupId>console.jms</dep:groupId>
>       <dep:artifactId>topic</dep:artifactId>
>       <dep:version>1.0</dep:version>
>       <dep:type>rar</dep:type>
>     </dep:moduleId>
>     <dep:dependencies/>
>     <dep:hidden-classes/>
>     <dep:non-overridable-classes/>
>   </dep:server-environment>
>   <resource-ref>
>    <ref-name>jms/topicConnectionFactory</ref-name>
>     <resource-link>jms/topicConnectionFactory</resource-link>
>   </resource-ref>
>   <message-destination>
>     <message-destination-name>topic</message-destination-name>
>     <admin-object-link>topic</admin-object-link>
>   </message-destination>
>   <resource>
>         <external-rar>
>               <dep:groupId>org.apache.geronimo.configs</dep:groupId>
>               <dep:artifactId>activemq-broker</dep:artifactId>
>               <dep:version>2.0.2</dep:version>
>               <dep:type>car</dep:type>
>         </external-rar>
>
>         <connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2 
> ">
>         <resourceadapter>
>             <resourceadapter-instance>
>                 <resourceadapter-name>ActiveMQ RA</resourceadapter- 
> name>
>                 <config-property-setting name="ServerUrl">tcp:// 
> 172.168.29.227:61616</config-property-setting>
>                 <config-property-setting name="UserName">system</ 
> config-property-setting>
>                 <config-property-setting name="Password">manager</ 
> config-property-setting>
>                 <workmanager>
>                     <gbean-link>DefaultWorkManager</gbean-link>
>                 </workmanager>
>                 </resourceadapter-instance>
>                  <outbound-resourceadapter>
>                  <connection-definition>
>                      <connectionfactory- 
> interface>javax.jms.ConnectionFactory</connectionfactory-interface>
>                      <connectiondefinition-instance>
>                      <name>jms/topicConnectionFactory</name>
>                      <implemented- 
> interface>javax.jms.QueueConnectionFactory</implemented-interface>
>                      <implemented- 
> interface>javax.jms.TopicConnectionFactory</implemented-interface>
>                      <connectionmanager>  <xa-transaction>   
> <transaction-caching/>  </xa-transaction>  <single-pool>  <max-

> size>10</max-size>  <blocking-timeout-milliseconds>5000</blocking-

> timeout-milliseconds>  <match-one/>  </single-pool>  </ 
> connectionmanager>  </connectiondefinition-instance>  </connection- 
> definition>  </outbound-resourceadapter>
>
>                  </resourceadapter>
>
> <adminobject>
>     <adminobject-interface>javax.jms.Topic</adminobject-interface>
>     <adminobject-class>org.apache.activemq.command.ActiveMQTopic</ 
> adminobject-class>
>     <adminobject-instance>
>         <message-destination-name>bacmTopic</message-destination-name>
>         <config-property-setting name="PhysicalName">bacmTopic</ 
> config-property-setting>
>         </adminobject-instance>
> </adminobject>
>
> </connector> </resource>
> </application-client>
>
>
> Bascially, what I'm trying to do is deploy the  
> TopicConnectionFactory and Topic on the server, and use my  
> application client to look them up.
>
> However, when I try to deploy the application client, I get this  
> error: "Error: Unable to distribute MyAppClient.jar: Could not  
> access external rar contents for artifact:  
> org.apache.geronimo.configs/activemq-broker/2.0.2/car Access is  
> denied"
>
> I'm not even sure if I'm doing the right thing by trying to deploy  
> the activemq resource adapter on the client container as well (I  
> picked up that tip online). If anyone could help me figure out how  
> to let my application client access the JMS resources, please let me  
> know!
>
> Thanks a lot,
> Stella
>


Mime
View raw message