8 Replies Latest reply on Oct 12, 2012 3:31 AM by xin.zhang.song

    Question about remote jndi

    xin.zhang.song

      Hi guys

       

      I met a question about the "remoting-naming" modules, the following is the log:

       

      11:04:44,889 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) javax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory org.jboss.naming.remote.client.InitialContextFactory from classloader ModuleClassLoader for Module "deployment.HelloWorld_Client.war:main" from Service Module Loader

      11:04:44,889 ERROR [stderr] (http-localhost-127.0.0.1-8080-1)           at org.jboss.as.naming.InitialContextFactoryBuilder.createInitialContextFactory(InitialContextFactoryBuilder.java:64)

      11:04:44,889 ERROR [stderr] (http-localhost-127.0.0.1-8080-1)           at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:664)

      11:04:44,889 ERROR [stderr] (http-localhost-127.0.0.1-8080-1)           at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)

      11:04:44,889 ERROR [stderr] (http-localhost-127.0.0.1-8080-1)           at javax.naming.InitialContext.init(InitialContext.java:223)

      11:04:44,889 ERROR [stderr] (http-localhost-127.0.0.1-8080-1)           at javax.naming.InitialContext.<init>(InitialContext.java:197)

      11:04:44,889 ERROR [stderr] (http-localhost-127.0.0.1-8080-1)           at com.broadvision.ejb.client.HelloWorld_Client.test(HelloWorld_Client.java:53)

       

      Here is the part of my code and the code in the HelloWorld_Client.war:

       

      final Properties env = new Properties();

      env.put(Context.INITIAL_CONTEXT_FACTORY, "org.jboss.naming.remote.client.InitialContextFactory");

      env.put(Context.PROVIDER_URL, System.getProperty(Context.PROVIDER_URL, "remote://localhost:4447"));

      Context context = new InitialContext(env);

      //look up

      Object o = context.lookup("java:jboss/exported/HelloWorld/HelloWorld!com.broadvision.ejb.HelloWorldHome");

       

      any clues about this issue?

       

      Thanks

       

      Xin