activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wallace <wallace3...@yahoo.com>
Subject Re: JBoss integration and lookup of connection factories.
Date Sun, 08 Apr 2007 23:00:36 GMT

I can make the jndi lookup working within jboss j2ee container. But jndi
apparently does not work from a single standalone client, when accessing
jndi of jboss.

For example,
           Properties env2 = new Properties();
           ......
           env2.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
           env2.put(Context.PROVIDER_URL, "jnp://localhost:1099");
           InitialContext jndi2 = new InitialContext(env2);          
           
           TopicConnectionFactory connectionFactory =
(javax.jms.TopicConnectionFactory)
jndi2.lookup("java:activemq/TopicConnectionFactory");
           
The code always returns name not found exception. Has anyone ever made it
work in standalone client?

-Wallace Wong



tbaker73 wrote:
> 
> James, could you please provide an example of the connection factory entry
> to add under <connection-factories> in a -ds.xml file that would
> accomplish what you suggest? How would it differ from this entry?
>    <tx-connection-factory>
>       <jndi-name>activemq/QueueConnectionFactory</jndi-name>
>       <xa-transaction/>
>       <track-connection-by-tx/>
>       <rar-name>activemq-ra.rar</rar-name>
>      
> <connection-definition>javax.jms.QueueConnectionFactory</connection-definition>
>       <ServerUrl>vm://localhost</ServerUrl>
>       <UserName>sa</UserName>
>       <Password></Password>
>       <min-pool-size>1</min-pool-size>
>       <max-pool-size>200</max-pool-size>
>       <blocking-timeout-millis>30000</blocking-timeout-millis>
>       <idle-timeout-minutes>3</idle-timeout-minutes>
>    </tx-connection-factory>
> 
> 
> James.Strachan wrote:
>> 
>> 
>> You'll need to setup a regular JMS connection and any destination
>> objects you want in JNDI somewhere. Using JBoss's JNDI provider could
>> well work fine though - just make sure its actually normal JMS client
>> objects (ConnectionFactory & destinations) - and not RA stuff.  Also
>> make sure the J2EE server and your stand alone client are using the
>> exact same ActiveMQ jars since its gonna be using Java serialization
>> to transmit the Java objects in JNDI
>> -- 
>> 
>> James
>> -------
>> http://radio.weblogs.com/0112098/
>> 
>> 
> 
> 

-- 
View this message in context: http://www.nabble.com/JBoss-integration-and-lookup-of-connection-factories.-tf3061463s2354.html#a9896459
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message