You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by John <pm...@yahoo.com> on 2007/02/01 14:53:41 UTC

Re: ActiveMQ Reference/Dependencies

I am now using activemq instead of activemq-broker.

Does it matter what JVM I use?  I was originally using Java 5, but have reverted to the latest Java 1.4.2 release even though it seems to me I should be able to use newer JVMs.

The result of these two changes is that it is no longer complaining about the connection factory, but is giving me the very same error regarding the queue:


     Deployment failed:
Unable to resolve resource reference
'jms/myQueue' (Could not find resource 'SendReceiveQueue'. Perhaps it
has not yet been configured, or your application does not have a
dependency declared for that resource module?)

I guess I was wrong in my assessment that if I got the connection factory working, the queue would follow.  :-)  I have tried, at the suggestion of some web sites and messages on the list, to use <resource-env-ref> and <message-destination-link> instead of <resource-ref> and <resource-link> for the queue.  However, doing that just gives me an error at deployment time that I should use a <resource-ref>.

Here is my current geronimo-web.xml:

<?xml version="1.0" encoding="UTF-8"?>

  <dep:environment>
    <dep:moduleId>
      <dep:groupId>default</dep:groupId>
      <dep:artifactId>SimpleMDBWeb</dep:artifactId>
      <dep:version>1.0</dep:version>
      <dep:type>car</dep:type>
    </dep:moduleId>

    <dep:dependencies>
          <dep:dependency>
              <dep:artifactId>activemq</dep:artifactId>
              <dep:type>car</dep:type>
        </dep:dependency>
    </dep:dependencies>
  </dep:environment>

  <context-root>/SimpleMDBWeb</context-root>

  <nam:resource-ref>
    <nam:ref-name>jms/myConnFactoryRef</nam:ref-name>
    <nam:resource-link>DefaultActiveMQConnectionFactory</nam:resource-link>
  </nam:resource-ref>

  <nam:resource-ref>
    <nam:ref-name>jms/myQueue</nam:ref-name>
    <nam:resource-link>SendReceiveQueue</nam:resource-link>
  </nam:resource-ref>

</web-app>

I am following the other thread regarding a similar matter closely.

Thanks!
John

----- Original Message ----
From: Aaron Mulder <am...@alumni.princeton.edu>
To: user@geronimo.apache.org
Sent: Wednesday, January 31, 2007 4:45:38 PM
Subject: Re: ActiveMQ Reference/Dependencies

I think your dependency should be on activemq not activemq-broker.  If
I remember right, the activemq-broker module just configures the core
ActiveMQ broker and the activemq module has the basic connection
factories and stuff.

Thanks,
      Aaron

On 1/31/07, John <pm...@yahoo.com> wrote:
> I have seen similar questions posted here which have helped me along to some extent, but I've hit a dead end.
>
>
>
> I am trying to deploy a simple servlet which posts a message to a JMS queue.
>
>
>
> For the sake of simplicity in this message, I am only going to reference the connection factory, as I assume once I figure out how to map that resource properly, I can figure out the queue.
>
>
>
> The code does this:
>
>
>
> ConnectionFactory qConnectionFactory = (ConnectionFactory)context.lookup("java:comp/env/jms/myConnFactoryRef");
>
>
>
> My web.xml has this:
>
>
>
>     <resource-ref>
>
>         <res-ref-name>jms/myConnFactoryRef</res-ref-name>
>
>          <res-type>javax.jms.ConnectionFactory</res-type>
>
>         <res-auth>Container</res-auth>
>
>     </resource-ref>
>
>
>
> My FULL geronimo-web.xml is as follows:
>
>
>
> <?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:dep="http://geronimo.apache.org/xml/ns/deployment-1.1";>
>
>   <dep:environment>
>
>      <dep:moduleId>
>
>       <dep:groupId>default</dep:groupId>
>
>       <dep:artifactId>SimpleMDBWeb</dep:artifactId>
>
>       <dep:version>1.0</dep:version>
>
>       <dep:type>car</dep:type>
>
>     </dep:moduleId>
>
>
>
>     <dep:dependencies>
>
>       <dep:dependency>
>
>           <dep:groupId>geronimo</dep:groupId>
>
>           <dep:artifactId>activemq-broker</dep:artifactId>
>
>           <dep:version>1.1.1</dep:version>
>
>           <dep:type>car</dep:type>
>
>       </dep:dependency>
>
>     </dep:dependencies>
>
>
>
>    </dep:environment>
>
>
>
>   <context-root>/SimpleMDBWeb</context-root>
>
>
>
>   <nam:resource-ref>
>
>     <nam:ref-name>jms/myConnFactoryRef</nam:ref-name>
>
>     <nam:resource-link>DefaultActiveMQConnectionFactory</nam:resource-link>
>
>   </nam:resource-ref>
>
>
>
>   <nam:resource-ref>
>
>     <nam:ref-name>jms/myQueue</nam:ref-name>
>
>     <nam:resource-link>SendReceiveQueue</nam:resource-link>
>
>   </nam:resource-ref>
>
>
>
> </web-app>
>
>
>
>
>
> The error I am getting is:
>
>
>
> "Unable to resolve resource reference 'jms/myConnFactoryRef' (Could not find resource 'DefaultActiveMQConnectionFactory'.  Perhaps it has not yet been configured, or your application does not have a dependency declared for that resource module?)"
>
>
>
> It would seem from the error that the resource reference is properly linked to the resource I want to use, but I am having a dependency issue.  I have tried using "activemq" instead of "activemq-broker."  I have tried using both.  I have tried creating my own JMS resource in Geronimo and referencing that resource as a dependency instead of, and in addition to activemq and activemq-broker.  No matter what I do, I get the above error.
>
>
>
> All the web pages and sample geronimo-web.xml files I have found seem to support my usage above, but I am obviously still doing something wrong.
>
>
> I am using Geronimo 1.1.1.
>
>
>
> I would appreciate any pointer in the right direction.
>
>
>
> Thanks!
>
> John
>
>
>
>
>
>
>
>
> ____________________________________________________________________________________
> Expecting? Get great news right away with email Auto-Check.
> Try the Yahoo! Mail Beta.
> http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html
>





 
____________________________________________________________________________________
TV dinner still cooling? 
Check out "Tonight's Picks" on Yahoo! TV.
http://tv.yahoo.com/

