jndi/jndi.properties are being ignored
mwalker Nov 25, 2003 11:00 PM
"mwalker" wrote:"mwalker" wrote:
When I attempt to run the examples on a remote client using the included build.xml, I get the ever delightful
[java] javax.naming.CommunicationException: Receive timed out. Root exception is java.io.InterruptedIOException: Receive timed out
[java] at java.net.PlainDatagramSocketImpl.receive(Native Method)
[java] at java.net.DatagramSocket.receive(DatagramSocket.java:387)
[java] at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:1038)
[java] at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1127)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:478)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:471)
[java] at javax.naming.InitialContext.lookup(InitialContext.java:345)
[java] at com.titan.clients.Client_51a.main(Client_51a.java:30)
So, I put something erroneous into my jndi.properties, e.g.
java.naming.factory.initial=org.jnp.interfaces.USOutOfIraqContextFactory
and nothing changes. However, when I hard code the jndi props, ala ..
p.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
p.put(Context.URL_PKG_PREFIXES, "jboss.naming:org.jnp.interfaces");
p.put(Context.PROVIDER_URL, "jnp://192.168.0.3:1099");
return new javax.naming.InitialContext(p);
...then it works fine, or when I bypass ant and run it from the following shell script...
#------------------------------------
#! /bin/bash
cd build/classes
JBOSS_LIB="$JBOSS_HOME"/client
if [ -n "$CLASSPATH" ] ; then
LOCALCLASSPATH="$CLASSPATH"
fi
for i in "${JBOSS_LIB}"/*.jar
do
if [ "$i" != "${JBOSS_LIB}/*.jar" ] ; then
if [ -z "$LOCALCLASSPATH" ] ; then
LOCALCLASSPATH=$i
else
LOCALCLASSPATH="$i":"$LOCALCLASSPATH"
fi
fi
done
LOCALCLASSPATH=./:../../jndi/:"$LOCALCLASSPATH"
java -cp "$LOCALCLASSPATH" com.titan.clients.Client_51b
#------------------------------------
it also works. I don't have any random jndi.props files laying around my home directory. Is this all because of the jndi.properties (setting ProviderURL to local host) buried in one of the client lib jars?
Does the <include "../jndi/"..> in the build.xml need to be forced to the front of the classpath?
Also, has anyone else had trouble with the ant included in the workbook examples? I can't get it to stop bitching about org.apache.tools.ant.Main? Using the ant that comes with SuSE 8.1 (or the latest tar installed on my SuSE 7.3 box) seems to do the trick
vital stats...
SuSE 8.1/7.3
jboss-3.2.1_tomcat-4.1.24
AMD Hardware
Thanks in advance for any guidence...