You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Nirav Mehta <me...@gmail.com> on 2007/01/31 15:27:19 UTC

ActiveMQ reference

Hi,

I was trying out a JMS example from IBM DW. Here they used the server wide
configs:

    <resource-ref>
        <res-ref-name>DefaultActiveMQConnectionFactory</res-ref-name>
        <res-type>javax.jms.QueueConnectionFactory</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>

Trying to deploy the WAR gave:
Unable to resolve resource reference 'DefaultActiveMQConnectionFactory'
(Could not auto-map to resource. Try adding a resource-ref mapping to your
Geronimo deployment plan.)

I tried adding this is the geronimo deployment plan:
  <nam:resource-ref>
    <nam:ref-name>ra/ActiveMQ</nam:ref-name>
    <nam:resource-link>DefaultActiveMQConnectionFactory</nam:resource-link>
  </nam:resource-ref>

Still, I get the same error. Please help

Regards,
Nirav Mehta

Re: ActiveMQ reference

Posted by Nirav Mehta <me...@gmail.com>.
Hi Aaron,

This worked! Thanks :)

- Nirav

Re: ActiveMQ reference

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
You need to add a dependency on the new module you created that holds
the connection factory and queue.  You can look up the name in the
console, or the command-line deploy tool ("list-modules").

If you wanted to use the default connection factory, like in the other
thread, you would need to change the dependency on activemq-broker to
be on activemq.

Thanks,
        Aaron

On 2/1/07, Nirav Mehta <me...@gmail.com> wrote:
> Ok ... now I've created a new connection factory and a new queue. I changed
> the web.xml to
>
>     <resource-ref>
>         <res-ref-name>jms/JMSTrialConFact</res-ref-name>
>         <res-type>
> javax.jms.QueueConnectionFactory</res-type>
>         <res-auth>Container</res-auth>
>     </resource-ref>
>
>     <message-destination-ref>
>         <message-destination-ref-name>
>             jms/nmJMSTrialQueue
>         </message-destination-ref-name>
>         <message-destination-type>
>             javax.jms.Queue
>         </message-destination-type>
>
> <message-destination-usage>Produces</message-destination-usage>
>         <message-destination-link>
>             JMSTrialQueue
>         </message-destination-link>
>     </message-destination-ref>
>
> Added the ref to geronimo deployment plan:
> <?xml version=" 1.0" encoding="UTF-8"?>
> <web-app
> xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1"
> xmlns:nam=" http://geronimo.apache.org/xml/ns/naming-1.1"
> xmlns:sec="http://geronimo.apache.org/xml/ns/security-1.1"
> xmlns:sys="
> http://geronimo.apache.org/xml/ns/deployment-1.1">
>   <sys:environment>
>     <sys:moduleId>
>       <sys:groupId>default</sys:groupId>
>       <sys:artifactId>JMSMQTrial</sys:artifactId>
>       <sys:version>1.0</sys:version>
>       <sys:type>car</sys:type>
>     </sys:moduleId>
>     <sys:dependencies>
>       <sys:dependency>
>         <sys:groupId>geronimo</sys:groupId>
>         <sys:artifactId>activemq-broker</sys:artifactId>
>         <sys:version>1.1.1</sys:version>
>         <sys:type>car</sys:type>
>       </sys:dependency>
>     </sys:dependencies>
>   </sys:environment>
>   <context-root>/JMSMQTrial</context-root>
>   <nam:resource-ref>
>     <nam:ref-name>jms/JMSTrialConFact</nam:ref-name>
>     <nam:resource-link>JMSTrialConFact</nam:resource-link>
>   </nam:resource-ref>
>   <nam:resource-env-ref>
>     <nam:ref-name>jms/JMSTrialQueue</nam:ref-name>
>
> <nam:message-destination-link>JMSTrialQueue</nam:message-destination-link>
>   </nam:resource-env-ref>
> </web-app>
>
>
> I still get the same error:
> Unable to resolve resource reference 'jms/JMSTrialConFact' (Could not find
> resource 'JMSTrialConFact'. Perhaps it has not yet been configured, or your
> application does not have a dependency declared for that resource module?).
>
> HELP!!!
>
> Regards,
> Nirav Mehta
>
>
> On 1/31/07, Nirav Mehta <mehtanirav@gmail.com > wrote:
> > Hi,
> >
> > I was trying out a JMS example from IBM DW. Here they used the server wide
> configs:
> >
> >     <resource-ref>
> >
> <res-ref-name>DefaultActiveMQConnectionFactory</res-ref-name>
> >         <res-type>
> javax.jms.QueueConnectionFactory</res-type>
> >         <res-auth>Container</res-auth>
> >     </resource-ref>
> >
> > Trying to deploy the WAR gave:
> > Unable to resolve resource reference
> 'DefaultActiveMQConnectionFactory' (Could not auto-map to
> resource. Try adding a resource-ref mapping to your Geronimo deployment
> plan.)
> >
> > I tried adding this is the geronimo deployment plan:
> >   <nam:resource-ref>
> >     <nam:ref-name>ra/ActiveMQ</nam:ref-name>
> >
> <nam:resource-link>DefaultActiveMQConnectionFactory</nam:resource-link>
> >   </nam:resource-ref>
> >
> > Still, I get the same error. Please help
> >
> > Regards,
> > Nirav Mehta
> >
>
>

Re: ActiveMQ reference

Posted by Nirav Mehta <me...@gmail.com>.
Ok ... now I've created a new connection factory and a new queue. I changed
the web.xml to

    <resource-ref>
        <res-ref-name>jms/JMSTrialConFact</res-ref-name>
        <res-type>javax.jms.QueueConnectionFactory</res-type>
        <res-auth>Container</res-auth>
    </resource-ref>

    <message-destination-ref>
        <message-destination-ref-name>
            jms/nmJMSTrialQueue
        </message-destination-ref-name>
        <message-destination-type>
            javax.jms.Queue
        </message-destination-type>
        <message-destination-usage>Produces</message-destination-usage>
        <message-destination-link>
            JMSTrialQueue
        </message-destination-link>
    </message-destination-ref>

Added the ref to geronimo deployment plan:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:nam="
http://geronimo.apache.org/xml/ns/naming-1.1" xmlns:sec="
http://geronimo.apache.org/xml/ns/security-1.1" xmlns:sys="
http://geronimo.apache.org/xml/ns/deployment-1.1">
  <sys:environment>
    <sys:moduleId>
      <sys:groupId>default</sys:groupId>
      <sys:artifactId>JMSMQTrial</sys:artifactId>
      <sys:version>1.0</sys:version>
      <sys:type>car</sys:type>
    </sys:moduleId>
    <sys:dependencies>
      <sys:dependency>
        <sys:groupId>geronimo</sys:groupId>
        <sys:artifactId>activemq-broker</sys:artifactId>
        <sys:version>1.1.1</sys:version>
        <sys:type>car</sys:type>
      </sys:dependency>
    </sys:dependencies>
  </sys:environment>
  <context-root>/JMSMQTrial</context-root>
  <nam:resource-ref>
    <nam:ref-name>jms/JMSTrialConFact</nam:ref-name>
    <nam:resource-link>JMSTrialConFact</nam:resource-link>
  </nam:resource-ref>
  <nam:resource-env-ref>
    <nam:ref-name>jms/JMSTrialQueue</nam:ref-name>

<nam:message-destination-link>JMSTrialQueue</nam:message-destination-link>
  </nam:resource-env-ref>
</web-app>


I still get the same error:
Unable to resolve resource reference 'jms/JMSTrialConFact' (Could not find
resource 'JMSTrialConFact'. Perhaps it has not yet been configured, or your
application does not have a dependency declared for that resource module?).

HELP!!!

Regards,
Nirav Mehta

On 1/31/07, Nirav Mehta <me...@gmail.com> wrote:
>
> Hi,
>
> I was trying out a JMS example from IBM DW. Here they used the server wide
> configs:
>
>     <resource-ref>
>         <res-ref-name>DefaultActiveMQConnectionFactory</res-ref-name>
>         <res-type> javax.jms.QueueConnectionFactory</res-type>
>         <res-auth>Container</res-auth>
>     </resource-ref>
>
> Trying to deploy the WAR gave:
> Unable to resolve resource reference 'DefaultActiveMQConnectionFactory'
> (Could not auto-map to resource. Try adding a resource-ref mapping to your
> Geronimo deployment plan.)
>
> I tried adding this is the geronimo deployment plan:
>   <nam:resource-ref>
>     <nam:ref-name>ra/ActiveMQ</nam:ref-name>
>
> <nam:resource-link>DefaultActiveMQConnectionFactory</nam:resource-link>
>   </nam:resource-ref>
>
> Still, I get the same error. Please help
>
> Regards,
> Nirav Mehta
>