You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by ymaraner <tp...@gmail.com> on 2012/08/09 22:57:14 UTC

Remote JNDI access to JMS resources

If I configure my JMS resources as described in the documentation:



How do I access these resources from a java client running in a separate
JVM?

I've tried to get an initial context using these properties:


and then calling 


but I get a NameNotFoundException.





-----
- Tim
--
View this message in context: http://openejb.979440.n4.nabble.com/Remote-JNDI-access-to-JMS-resources-tp4656767.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Remote JNDI access to JMS resources

Posted by Romain Manni-Bucau <rm...@gmail.com>.
np,

thanks to have done it.

this topic is still a big todo so if you have ideas feel free to share them
(on the list and/or jira)

*Romain Manni-Bucau*
*Twitter: @rmannibucau*
*Blog: http://rmannibucau.wordpress.com*




2012/8/21 ymaraner <tp...@gmail.com>

>
> Romain Manni-Bucau wrote
> > Maybe you can open a jira to track the issue?
>
> Created one:  https://issues.apache.org/jira/browse/TOMEE-393 TOMEE-393 .
> Sorry it took so long.
>
>
>
>
> -----
> - Tim
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Remote-JNDI-access-to-JMS-resources-tp4656767p4656941.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Remote JNDI access to JMS resources

Posted by ymaraner <tp...@gmail.com>.
Romain Manni-Bucau wrote
> Maybe you can open a jira to track the issue?

Created one:  https://issues.apache.org/jira/browse/TOMEE-393 TOMEE-393 .
Sorry it took so long.




-----
- Tim
--
View this message in context: http://openejb.979440.n4.nabble.com/Remote-JNDI-access-to-JMS-resources-tp4656767p4656941.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Remote JNDI access to JMS resources

Posted by Romain Manni-Bucau <rm...@gmail.com>.
not sure about doc.

here in 3 lines what does the current code:
- for connection factory: parse an uri to get the driver and the url
(prefix = connectionfactory as you guessed). The driver == connection
factory impl. The constructor should manage a String (the url) as parameter.
- other jms resources were currently not supported

just pushed same thing for queues and topics (prefix is queue or topic ;))

- Romain


2012/8/14 ymaraner <tp...@gmail.com>

>
> Romain Manni-Bucau wrote
> >
> -DResource/javax.jms.ConnectionFactory=connectionfactory:org.apache.activemq.ActiveMQConnectionFactory:tcp://localhost:61616
> Is there some documentation on setting this system property?
> Is there something similar that needs to be set up in order to be able to
> look up Topics and Destinations?
>
>
>
>
>
> -----
> - Tim
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Remote-JNDI-access-to-JMS-resources-tp4656767p4656865.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Remote JNDI access to JMS resources

Posted by ymaraner <tp...@gmail.com>.
Romain Manni-Bucau wrote
> -DResource/javax.jms.ConnectionFactory=connectionfactory:org.apache.activemq.ActiveMQConnectionFactory:tcp://localhost:61616
Is there some documentation on setting this system property?
Is there something similar that needs to be set up in order to be able to
look up Topics and Destinations?





-----
- Tim
--
View this message in context: http://openejb.979440.n4.nabble.com/Remote-JNDI-access-to-JMS-resources-tp4656767p4656865.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Fwd: Remote JNDI access to JMS resources

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi!

wonder what we should put behind such a need (client lookup of server
resource).

One constraint is to not need any impl (amq for instance).

I thought to create a ResourceMetaData class transporting properties of the
server but that's not enough. We really have 2 worlds for some resources
and client and server logic are different. The connection factory is the
right example for this: in the server you are linked to the tx mgr, in the
client often not.

So the question is what do we expect? Using the server resource (= proxying
all the API, not complicated but not logical, moreover perf will be poor
:s) or using a real client resource. If the last one getting the conf can
only be done by a lot of reflection + client system properties usage (for
overriding)....nothing perfect

well i'm kind of mind-blocked on it, any opinion will be welcomed.


- Romain


---------- Forwarded message ----------
From: Romain Manni-Bucau <rm...@gmail.com>
Date: 2012/8/10
Subject: Re: Remote JNDI access to JMS resources
To: users@openejb.apache.org


well to be complete, currently you'll need such a system property in your
client:

-DResource/javax.jms.ConnectionFactory=connectionfactory:org.apache.activemq.ActiveMQConnectionFactory:tcp://localhost:61616

- Romain



2012/8/10 Romain Manni-Bucau <rm...@gmail.com>

> Hi,
>
> currently that's not supported, we'll work on it quickly i think. Maybe
> you can open a jira to track the issue?
>
> - Romain
>
>
>
> 2012/8/9 ymaraner <tp...@gmail.com>
>
>> If I configure my JMS resources as described in the documentation:
>>
>>
>>
>> How do I access these resources from a java client running in a separate
>> JVM?
>>
>> I've tried to get an initial context using these properties:
>>
>>
>> and then calling
>>
>>
>> but I get a NameNotFoundException.
>>
>>
>>
>>
>>
>> -----
>> - Tim
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/Remote-JNDI-access-to-JMS-resources-tp4656767.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>
>

Re: Remote JNDI access to JMS resources

Posted by Romain Manni-Bucau <rm...@gmail.com>.
will work -> normally

but i wonder how we should support it (as you guessed on the dev list). The
user firednly way is not perf friendly.

BTW why not creating a client manually (just curious)?

- Romain


2012/8/10 ymaraner <tp...@gmail.com>

