Version 6

    I get a java.net exception, how do I fix it?

     

    There is something wrong with your network configuration.

    1. On linux check /etc/hosts doesn't have 127.0.0.1 mapped to your host name

    2. check your ip address is reachable from the client, try pinging the server/client from the other machine

    3. Try telnet host port, e.g. is jndi visible - telnet serverip 1099 or UIL2 - telnet serverip 8093

    4. Check your dns/dhcp setup, has your lease expired.

    5. 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?

    6. Try tracing the route to the server - traceroute serverip

    7. Is there an firewall in the way?

    8. Use netstat to see what ports are open and bound to where, e.g. netstat -an

    9. Do you have multi nics (network interface cards), are you multi-homing? Are the services bound to all of them?

    10. 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