Are you initializing the InitialContext object with
the properties that are usually found in jndi.properties?
If not, it's going to use the ones found in
which is setup to use local references in the same
The problem was the remote jboss server's standardjboss.xml. I had a stray ServerSocketConnection tag which I removed and hey presto it worked perfectly.