File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JBoss/WildFly and the fly likes Help me JBOSS Initialcontext jndi lookup Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Help me JBOSS Initialcontext jndi lookup" Watch "Help me JBOSS Initialcontext jndi lookup" New topic
Author

Help me JBOSS Initialcontext jndi lookup

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234


Hi

I am trying to call a EJB3 session Been from AWT as client

But i am getting "Could not obtain connection to any of these urls: localhost:1099 and discovery failed with error: javax.naming.CommunicationException: Receive timed out [Root exception is java.net.SocketTimeoutException: Receive timed out"

Tried with different options with no use

Please guide me , this is inside my client code


Save India From Corruption - Anna Hazare.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

Is the app server running on localhost and does it have port 1099 open for JNDI?

Also see if this discussion helps: http://www.jboss.org/index.html?module=bb&op=viewtopic&t=93668


JBoss In Action
Hakan Erdogan
Greenhorn

Joined: Jun 30, 2006
Posts: 10
- Make sure your jboss runs on localhost and your rmi port is 1099 (default values)
- Make sure you add jboss client jars in your classpath, if you have standalone application, if it runs on a jboss server no need to add extra jars into your classpath.

If you use -b parameter while starting server (e.g. run.sh -b 192.168.12.16) then use env.setProperty(Context.PROVIDER_URL, "192.168.12.16:1099");

Here is the example:

Properties env = new Properties();
env.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
env.setProperty(Context.URL_PKG_PREFIXES, "org.jboss.naming");
env.setProperty(Context.PROVIDER_URL, "localhost:1099");

try {
   InitialContext context = new InitialContext(env);
   HelloWorldRemote helloWorldRemote = (HelloWorldRemote) context.lookup("HelloWorld/remote");
   helloWorldRemote.sayHello("Guest");
} catch (NamingException e) {
   e.printStackTrace();
}


SCJP 1.4
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Thanks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Help me JBOSS Initialcontext jndi lookup
 
Similar Threads
Distributed EJB lookup problem
NoClassDefFoundError when running client
datasource lookup
NameNotFoundException with MS Access
Problem with code