0 Replies Latest reply on Aug 9, 2012 4:48 AM by rino.covelli

    javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099

    rino.covelli

      Dear friends,

       

      I'm developing my first application with ejb :

       

      I' m using a Jboss 7.1

       

      and when i run the client

      public class EjbClient {
      
          @EJB
          static MyBean bean;
          
          public static void main(String[] args) {
              
              Properties pro = new Properties();
              pro.put(javax.naming.InitialContext.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
              pro.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces");
              pro.put(javax.naming.InitialContext.PROVIDER_URL,"localhost:1099");
      
              
              
              Context ctx;
              try {
                  ctx = new InitialContext(pro);
                  MyBeanRemote psr = (MyBeanRemote) ctx
                          .lookup("MyBean/remote");
                  
                  psr.sayYes();
              } catch (NamingException e) {
                  // TODO Auto-generated catch block
                  e.printStackTrace();
              }
              
              
              
          }
      }
      

       

      get the following error

       

      javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099