Skip to main content

remote EJB client: org.omg.CORBA.ORBInitialHost ignored?

3 replies [Last post]
Anonymous

Folks;

been in for quite a tough ride until finally managing to get all things to
work right while building an EJB client supposed to connect to a running
remote Glassfish instance using maven. It hasn't really been fun and (to my
surprise) generated an application client of about 40 megs in size, but at
least it works.

Well. Mostly. Except for one thing: So far, it only manages to connect to my
Glassfish server running locally. While trying to run the client

java -Dorg.omg.CORBA.ORBInitialHost=testbed -jar my-client.jar ,

the runtime seems to quietly ignore the ORBInitialHost parameter and, always
and forever, makes use of the service running on localhost. As soon as I shut
down my local domain, the command keeps waiting in my terminal forever, doing
nothing. No output, no error messages.

Hmm. Strange. Any explanations, or any way how to trace this down?
TIA and all the best,
Kristian

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
hvilekar
Offline
Joined: 2006-10-06
Points: 0

Kristian,

In place of the hostname, try using the ip address of the remote host
-Dorg.omg.CORBA.ORBInitialHost=xxx.xxx.xxx.xxx". If that works, then
check your hosts file. Adding hostname to ip address mapping to the
hosts file on your system may help.

Harshad.

On 11/12/2012 06:31 AM, Kristian Rink wrote:
> Folks;
>
> been in for quite a tough ride until finally managing to get all things to
> work right while building an EJB client supposed to connect to a running
> remote Glassfish instance using maven. It hasn't really been fun and (to my
> surprise) generated an application client of about 40 megs in size, but at
> least it works.
>
> Well. Mostly. Except for one thing: So far, it only manages to connect to my
> Glassfish server running locally. While trying to run the client
>
> java -Dorg.omg.CORBA.ORBInitialHost=testbed -jar my-client.jar ,
>
> the runtime seems to quietly ignore the ORBInitialHost parameter and, always
> and forever, makes use of the service running on localhost. As soon as I shut
> down my local domain, the command keeps waiting in my terminal forever, doing
> nothing. No output, no error messages.
>
> Hmm. Strange. Any explanations, or any way how to trace this down?
> TIA and all the best,
> Kristian

Kristian Rink

Harshad;

first off, thanks a bunch for your message, greatly appreciated.

Am Montag, 12. November 2012, 12:49:07 schrieb Harshad Vilekar:
> In place of the hostname, try using the ip address of the remote host
> -Dorg.omg.CORBA.ORBInitialHost=xxx.xxx.xxx.xxx". If that works, then
> check your hosts file. Adding hostname to ip address mapping to the
> hosts file on your system may help.

Already tried that. Same result, unfortunately. :(

What maybe confuses me even more is that, in that process, the client just
quietly "locks" / keeps waiting forever instead of spitting out an error
message such as "host not found" or "host is down". Just for the minutes, this
behaviour doesn't change much either while using
System.setProperty("org.omg.CORBA.ORBInitialHost") in the client
implementation or even using the InitialContext(Properties props) constructor
(which the glassfish.net EJB FAQ explicitely tells me not to do).

Am I still completely missing something in here?
TIA and all the best,
Kristian

Kristian Rink

Harshad, all;

Am Dienstag, 13. November 2012, 09:47:13 schrieb Kristian Rink:

> Am Montag, 12. November 2012, 12:49:07 schrieb Harshad Vilekar:
> > In place of the hostname, try using the ip address of the remote host
> > -Dorg.omg.CORBA.ORBInitialHost=xxx.xxx.xxx.xxx". If that works, then
> > check your hosts file. Adding hostname to ip address mapping to the
> > hosts file on your system may help.

Well, sometimes it helps to actually write, debug a bit and think twice. Used
the Eclipse debugger to dive into things and see what happens. Repeatedly
ended up seeing the client actually initially connects to the "right" host
("testbed" server) searching and resolving the remote EJB but always and again
falls back to "127.0.0.1" for trying to actually connect.

Eventually figured out that, on the testbed / Glassfish host, its local
hostname ("testbed") was wired to 127.0.0.1 in /etc/hosts.

Changed that, restarted the domain. Problem solved. Something learnt again.
*facepalm*

Cheers,
Kristian