Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-7259

Remote client fails to lookup objects from JNDI due to java.lang.ClassNotFoundException: org.jboss.remoting3.Remoting

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Blocker Blocker
    • None
    • 7.1.0.DR8
    • EJB, JMS, Naming, Remoting
    • None

      There is regression and testing blocker in EAP 7.1.0.DR8. Remote client is not able lookup objects from JNDI. The client fails with:

      Exception in thread "main" javax.naming.NamingException: Failed to create remoting connection [Root exception is java.lang.NoClassDefFoundError: org/jboss/remoting3/Remoting]
      	at org.jboss.naming.remote.client.ClientUtil.namingException(ClientUtil.java:51)
      	at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:152)
      	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 JNDIContextTest.lookup(JNDIContextTest.java:19)
      	at JNDIContextTest.main(JNDIContextTest.java:12)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:497)
      	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)
      Caused by: java.lang.NoClassDefFoundError: org/jboss/remoting3/Remoting
      	at org.jboss.naming.remote.client.EndpointCache.get(EndpointCache.java:47)
      	at org.jboss.naming.remote.client.InitialContextFactory.createEndpoint(InitialContextFactory.java:226)
      	at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateEndpoint(InitialContextFactory.java:207)
      	at org.jboss.naming.remote.client.InitialContextFactory.getOrCreateNamingStore(InitialContextFactory.java:170)
      	at org.jboss.naming.remote.client.InitialContextFactory.getInitialContext(InitialContextFactory.java:146)
      	... 11 more
      Caused by: java.lang.ClassNotFoundException: org.jboss.remoting3.Remoting
      	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
      	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
      	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
      	... 16 more
      

      Client code:

      import javax.naming.Context;
      import javax.naming.InitialContext;
      import java.util.Properties;
      
      /**
       * Created by mnovak on 11/14/16.
       */
      public class JNDIContextTest {
      
          public static void main(String[] args) throws Exception {
              JNDIContextTest jndiContextTest = new JNDIContextTest();
              jndiContextTest.lookup();
          }
      
          private void lookup() throws Exception {
              final Properties env = new Properties();
              env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");
              env.put(Context.PROVIDER_URL, "http-remoting://127.0.0.1:8080");
              Context context = new InitialContext(env);
              System.out.println(context.lookup("jms/RemoteConnectionFactory"));
          }
      }
      

      Configuration of server attached.

              dlloyd@redhat.com David Lloyd
              mnovak1@redhat.com Miroslav Novak
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: