I get a java.net exception, how do I fix it?
There is something wrong with your network configuration.
On linux check /etc/hosts doesn't have 127.0.0.1 mapped to your host name
check your ip address is reachable from the client, try pinging the server/client from the other machine
Try telnet host port, e.g. is jndi visible - telnet serverip 1099 or UIL2 - telnet serverip 8093
Check your dns/dhcp setup, has your lease expired.
nslookup will help you get a host name from an ip address to check reverse resolution - do the server and client agree about which host binds to which ip address?
Try tracing the route to the server - traceroute serverip
Is there an firewall in the way?
Use netstat to see what ports are open and bound to where, e.g. netstat -an
Do you have multi nics (network interface cards), are you multi-homing? Are the services bound to all of them?
Add the folllowing log4j.properties to the client which will produce a log showing where the client thinks it is connecting to
log4j.rootCategory=INFO, Default log4j.appender.Default=org.apache.log4j.FileAppender log4j.appender.Default.File=jbossmq.log log4j.appender.Default.layout=org.apache.log4j.PatternLayout log4j.appender.Default.layout.ConversionPattern=%d %-5p [%c(1)] {%t} %m%n log4j.appender.Default.Append=false log4j.category.org.jboss.mq=TRACE#org.jboss.logging.XLevel
Running this code on the client or server will help you understand what java thinks is your hostname/ip address
import java.net.InetAddress; public class WhatIsMyAddress { public static void main(String[] args) throws Exception { System.out.println(InetAddress.getLocalHost()); }
}
Are you accidently discovering the wrong server using jboss's HAJNDI? Try adding the following to your jndi properties to disable discovery of a jboss server on your network.
jnp.disableDiscovery=true
Comments