This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JNDI lookup

 
thamara chempakam
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

please see the scenario..
There are two instance of a Jboss server jbdv01s and jbdv01c.
here jbdv01s has an sales application which is calling a service application in the same environment(jbdv01s).
The Flow is given below:

Sales application calls one service application through a intermediate class called adapter class. The jar file of the adapter class has packaged with the sales application's ear file.
This adapter class will lookup for the bean of service application.. Adapter class finds the location of the bean by reading one properties file.
This properties file contains the jndi information like



java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming rg.jnp.interfaces
java.naming.provider.url=dvsvccts01:1600

Here the dvsvccts01:1600 is the location of the bean of service application.

The requirement is to remove the service application from the current env and keep in another server.
So we neeed to change the JNDI port number. It should refer the service application which is running in the new server.
I changed the location by editing the properties file like

java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.factory.url.pkgs=org.jboss.naming rg.jnp.interfaces
java.naming.provider.url=dvsvccts01:1500


where 1500 which is the HAJNDI port number of the new server.

But still the Sales application is calling the same service application running in the same server.
ie, no change happened even after i changed the HAJNDI port to new server as java.naming.provider.url=dvsvccts01:1600 to dvsvccts01:1500
Can anybody help me on this?

Thanks and Regards
Sajith
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sajith,


I have seen this issue reported earlier too with JBoss. I haven't given this a try to see if it reproducible on my local server. Based on the various posts that i have seen related to this, the issue seems to manifest when the bean is deployed on the server where the lookup is happening. Irrespective of what provider url you pass to the lookup, it seems to always return the bean from the local server.

How about removing (not deploying) the bean on the dvsvccts01:1600 server?

If that does not solve your issue, please post more details. Also, ensure that the correct properties file is being picked up.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic