-
How to call remote ejb deployed on jboss? (11 messages)
- Posted by: vic liu
- Posted on: November 23 2004 21:46 EST
I donot know why my stand-alone client can not lookup
ejb deployed on another machine. The app server is JBOSS.
Test code is :
Hashtable environment = new Hashtable();
environment.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory");
environment.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
environment.put(Context.PROVIDER_URL, "jnp://10.200.1.21:1099"); // remote machine IP
InitialContext context = new InitialContext(environment);
Object obj = context.lookup("MyBean"); //ejb-name
System.out.println("-->> lookup object successfully");
//-------------------------------------------------------------
Exception is :
[java] javax.naming.CommunicationException [Root exception is java.rmi.ConnectException: Connec
tion refused to host: 127.0.0.1; nested exception is:
[java] java.net.ConnectException: Connection refused: connect]
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:648)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:508)
[java] at javax.naming.InitialContext.lookup(InitialContext.java:347)
[java] at vic.test.jboss.TestDS.main(Unknown Source)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java
:25)
......
Can you give me some advises? Thanks!Threaded Messages (11)
- How to call remote ejb deployed on jboss? by Raghu Kodali on November 24 2004 19:16 EST
- How to call remote ejb deployed on jboss? by vic liu on November 25 2004 19:16 EST
- How to call remote ejb deployed on jboss? by tim poh on January 24 2005 06:27 EST
- How to call remote ejb deployed on jboss? by vic liu on November 25 2004 19:16 EST
- Same error by Gustavo Melim on February 24 2005 08:57 EST
- host entries by Ben Dinnerville on April 04 2005 06:26 EDT
-
any other way? by Mali Panchu on April 08 2005 08:26 EDT
- DHCP by Mali Panchu on April 20 2005 07:16 EDT
-
any other way? by Mali Panchu on April 08 2005 08:26 EDT
- host entries by Ben Dinnerville on April 04 2005 06:26 EDT
- Solution - How to call remote ejb deployed on jboss? by martti catano on October 05 2007 16:28 EDT
- This helped a lot by Ramdas Sawant on May 05 2008 07:51 EDT
- really helpfull by Bhavesh Dangi on May 10 2010 03:27 EDT
- lookup by vengatesh v on February 23 2012 10:09 EST
-
How to call remote ejb deployed on jboss?[ Go to top ]
- Posted by: Raghu Kodali
- Posted on: November 24 2004 19:16 EST
- in response to vic liu
Double check if the RMI port is 1099 or not. Typically ConnectionException happens if the port is not right or the server is not started on that port.
raghu -
How to call remote ejb deployed on jboss?[ Go to top ]
- Posted by: vic liu
- Posted on: November 25 2004 19:16 EST
- in response to Raghu Kodali
thanks, i resolved this problem.
There is something wrong with my linux server configuration -
How to call remote ejb deployed on jboss?[ Go to top ]
- Posted by: tim poh
- Posted on: January 24 2005 06:27 EST
- in response to vic liu
Do you mind sharing with us how did you resolve this problem ? I seem to have the same problem with JBoss installation on Linux. Thank you very much. -
Same error[ Go to top ]
- Posted by: Gustavo Melim
- Posted on: February 24 2005 08:57 EST
- in response to vic liu
It seems that you solved you problem, can you share what you did ?
I am getting the same error and already checked that the jnp port is 1099. -
host entries[ Go to top ]
- Posted by: Ben Dinnerville
- Posted on: April 04 2005 06:26 EDT
- in response to Gustavo Melim
This problem will mainly happen on redhar based linux distros (not suse etc thou, only those directly based on RH like centos etc)
You need to update your hosts file. By default you will have an entry for 127.0.0.1 with your hostnames next to it like follows:
127.0.0.1 myserver.server.com myserver localhost localhost.localdomain
you need to add a line for your local ip address also and then move your hostnames to it, leaving the localhost entries on 127.0.0.1 like such:
127.0.0.1 localhost localhost.localdomain
192.168.100.1 myserver.server.com myserver
Then restart jboss. It will now bind to both 127.0.0.1 and the 192 (or other) address allowing you to access it from remote machines. -
any other way?[ Go to top ]
- Posted by: Mali Panchu
- Posted on: April 08 2005 08:26 EDT
- in response to Ben Dinnerville
I am using the same solution currently. This holds good for Static IP configuration.
Any solution to work with DHCP? -
DHCP[ Go to top ]
- Posted by: Mali Panchu
- Posted on: April 20 2005 07:16 EDT
- in response to Mali Panchu
The information in the thread http://forum.java.sun.com/thread.jspa?forumID=58&tstart=0&threadID=288759&trange=15
could be useful in the case of DHCP. -
Solution - How to call remote ejb deployed on jboss?[ Go to top ]
- Posted by: martti catano
- Posted on: October 05 2007 16:28 EDT
- in response to vic liu
Hi, I had the same problem. Surfing in the web I found this information: By default JBossAS binds its services to localhost (127.0.0.1). To enable remote access by binding JBoss services to a particular interface, simply run jboss with the -b option. Example: if your ip is 192.168.22.14, you must to start JBoss like: ./run.sh -b192.168.22.14 or ./run.sh --host=192.168.22.14 for windows: run.bat -b192.168.22.14 or run.bat --host=192.168.22.14 Good luck. Martti. -
This helped a lot[ Go to top ]
- Posted by: Ramdas Sawant
- Posted on: May 05 2008 07:51 EDT
- in response to martti catano
This helped a lot. Thanks a lot Ramdas -
really helpfull[ Go to top ]
- Posted by: Bhavesh Dangi
- Posted on: May 10 2010 03:27 EDT
- in response to martti catano
Thanks buddy.
Its really helpfull to me.
Once again thank u very much.
-
lookup[ Go to top ]
- Posted by: vengatesh v
- Posted on: February 23 2012 10:09 EST
- in response to vic liu
Object obj = context.lookup("MyBean"); //ejb-name
instead of using the above code, use the following code
Object obj = context.lookup("MyBean/remote"); //ejb-name