4 Replies Latest reply on May 22, 2012 2:47 PM by pilhuhn

    jnp url configuration wirh rhq agent

    akashk

      Hi All,

       

      This is my first post in this community.

       

      I configured rhqagent with rhq server, i see the folowing error in logs. From jon console i see 1099 production tab in RED. When checked with support they asked me to change url from consolejnp://[0:0:0:0:0:0:0:1]:1099 to jnp://0.0.0.0:1099. After changing from console it use to work properly.

       

      2012-02-28 11:14:53,762 DEBUG [ResourceDiscoveryComponent.invoker.daemon-1] (rhq.plugins.jbossas5.helper.JBossInstanceInfo)- jboss.home.dir="C:\Apps\jboss-eap-5.0\jboss-as"

      2012-02-28 11:14:53,762 DEBUG [ResourceDiscoveryComponent.invoker.daemon-1] (rhq.plugins.jbossas5.helper.JBossInstanceInfo)- jboss.server.home.dir="C:\Apps\jboss-eap-5.0\jboss-as\server\production"

      2012-02-28 11:14:53,762 DEBUG [ResourceDiscoveryComponent.invoker.daemon-1] (rhq.plugins.jbossas5.helper.JBossInstanceInfo)- jboss.server.name="production"

      2012-02-28 11:14:53,762 DEBUG [ResourceDiscoveryComponent.invoker.daemon-1] (rhq.plugins.jbossas5.helper.JBossInstanceInfo)- jboss.bind.address="0.0.0.0"

      2012-02-28 11:14:53,762 DEBUG [ResourceDiscoveryComponent.invoker.daemon-1] (org.rhq.plugins.jbossas5.ApplicationServerDiscoveryComponent)- Read JNP URL from jnp-service.url file:jnp://[0:0:0:0:0:0:0:1]:1099

       

       

       

      Now my question is we configured jboss on ip 0.0.0.0 but from which conf it is picking this ip  jnp://[0:0:0:0:0:0:0:1]:1099. I have gone through all conf files but am not able to find. Can some please help me in this because i need to change this URL for all other instances.

       

      Appreciate your help in Advance.

       

      And how to post a discussion to public.

        • 1. Re: jnp url configuration wirh rhq agent
          lkrejci

          RHQ agent reads the JNP URL from $JBOSS_EAP_HOME/server/<ACTIVE_CONFIGURATION>/data/jnp-service.url. Note that this is not a configuration file but a file JBoss EAP creates while starting up. This was done to ease the problem of finding the correct values in the AS configuration files for the management software like RHQ.

           

          So in another words, I'm sorry that I don't know the answer to your question, but this is more of a question for JBoss AS guys.

          • 2. Re: jnp url configuration wirh rhq agent
            lkrejci

            Btw. this might be related... https://community.jboss.org/thread/152432

            • 3. Re: jnp url configuration wirh rhq agent
              ips

              I think we could workaround the JBAS bug in cases where the IPv6 address can be converted to an IPv4 address, e.g.:

               

              String jnpHost = jnpUri.getHost();
              String normalizedJnpHost = jnpHost;
              InetAddress ipAddress = IntetAddress.getByName(jnpHost);
              if (ipAddress instanceof Inet6Address) {
                 Inet6Address ipv6Address = (Inet6Address)ipAddress;
                 if (ipv6Address.isIPv4CompatibleAddress()) {
                     if (ipv6Address.isLoopbackAddress()) {
                         normalizedJnpHost = "127.0.0.1";
                     } else {
                         byte[] ipv6Bytes = ipv6Address.getAddress();
                         byte[] ipv4Bytes = Arrays.copyOfRange(ipv6Bytes, 12, 16);       
                         InetAddress ipv4Address = InetAddress.getByAddress(ipv4Bytes);
                         normalizedJnpHost = ipv4Address.toString();
                     }
                  }
              }
              String normalizedJnpUri = "jnp://" + normalizedJnpHost + ":" + jnpUri.getPort();
              

               

              I'll create a BZ for this.

              • 4. Re: jnp url configuration wirh rhq agent
                pilhuhn

                There seems to be a general issue with the JVM and handling IPv4 / IPv6 connections.

                Sun bug parade has an open bug that says a JVM can not do both at a time.

                Some fiddling around recently showed that there is an issue, but it turned out after more fiddling that in fact the JVM can do both simultaneously and that the Sun bug may be invalid.

                It turned out for me that the preferIPv4 flag was the bad guy. See e.g. https://bugzilla.redhat.com/show_bug.cgi?id=822218 and https://fedorahosted.org/pipermail/rhq-devel/2012-May/001812.html