activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan" <james.strac...@gmail.com>
Subject Re: [Spam: 5.0] NullPointerException when Getting TopicConnectionFactory from JNDI
Date Thu, 08 Mar 2007 20:20:54 GMT
Great thanks for letting us know

On 3/8/07, kukusz <luke.majewski@gmail.com> wrote:
>
> Exactly what I did, worked great.  Apparently you cannot use datasources from
> remote VMs.  I have not been able to find a satisfactory explanation for
> this, however.  For anyone facing this problem in the future, using
> http://activemq.apache.org/jndi-support.html
> http://activemq.apache.org/jndi-support.html  is exactly what you need.
>
>
>
> James.Strachan wrote:
> >
> > Is your standalone app still using JBoss JNDI? If not it sounds like
> > you need to setup a JNDI context.
> >
> > http://activemq.apache.org/jndi-support.html
> >
> > On 3/7/07, kukusz <luke.majewski@gmail.com> wrote:
> >>
> >> I've looked almost everywhere for the solution to this particular problem
> >> and
> >> have had no luck, perhaps someone has seen this.
> >>
> >>
> >> I have integrated ActiveMQ with JBoss and it works great when JNDI grabs
> >> the
> >> Topic and TopicConnectionFactory from jboss.  The test code looks like:
> >>
> >>
> >>
> >>
> >> System.out.println(context.lookup("jms/TopicConnectionFactory"));
> >>
> >> System.out.println((Topic) context.lookup("jms/topic"));
> >>
> >>
> >>
> >>
> >> Both of those lines of code give me something in the log when running
> >> code
> >> deployed in a WAR in JBoss.  However, a standalone app return a null
> >> connection factory.  Furthermore, additional logging using
> >> context.listBindings shows the connection factory listed with the correct
> >> class type.
> >>
> >>
> >> Here is the connection factory as defined in the datasource:
> >>
> >>
> >>
> >>    &lt;no-tx-connection-factory&gt;
> >>       &lt;jndi-name&gt;jms/TopicConnectionFactory&lt;/jndi-name&gt;
> >>       &lt;use-java-context&gt;false&lt;/use-java-context&gt;
> >>       &lt;rar-name&gt;activemq-ra.rar&lt;/rar-name&gt;
> >>
> >> &lt;connection-definition&gt;javax.jms.TopicConnectionFactory&lt;/connection-definition&gt;
> >>       &lt;ServerUrl&gt;vm://localhost&lt;/ServerUrl&gt;
> >>       &lt;min-pool-size&gt;1&lt;/min-pool-size&gt;
> >>       &lt;max-pool-size&gt;200&lt;/max-pool-size&gt;
> >>
> >> &lt;blocking-timeout-millis&gt;30000&lt;/blocking-timeout-millis&gt;
> >>       &lt;idle-timeout-minutes&gt;3&lt;/idle-timeout-minutes&gt;
> >>    &lt;/no-tx-connection-factory&gt;
> >>
> >>
> >>
> >> I essentially followed this
> >> http://devzone.logicblaze.com/site/integrating-apache-activemq-with-jboss.html
> >> jboss integration  documentation with some minor modifications, such as
> >> setting &lt;use-java-context&gt;false&lt;/use-java-context&gt;.
 I also
> >> tried changing "vm://" to "tcp://" in case that would help.  Any ideas
> >> would
> >> be greatly appreciated.
> >> --
> >> View this message in context:
> >> http://www.nabble.com/NullPointerException-when-Getting-TopicConnectionFactory-from-JNDI-tf3364562s2354.html#a9360907
> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >>
> >
> >
> > --
> >
> > James
> > -------
> > http://radio.weblogs.com/0112098/
> >
> >
>
> --
> View this message in context: http://www.nabble.com/NullPointerException-when-Getting-TopicConnectionFactory-from-JNDI-tf3364562s2354.html#a9381352
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/

Mime
View raw message