aspose file tools*
The moose likes Java in General and the fly likes JNDI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "JNDI" Watch "JNDI" New topic
Author

JNDI

James Clarke
Ranch Hand

Joined: Oct 04, 2004
Posts: 148
Hi,

Does anyone know if its possible when using JNDI to use objects bound using JNDI in one JVM from another JVM ?

thanks in advance,

J.C
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18712
    
  40

Originally posted by James Clarke:
Hi,

Does anyone know if its possible when using JNDI to use objects bound using JNDI in one JVM from another JVM ?

thanks in advance,

J.C


Of course. Weblogic, JBoss, Websphere, etc., all use JNDI. If it wasn't possible, then there is no way to get to these highly popular application servers from an external client.

Henry
[ July 14, 2006: Message edited by: Henry Wong ]

Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
James Clarke
Ranch Hand

Joined: Oct 04, 2004
Posts: 148
Hi,

Thanks for the response. How would i go about referencing an object in one JVM from another JVM ? I am not sure what parameters to specify that the objects that I need are in another JVM.

The specific objects that I am trying to get a reference to are JMS Queues and topics so that I can publish some messages to them..

thanks in advance,

J.c
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18712
    
  40

You don't specify the other JVM. Instead you specify the port (and other criteria) that the JDNI service that is running in the other JVM is using. You also don't need to specify the object type, you specify the registered name of the object. Here is an example...



This example is used to connect to the JMX RMI connector, but that's not relevant. Notice that you have to specify the protocol, the port, the server, and the registered name to get the connector object.

Also, notice that it uses JBoss specific classes, as this connects to a JBoss server, so you need to also have the application server's client library in you path.


I suggest that you log into the support web-site, for your application server, for JMS queues, for this important information.

Henry
[ July 14, 2006: Message edited by: Henry Wong ]
James Clarke
Ranch Hand

Joined: Oct 04, 2004
Posts: 148
Thanks Henry, I am actually trying to lookup the queues and topics created by a middleware product called Tibco, I want to do the lookup from a seperate application that runs on web logic.. do you know if this is possible ?

thanks,

JC
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18712
    
  40

Of course, it is possible... IMHO, Weblogic's implementation is probably more robust than JBoss (although, I am sure that many here would disagree )

However, I have never played with Tibco, so I suggest that you log into into Tibco's or Weblogic's support site for the configuration information (and source code examples).

Henry
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JNDI