I am not exactly sure of the WARN message, but here's what you can do:
1) Instead of changing the jndi.properties file present in the conf/ directory of JBOSS, i would suggest, you create a separate jndi.properties file for your application and package it with your application so that its available in the classpath. (However, as far as i know, using the jndi.properties present in the conf/ directory is NOT the cause of this WARN message. )
2) In the jndi.properties, use:
Note the word jnp in the url.
In all, your jndi.properties should look like:
java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory java.naming.factory.url.pkgs=org.jboss.naming:org.jnp.interfaces java.naming.provider.url=jnp://localhost:1099
Try this out. I am also not sure how serious that WARN message is, since the code is working fine.
Thanks Kiran....I suspected that I need to specify a separate jndi.properties file because if you notice the comment in the NamingService class it says,
"Context.PROVIDER_URL in server jndi.properties."
So it says that the file present in /conf is a server side jndi.properties (whatever it means). And the error is certainly because of specifying the url in /conf/jndi.properties. This is evident by taking a look at org.jboss.naming.NamingService class code.
BTW, a few more interesting observations:
a) If I specify the url as "jnp://localhost:1099" in /conf/jndi.properties file then I receive a ClassCastException in JBoss while trying to instantiate NamingService.
b) I have my own properties file read/write mechanism built in my application. So I used my this properties file to specify these values and changed code to create InitialContext using these values from the properties file.
anyways, thanks. My application would still work though I'd love to find out the reasons for the warning.