[jboss-user] [Beginner's Corner] - javax.naming.CommunicationException: Could not obtain connection to any of these urls: localhost:1099

Liberino Covelli do-not-reply at jboss.com
Thu Aug 9 04:48:30 EDT 2012


Liberino Covelli [https://community.jboss.org/people/rino.covelli] created the discussion

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

To view the discussion, visit: https://community.jboss.org/message/752776#752776

--------------------------------------------------------------
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
[https://community.jboss.org/message/752776#752776]

Start a new discussion in Beginner's Corner at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075]

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20120809/fa0fd7c2/attachment.html 


More information about the jboss-user mailing list