aspose file tools
The moose likes Distributed Java and the fly likes jndi.properties rage Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Reply Bookmark "jndi.properties rage" Watch "jndi.properties rage" New topic
Author

jndi.properties rage

Andy Evans
Greenhorn

Joined: Jul 22, 2002
Posts: 8
Argh... let the screaming begin....
During the prototyping stage of our code we happily hardcoded the jndi lookup information... however, now it makes sense to try and move it all out to a jndi.properties file. I cannot get it to work.
We're using tomcat 4.0.3 & jboss 3.0.0....
This was the original code that worked:
String urlName = "10.225.68.103:1099";
java.util.Properties p = new java.util.Properties();
p.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
p.put("java.naming.provider.url", urlName);
javax.naming.InitialContext jndiContext = new javax.naming.InitialContext(p);
Object ref = jndiContext.lookup("eppix/Integration");
Based on that - and from examples I found on the web, I created a jndi.properties file containing the following three entries... (the last one was added experimentally, I have no idea if it's useful.. it certainly didn't change anything)
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
java.naming.provider.url=10.225.68.103:1099
java.naming.factory.url.pkgs=org.jboss.naming rg.jnp.interfaces
The code was changed to:
javax.naming.InitialContext jndiContext = new javax.naming.InitialContext();
Object ref = jndiContext.lookup("eppix/Integration");
If I break the code, at runtime, on the lookup line, the initialcontext has picked up the entries in the jndi.properties... however the contents of the context are COMPLETELY different when done the original way and when done the new way.
Using the properties file I just keep getting a "Name eppix is not bound in this Context" error message... (a javax.naming.NameNotFoundException)....
Has anyone got a clue what is going on here?
I've searched for ages and not come up with anything even close to an answer.
Cheers in advance.
(e)
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: jndi.properties rage
 
Similar Threads
EJB Remote call in different server
unable to get Naming Context
JNDI lookup errors
javax.naming. NameNotFoundException:
Dependency INjection through Annotations