Re: ActiveMQ Reference/Dependencies

Posted by Aaron Mulder <am...@alumni.princeton.edu>.
OK, well, I'm assuming you created the queue in question?  If so, you
need to also add a dependency on the module that the queue is in.
Again, you can find the name of that module in the console or with the
command-line deploy tool ('list-modules').

Thanks,
       Aaron

On 2/1/07, John <pm...@yahoo.com> wrote:
> I am now using activemq instead of activemq-broker.
>
> Does it matter what JVM I use?  I was originally using Java 5, but have reverted to the latest Java 1.4.2 release even though it seems to me I should be able to use newer JVMs.
>
> The result of these two changes is that it is no longer complaining about the connection factory, but is giving me the very same error regarding the queue:
>
>
>      Deployment failed:
> Unable to resolve resource reference
> 'jms/myQueue' (Could not find resource 'SendReceiveQueue'. Perhaps it
> has not yet been configured, or your application does not have a
> dependency declared for that resource module?)
>
> I guess I was wrong in my assessment that if I got the connection factory working, the queue would follow.  :-)  I have tried, at the suggestion of some web sites and messages on the list, to use <resource-env-ref> and <message-destination-link> instead of <resource-ref> and <resource-link> for the queue.  However, doing that just gives me an error at deployment time that I should use a <resource-ref>.
>
> Here is my current geronimo-web.xml:
>
> <?xml version="1.0" encoding="UTF-8"?>
>
>   <dep:environment>
>     <dep:moduleId>
>       <dep:groupId>default</dep:groupId>
>       <dep:artifactId>SimpleMDBWeb</dep:artifactId>
>       <dep:version>1.0</dep:version>
>       <dep:type>car</dep:type>
>     </dep:moduleId>
>
>     <dep:dependencies>
>           <dep:dependency>
>               <dep:artifactId>activemq</dep:artifactId>
>               <dep:type>car</dep:type>
>         </dep:dependency>
>     </dep:dependencies>
>   </dep:environment>
>
>   <context-root>/SimpleMDBWeb</context-root>
>
>   <nam:resource-ref>
>     <nam:ref-name>jms/myConnFactoryRef</nam:ref-name>
>     <nam:resource-link>DefaultActiveMQConnectionFactory</nam:resource-link>
>   </nam:resource-ref>
>
>   <nam:resource-ref>
>     <nam:ref-name>jms/myQueue</nam:ref-name>
>     <nam:resource-link>SendReceiveQueue</nam:resource-link>
>   </nam:resource-ref>
>
> </web-app>
>
> I am following the other thread regarding a similar matter closely.
>
> Thanks!
> John
>
> ----- Original Message ----
> From: Aaron Mulder <am...@alumni.princeton.edu>
> To: user@geronimo.apache.org
> Sent: Wednesday, January 31, 2007 4:45:38 PM
> Subject: Re: ActiveMQ Reference/Dependencies
>
> I think your dependency should be on activemq not activemq-broker.  If
> I remember right, the activemq-broker module just configures the core
> ActiveMQ broker and the activemq module has the basic connection
> factories and stuff.
>
> Thanks,
>       Aaron
>
> On 1/31/07, John <pm...@yahoo.com> wrote:
> > I have seen similar questions posted here which have helped me along to some extent, but I've hit a dead end.
> >
> >
> >
> > I am trying to deploy a simple servlet which posts a message to a JMS queue.
> >
> >
> >
> > For the sake of simplicity in this message, I am only going to reference the connection factory, as I assume once I figure out how to map that resource properly, I can figure out the queue.
> >
> >
> >
> > The code does this:
> >
> >
> >
> > ConnectionFactory qConnectionFactory = (ConnectionFactory)context.lookup("java:comp/env/jms/myConnFactoryRef");
> >
> >
> >
> > My web.xml has this:
> >
> >
> >
> >     <resource-ref>
> >
> >         <res-ref-name>jms/myConnFactoryRef</res-ref-name>
> >
> >          <res-type>javax.jms.ConnectionFactory</res-type>
> >
> >         <res-auth>Container</res-auth>
> >
> >     </resource-ref>
> >
> >
> >
> > My FULL geronimo-web.xml is as follows:
> >
> >
> >
> > <?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:dep="http://geronimo.apache.org/xml/ns/deployment-1.1";>
> >
> >   <dep:environment>
> >
> >      <dep:moduleId>
> >
> >       <dep:groupId>default</dep:groupId>
> >
> >       <dep:artifactId>SimpleMDBWeb</dep:artifactId>
> >
> >       <dep:version>1.0</dep:version>
> >
> >       <dep:type>car</dep:type>
> >
> >     </dep:moduleId>
> >
> >
> >
> >     <dep:dependencies>
> >
> >       <dep:dependency>
> >
> >           <dep:groupId>geronimo</dep:groupId>
> >
> >           <dep:artifactId>activemq-broker</dep:artifactId>
> >
> >           <dep:version>1.1.1</dep:version>
> >
> >           <dep:type>car</dep:type>
> >
> >       </dep:dependency>
> >
> >     </dep:dependencies>
> >
> >
> >
> >    </dep:environment>
> >
> >
> >
> >   <context-root>/SimpleMDBWeb</context-root>
> >
> >
> >
> >   <nam:resource-ref>
> >
> >     <nam:ref-name>jms/myConnFactoryRef</nam:ref-name>
> >
> >     <nam:resource-link>DefaultActiveMQConnectionFactory</nam:resource-link>
> >
> >   </nam:resource-ref>
> >
> >
> >
> >   <nam:resource-ref>
> >
> >     <nam:ref-name>jms/myQueue</nam:ref-name>
> >
> >     <nam:resource-link>SendReceiveQueue</nam:resource-link>
> >
> >   </nam:resource-ref>
> >
> >
> >
> > </web-app>
> >
> >
> >
> >
> >
> > The error I am getting is:
> >
> >
> >
> > "Unable to resolve resource reference 'jms/myConnFactoryRef' (Could not find resource 'DefaultActiveMQConnectionFactory'.  Perhaps it has not yet been configured, or your application does not have a dependency declared for that resource module?)"
> >
> >
> >
> > It would seem from the error that the resource reference is properly linked to the resource I want to use, but I am having a dependency issue.  I have tried using "activemq" instead of "activemq-broker."  I have tried using both.  I have tried creating my own JMS resource in Geronimo and referencing that resource as a dependency instead of, and in addition to activemq and activemq-broker.  No matter what I do, I get the above error.
> >
> >
> >
> > All the web pages and sample geronimo-web.xml files I have found seem to support my usage above, but I am obviously still doing something wrong.
> >
> >
> > I am using Geronimo 1.1.1.
> >
> >
> >
> > I would appreciate any pointer in the right direction.
> >
> >
> >
> > Thanks!
> >
> > John
> >
> >
> >
> >
> >
> >
> >
> >
> > ____________________________________________________________________________________
> > Expecting? Get great news right away with email Auto-Check.
> > Try the Yahoo! Mail Beta.
> > http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html
> >
>
>
>
>
>
>
> ____________________________________________________________________________________
> TV dinner still cooling?
> Check out "Tonight's Picks" on Yahoo! TV.
> http://tv.yahoo.com/
>