aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes I am befuffled by this behaviour! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "I am befuffled by this behaviour!" Watch "I am befuffled by this behaviour!" New topic
Author

I am befuffled by this behaviour!

saran sadaiyappan
Ranch Hand

Joined: Dec 23, 2004
Posts: 39
Hi all,
I am experiencing a problem when sending a message through POJO class.I ll explain the problem as follows:
I am creating a normal message sending code and then sending it to a local queue to which an MDB is listening(the queue is created in a local server)...now its working fine.But when I send the message to a Foreign JMS server(local JNDI name of the foreign JMS server) where the queue has a local and remote JNDI name...the error is like
"java.net.ConnectException: t3://localhost:7001: Destination unreachable".

Now I tried by creating a war file and deployed the same and I posted the message to the local JNDI name of the queue in the foreign JMS server...and it s sending messages correctly..

So my question is how the one for POJO failed and the same worked for a web application?Is it something related to the server container??
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
Hi Saran,


So my question is how the one for POJO failed and the same worked for a web application?Is it something related to the server container??

This kind of errors might happen when the environment for local (remote) clients is not properly set. Good examples are the java.naming.provider.url and the java.naming.factory.initial environment variables. The server always initializes these properties when starts up, while local clients need to set them explicitly when initializing the naming context. Hence the next code:

Works very well within a jsp or servlet deployed to the app server (the ejb container and the web server are collocated), but will fail with a remote client. The problem could be easily solved:

If these two properties are not set at all you�ll get a very specific messages that clearly indicates this fact. In your case I believe that the POJO reads the properties from the local server, but tries to access a remote location. A code similar to the one above might solve your problem.
If this doesn�t work, you should probably post the client code as well.
Regards.


I think, therefore I exist -- Rene Descartes
saran sadaiyappan
Ranch Hand

Joined: Dec 23, 2004
Posts: 39
Thanks for your clarification friend.But will the server initialise the naming rovider url to the localhost or the remote machine?The Foreign JMS server will do with the provider URL the remote machine and the local server with that of the local one....Am i right?
Valentin Tanase
Ranch Hand

Joined: Feb 17, 2005
Posts: 704
You're right.
Kunaal A Trehan
Ranch Hand

Joined: Feb 04, 2004
Posts: 63
Hi Saran

Basically when u try to send the message from the .war file.
Initial Context and other stuff is taken care as ure working
in the same env.
However when u re using remote client u need to specific where exactly it
shd do the look up.

Moreover when u re sending message to the Foriegn JMS Server.
Basically u re sending message to a local queue
which internally is mapped to remote machine.
This facility is provided in Weblogic.

I think it clarifies u how exactly look up and other thing happens

Kunal
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: I am befuffled by this behaviour!