> Romain,
>
> The latest snapshot works like a charm.
>
> From your earlier comment and the new thread on the developer forum, I
> assume that this is just a work-around. Is the work-around likely to
> continue to work when the official implementation is complete?
>
> Thanks,
>
>
>
> -----
> - Tim
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Remote-JNDI-access-to-JMS-resources-tp4656767p4656787.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Remote JNDI access to JMS resources

Posted by ymaraner <tp...@gmail.com>.
Romain,

The latest snapshot works like a charm. 

>From your earlier comment and the new thread on the developer forum, I
assume that this is just a work-around. Is the work-around likely to
continue to work when the official implementation is complete?

Thanks,



-----
- Tim
--
View this message in context: http://openejb.979440.n4.nabble.com/Remote-JNDI-access-to-JMS-resources-tp4656767p4656787.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Remote JNDI access to JMS resources

Posted by Romain Manni-Bucau <rm...@gmail.com>.
can you give it a try with the last snapshot please?

- Romain


2012/8/10 ymaraner <tp...@gmail.com>

> Romain,
>
> The error is:
>
>
> To test this I configured and started TomEE+ 1.1.0 and wrote a simple test
> client.
>
> Here is the output:
>
>
>
> Here is the source for the test client:
>
>
>
> these are all of the resources defined in my tomee.xml file:
>
>
>
> I'm using Eclipse to launch the TomEE+ server and an Eclipse project with
> the TomEE+ Server library on the classpath.
>
>
>
>
>
> -----
> - Tim
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Remote-JNDI-access-to-JMS-resources-tp4656767p4656781.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Remote JNDI access to JMS resources

Posted by ymaraner <tp...@gmail.com>.
Romain,

The error is:


To test this I configured and started TomEE+ 1.1.0 and wrote a simple test
client.

Here is the output:



Here is the source for the test client:



these are all of the resources defined in my tomee.xml file:



I'm using Eclipse to launch the TomEE+ server and an Eclipse project with
the TomEE+ Server library on the classpath.





-----
- Tim
--
View this message in context: http://openejb.979440.n4.nabble.com/Remote-JNDI-access-to-JMS-resources-tp4656767p4656781.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Remote JNDI access to JMS resources

Posted by Romain Manni-Bucau <rm...@gmail.com>.
what is the error? did you add activemq?

- Romain


2012/8/10 ymaraner <tp...@gmail.com>

>
> Romain Manni-Bucau wrote
> >
> > well to be complete, currently you'll need such a system property in your
> > client:
> >
> -DResource/javax.jms.ConnectionFactory=connectionfactory:org.apache.activemq.ActiveMQConnectionFactory:tcp://localhost:61616
> >
>
> Do you mean to say that adding that system property should allow my client
> to successfully look up my connection factory using the JNDI lookup that I
> was using?
>
> If so, it doesn't work. If not, how do I use that system property to obtain
> a reference to the connection factory from my java client? Is there an
> example or test case available that does this?
>
> Thanks for the help,
>
>
>
> -----
> - Tim
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Remote-JNDI-access-to-JMS-resources-tp4656767p4656779.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>

Re: Remote JNDI access to JMS resources

Posted by ymaraner <tp...@gmail.com>.
Romain Manni-Bucau wrote
> 
> well to be complete, currently you'll need such a system property in your
> client:
> -DResource/javax.jms.ConnectionFactory=connectionfactory:org.apache.activemq.ActiveMQConnectionFactory:tcp://localhost:61616
> 

Do you mean to say that adding that system property should allow my client
to successfully look up my connection factory using the JNDI lookup that I
was using?

If so, it doesn't work. If not, how do I use that system property to obtain
a reference to the connection factory from my java client? Is there an
example or test case available that does this? 

Thanks for the help,



-----
- Tim
--
View this message in context: http://openejb.979440.n4.nabble.com/Remote-JNDI-access-to-JMS-resources-tp4656767p4656779.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Re: Remote JNDI access to JMS resources

Posted by Romain Manni-Bucau <rm...@gmail.com>.
well to be complete, currently you'll need such a system property in your
client:

-DResource/javax.jms.ConnectionFactory=connectionfactory:org.apache.activemq.ActiveMQConnectionFactory:tcp://localhost:61616

- Romain


2012/8/10 Romain Manni-Bucau <rm...@gmail.com>

> Hi,
>
> currently that's not supported, we'll work on it quickly i think. Maybe
> you can open a jira to track the issue?
>
> - Romain
>
>
>
> 2012/8/9 ymaraner <tp...@gmail.com>
>
>> If I configure my JMS resources as described in the documentation:
>>
>>
>>
>> How do I access these resources from a java client running in a separate
>> JVM?
>>
>> I've tried to get an initial context using these properties:
>>
>>
>> and then calling
>>
>>
>> but I get a NameNotFoundException.
>>
>>
>>
>>
>>
>> -----
>> - Tim
>> --
>> View this message in context:
>> http://openejb.979440.n4.nabble.com/Remote-JNDI-access-to-JMS-resources-tp4656767.html
>> Sent from the OpenEJB User mailing list archive at Nabble.com.
>>
>
>

Re: Remote JNDI access to JMS resources

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi,

currently that's not supported, we'll work on it quickly i think. Maybe you
can open a jira to track the issue?

- Romain


2012/8/9 ymaraner <tp...@gmail.com>

> If I configure my JMS resources as described in the documentation:
>
>
>
> How do I access these resources from a java client running in a separate
> JVM?
>
> I've tried to get an initial context using these properties:
>
>
> and then calling
>
>
> but I get a NameNotFoundException.
>
>
>
>
>
> -----
> - Tim
> --
> View this message in context:
> http://openejb.979440.n4.nabble.com/Remote-JNDI-access-to-JMS-resources-tp4656767.html
> Sent from the OpenEJB User mailing list archive at Nabble.com.
>