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: NullPointerException when Getting TopicConnectionFactory from JNDI
Date Thu, 08 Mar 2007 05:56:08 GMT
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/

Mime
View raw message