Uploaded image for project: 'Infinispan'
  1. Infinispan
  2. ISPN-9534

ClassNotFoundException: DnsContextFactory when using jgroups.stack=dnsping

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Critical
    • Resolution: Done
    • 9.4.0.CR3
    • 9.4.0.Final
    • None
    • None
    • Hide

      1) Create a docker file `Dockerfile-infinispan-server`

      Unable to find source-code formatter for language: docker. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      FROM jboss/infinispan-server
      COPY infinispan-server-cloud.xml /opt/jboss/infinispan-server/standalone/configuration/
      

      2) Build using: docker build -t infinispan-server-dlovison -f Dockerfile-infinispan-server .

      3) Execute:

      cat /etc/resolv.conf | grep nameserver | awk '{print $2}'
      

      Copy the first address. Example: 1.1.1.1

      4) Execute: docker run -i -t infinispan-server-dlovison:latest -c infinispan-server-cloud.xml -Djboss.default.jgroups.stack=dnsping -Djgroups.dns_address=1.1.1.1

      Keep in mind that you need change '1.1.1.1' and use the value returned from the step 3


      It will return an error:

      13:24:01,727 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.datagrid-jgroups.channel.cluster: org.jboss.msc.service.StartException in service jboss.datagrid-jgroups.channel.cluster: java.security.PrivilegedActionException: javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory com.sun.jndi.dns.DnsContextFactory from classloader ModuleClassLoader for Module "org.jgroups.extension:ispn-9.4" version 9.4.0.CR3 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/infinispan-server/modules,/opt/jboss/infinispan-server/modules/system/layers/base,/opt/jboss/infinispan-server/modules/system/add-ons/ispn)) [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.dns.DnsContextFactory from [Module "org.jgroups.extension:ispn-9.4" version 9.4.0.CR3 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/infinispan-server/modules,/opt/jboss/infinispan-server/modules/system/layers/base,/opt/jboss/infinispan-server/modules/system/add-ons/ispn))]]
      	at org.infinispan.server.jgroups.spi.service.ChannelBuilder.start(ChannelBuilder.java:79)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1736)
      	at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1698)
      	at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556)
      	at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
      	at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985)
      	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487)
      	at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378)
      	at java.lang.Thread.run(Thread.java:748)
      Caused by: java.security.PrivilegedActionException: javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory com.sun.jndi.dns.DnsContextFactory from classloader ModuleClassLoader for Module "org.jgroups.extension:ispn-9.4" version 9.4.0.CR3 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/infinispan-server/modules,/opt/jboss/infinispan-server/modules/system/layers/base,/opt/jboss/infinispan-server/modules/system/add-ons/ispn)) [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.dns.DnsContextFactory from [Module "org.jgroups.extension:ispn-9.4" version 9.4.0.CR3 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/infinispan-server/modules,/opt/jboss/infinispan-server/modules/system/layers/base,/opt/jboss/infinispan-server/modules/system/add-ons/ispn))]]
      	at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:623)
      	at org.infinispan.server.jgroups.JChannelFactory.createChannel(JChannelFactory.java:104)
      	at org.infinispan.server.jgroups.spi.service.ChannelBuilder.start(ChannelBuilder.java:77)
      	... 8 more
      Caused by: javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory com.sun.jndi.dns.DnsContextFactory from classloader ModuleClassLoader for Module "org.jgroups.extension:ispn-9.4" version 9.4.0.CR3 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/infinispan-server/modules,/opt/jboss/infinispan-server/modules/system/layers/base,/opt/jboss/infinispan-server/modules/system/add-ons/ispn)) [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.dns.DnsContextFactory from [Module "org.jgroups.extension:ispn-9.4" version 9.4.0.CR3 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/infinispan-server/modules,/opt/jboss/infinispan-server/modules/system/layers/base,/opt/jboss/infinispan-server/modules/system/add-ons/ispn))]]
      	at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:120)
      	at org.jboss.as.naming.InitialContext.init(InitialContext.java:101)
      	at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:154)
      	at org.jboss.as.naming.InitialContext.<init>(InitialContext.java:91)
      	at org.jboss.as.naming.InitialContextFactory.getInitialContext(InitialContextFactory.java:43)
      	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684)
      	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313)
      	at javax.naming.InitialContext.init(InitialContext.java:244)
      	at javax.naming.InitialContext.<init>(InitialContext.java:216)
      	at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101)
      	at org.jgroups.protocols.dns.DefaultDNSResolver.<init>(DefaultDNSResolver.java:40)
      	at org.jgroups.protocols.dns.DNS_PING.init(DNS_PING.java:54)
      	at org.jgroups.stack.ProtocolStack.initProtocolStack(ProtocolStack.java:840)
      	at org.jgroups.stack.ProtocolStack.setup(ProtocolStack.java:479)
      	at org.jgroups.JChannel.init(JChannel.java:995)
      	at org.jgroups.JChannel.<init>(JChannel.java:148)
      	at org.infinispan.server.jgroups.JChannelFactory.lambda$createChannel$0(JChannelFactory.java:103)
      	at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:619)
      	... 10 more
      Caused by: java.lang.ClassNotFoundException: com.sun.jndi.dns.DnsContextFactory from [Module "org.jgroups.extension:ispn-9.4" version 9.4.0.CR3 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/infinispan-server/modules,/opt/jboss/infinispan-server/modules/system/layers/base,/opt/jboss/infinispan-server/modules/system/add-ons/ispn))]
      	at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:255)
      	at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410)
      	at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398)
      	at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116)
      	at java.lang.Class.forName0(Native Method)
      	at java.lang.Class.forName(Class.java:348)
      	at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:115)
      	... 27 more
      

      Maybe it could be related with: https://issues.jboss.org/browse/WFLY-10321

      The version from the server is:

      Infinispan Server 9.4.0.CR3 (WildFly Core 6.0.2.Final) starting
      
      Show
      1) Create a docker file `Dockerfile-infinispan-server` Unable to find source-code formatter for language: docker. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml FROM jboss/infinispan-server COPY infinispan-server-cloud.xml /opt/jboss/infinispan-server/standalone/configuration/ 2) Build using: docker build -t infinispan-server-dlovison -f Dockerfile-infinispan-server . 3) Execute: cat /etc/resolv.conf | grep nameserver | awk '{print $2 }' Copy the first address. Example: 1.1.1.1 4) Execute: docker run -i -t infinispan-server-dlovison:latest -c infinispan-server-cloud.xml -Djboss.default.jgroups.stack=dnsping -Djgroups.dns_address=1.1.1.1 Keep in mind that you need change '1.1.1.1' and use the value returned from the step 3 It will return an error: 13:24:01,727 ERROR [org.jboss.msc.service.fail] (MSC service thread 1-5) MSC000001: Failed to start service jboss.datagrid-jgroups.channel.cluster: org.jboss.msc.service.StartException in service jboss.datagrid-jgroups.channel.cluster: java.security.PrivilegedActionException: javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory com.sun.jndi.dns.DnsContextFactory from classloader ModuleClassLoader for Module "org.jgroups.extension:ispn-9.4" version 9.4.0.CR3 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/infinispan-server/modules,/opt/jboss/infinispan-server/modules/system/layers/base,/opt/jboss/infinispan-server/modules/system/add-ons/ispn)) [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.dns.DnsContextFactory from [Module "org.jgroups.extension:ispn-9.4" version 9.4.0.CR3 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/infinispan-server/modules,/opt/jboss/infinispan-server/modules/system/layers/base,/opt/jboss/infinispan-server/modules/system/add-ons/ispn))]] at org.infinispan.server.jgroups.spi.service.ChannelBuilder.start(ChannelBuilder.java:79) at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1736) at org.jboss.msc.service.ServiceControllerImpl$StartTask.execute(ServiceControllerImpl.java:1698) at org.jboss.msc.service.ServiceControllerImpl$ControllerTask.run(ServiceControllerImpl.java:1556) at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35) at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:1985) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1487) at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1378) at java.lang.Thread.run(Thread.java:748) Caused by: java.security.PrivilegedActionException: javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory com.sun.jndi.dns.DnsContextFactory from classloader ModuleClassLoader for Module "org.jgroups.extension:ispn-9.4" version 9.4.0.CR3 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/infinispan-server/modules,/opt/jboss/infinispan-server/modules/system/layers/base,/opt/jboss/infinispan-server/modules/system/add-ons/ispn)) [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.dns.DnsContextFactory from [Module "org.jgroups.extension:ispn-9.4" version 9.4.0.CR3 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/infinispan-server/modules,/opt/jboss/infinispan-server/modules/system/layers/base,/opt/jboss/infinispan-server/modules/system/add-ons/ispn))]] at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:623) at org.infinispan.server.jgroups.JChannelFactory.createChannel(JChannelFactory.java:104) at org.infinispan.server.jgroups.spi.service.ChannelBuilder.start(ChannelBuilder.java:77) ... 8 more Caused by: javax.naming.NamingException: WFLYNAM0027: Failed instantiate InitialContextFactory com.sun.jndi.dns.DnsContextFactory from classloader ModuleClassLoader for Module "org.jgroups.extension:ispn-9.4" version 9.4.0.CR3 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/infinispan-server/modules,/opt/jboss/infinispan-server/modules/system/layers/base,/opt/jboss/infinispan-server/modules/system/add-ons/ispn)) [Root exception is java.lang.ClassNotFoundException: com.sun.jndi.dns.DnsContextFactory from [Module "org.jgroups.extension:ispn-9.4" version 9.4.0.CR3 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/infinispan-server/modules,/opt/jboss/infinispan-server/modules/system/layers/base,/opt/jboss/infinispan-server/modules/system/add-ons/ispn))]] at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:120) at org.jboss.as.naming.InitialContext.init(InitialContext.java:101) at javax.naming.ldap.InitialLdapContext.<init>(InitialLdapContext.java:154) at org.jboss.as.naming.InitialContext.<init>(InitialContext.java:91) at org.jboss.as.naming.InitialContextFactory.getInitialContext(InitialContextFactory.java:43) at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:684) at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:313) at javax.naming.InitialContext.init(InitialContext.java:244) at javax.naming.InitialContext.<init>(InitialContext.java:216) at javax.naming.directory.InitialDirContext.<init>(InitialDirContext.java:101) at org.jgroups.protocols.dns.DefaultDNSResolver.<init>(DefaultDNSResolver.java:40) at org.jgroups.protocols.dns.DNS_PING.init(DNS_PING.java:54) at org.jgroups.stack.ProtocolStack.initProtocolStack(ProtocolStack.java:840) at org.jgroups.stack.ProtocolStack.setup(ProtocolStack.java:479) at org.jgroups.JChannel.init(JChannel.java:995) at org.jgroups.JChannel.<init>(JChannel.java:148) at org.infinispan.server.jgroups.JChannelFactory.lambda$createChannel$0(JChannelFactory.java:103) at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:619) ... 10 more Caused by: java.lang.ClassNotFoundException: com.sun.jndi.dns.DnsContextFactory from [Module "org.jgroups.extension:ispn-9.4" version 9.4.0.CR3 from local module loader @79b4d0f (finder: local module finder @6b2fad11 (roots: /opt/jboss/infinispan-server/modules,/opt/jboss/infinispan-server/modules/system/layers/base,/opt/jboss/infinispan-server/modules/system/add-ons/ispn))] at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:255) at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:410) at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:398) at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:116) at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at org.jboss.as.naming.InitialContext.getDefaultInitCtx(InitialContext.java:115) ... 27 more Maybe it could be related with: https://issues.jboss.org/browse/WFLY-10321 The version from the server is: Infinispan Server 9.4.0.CR3 (WildFly Core 6.0.2.Final) starting

    Attachments

      Activity

        People

          dlovison@redhat.com Diego Lovison
          dlovison@redhat.com Diego Lovison
          Votes:
          0 Vote for this issue
          Watchers:
          1 Start watching this issue

          Dates

            Created:
            Updated:
            Resolved: