JBoss Community

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

created by Liberino Covelli in Beginner's Corner - View the full discussion

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

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community