3 Replies Latest reply on Jun 25, 2008 5:42 PM by peterj

    JVM or JBoss cache of DNS? trying to configure mysql-ds.xml

    stevejb

      Hello,

      I am trying to start a jboss messaging server, connecting to a mysql database. I have my mysql-ds.xml configured with the following line:

      <connection-url>jdbc:mysql://int-mysql64-master.mydomain.com:3306/jbossdb</connection-url>

      We have a cluster of mysql servers, and we have DNS set up such that int-mysql64-master.mydomain.com always resolves to the master mysql server. Recently, the IP address of our master server changed, and our DNS was updated. For example, I can ping int-mysql64-master.mydomain.com and it resolves to the correct box. However, it seems that when I try to start jboss with ./run.sh -c messaging , it is still trying to connect to the old server, according to the server.log file. Also, even when I make changes to mysql-ds.xml and try to run ./run.sh, it is still trying to connect to the old address. How can I fix this? Is there some cache that I can flush? Is JVM or Jboss caching hostnames? Where are the IP/hostname maps stored, and how can I flush them?

      -steve

        • 1. Re: JVM or JBoss cache of DNS? trying to configure mysql-ds.
          peterj

          Not sure if this will work, but stop JBossAS and delete the server/xxx/data, server/xxx/tmp and server/xxx/work directories and restart JBossAS.

          If the problem still persists, then the old IP address is not being cached by JBossAS, in which case either the JVM or the operating system is caching the name. Given that you can ping correctly (I assume you did the ping from the same machine running JBossAS), you can probably rule out the OS, which leaves you with the JVM as the culprit.

          Let me know how it goes.

          • 2. Re: JVM or JBoss cache of DNS? trying to configure mysql-ds.
            stevejb

            Thanks for the response Peter. I tried doing what you said, and we are still getting the same error. Therefore, it must be the JVM. Any ideas on how to get the JVM to behave correctly in this regard?

            Thanks,
            -steve

            • 3. Re: JVM or JBoss cache of DNS? trying to configure mysql-ds.
              peterj

              Do you have the latest 1.5 JDK? If not, install it, set JAVA_HOME to there, and try again. If you have the latest 1.5 JDK, uninstall it, wipe the directory, and reinstall it.

              What is in your /etc/hosts file?

              If the above does not do it, grep your files for the host name or old IP address. IT has to be configured somewhere.

              If that doesn't yield anything, it could be the DNS. Using a network sniffer should be able to uncover that.