[omniORB] Java Client connect omniORB server through tunnel

Shifeng ZHANG zsfdev at yahoo.com
Fri Sep 24 11:04:59 BST 2004


Duncan,

Thanks for your reply. I give detailed description
below.

The Client side:
WindowsXP, Java HotSpot 1.4.1, IE 6.0
The Server side:
SunOS 5.9, omniORB 4.0.2

In the server side, the CORBA server(here I use echo
as the example)creates a POA with the persistent
lifespan policy:
"
 CORBA::PolicyList pl;
 pl.length(2);
 pl[0] = root_poa->create_lifespan_policy
PortableServer::PERSISTENT);
 pl[1] =
root_poa->create_id_assignment_policy(PortableServer::USER_ID);
 PortableServer::POA_var poa =
root_poa->create_POA("my ecoh poa", pman, pl);
 // Always use the same object id.
 PortableServer::ObjectId_var oid =
 PortableServer::string_to_ObjectId("my echo object");
" 
I set the same host name and port number to make sure
the CORBA echo server alwayes gives the same IOR for
client:    
"
argv[1] = strdup("-ORBendPoint");
argv[2] = new char[512];
sprintf(argv[2], "giop:tcp:%s:%s", "yeti.unl.edu",
"10001");
CORBA::ORB_var orb = CORBA::ORB_init(argc, argv);
"

In the client side, since the server side's firewall
blocks all other ports except http and ssh, I use
OpenSSH to tunnel the localhost:10001 to the
remotehost(yeti.unl.edu):10001. Then I generate
another "false" IOR for the client side (I generate
the "false" IOR as the same as the server side, only
replace giop:tcp:yeti.unl.edu:10001 as
giop:tcp:localhost:10001). So the only difference
between the "false" IOR and the echo serser IOR is the
hosts are diffrent:
" catior result for the real IOR:
Type ID: "IDL:Echo:1.0"
Profiles:
1. IIOP 1.2 yeti.unl.edu 10001 ".my ecoh poa.my echo
object"
TAG_ORB_TYPE omniORB
TAG_CODE_SETS char native code set: ISO-8859-1
char conversion code set: UTF-8
wchar native code set: UTF-16
wchar conversion code set: UTF-16
"
" catior result for the false IOR
Type ID: "IDL:Echo:1.0"
Profiles:
1. IIOP 1.2 127.0.0.1 10001 ".my ecoh poa.my echo
object"
TAG_ORB_TYPE omniORB
TAG_CODE_SETS char native code set: ISO-8859-1
char conversion code set: UTF-8
wchar native code set: UTF-16
wchar conversion code set: UTF-16
"

Then the java client uses the "false" IOR to call the
server in the remotehost through the ssh tunneling. I
got the below result:
"
ERROR: org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor
code: 201  completed: No
org.omg.CORBA.COMM_FAILURE:   vmcid: SUN  minor code:
201  completed: No
	at
com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(Unknown
Source)
	at
com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(Unknown
Source)
	at
com.sun.corba.se.internal.iiop.GIOPImpl.getConnection(Unknown
Source)
	at
com.sun.corba.se.internal.corba.ClientDelegate.createRequest(Unknown
Source)
	at
com.sun.corba.se.internal.corba.ClientDelegate.createRequest(Unknown
Source)
	at
com.sun.corba.se.internal.corba.ClientDelegate.request(Unknown
Source)
	at org.omg.CORBA.portable.ObjectImpl._request(Unknown
Source)
	at _EchoStub.echoString(_EchoStub.java:16)
	at EchoClient.main(EchoClient.java:56)
"

I also tunnelled the corba naming service through ssh.
I gives the parameter -ORBInitRef
NameService=corbaname::localhost:2809 to the java
client and the java client can find the naming service
and get the echo server's IOR through its naming path.


I think maybe it is the other information inside the
IOR cause the access error. 

Thanks!

Shifeng
--- Duncan Grisby <duncan at grisby.org> wrote:

> On Wednesday 22 September, Shifeng ZHANG wrote:
> 
> > I have an omniORB CORBA server,S,running inside
> the firewall; I want
> > a java client outside the firewall to call the
> omniORB server S. I
> > used ssh tunneling to redirect
> > 1). the naming service: local:2809 to
> remotehost:2809
> > 2). the omniORB CORBA server S: localhost:10001 to
> remotehost:10001,
> > which 10001 is the port of omniORB CORBA server S
> in the remote
> > host.
> >
> > It seemed the naming service contact has no
> problem (I use the
> > -ORBInitRef NameService=corbaname::localhost:2809
> to pass the
> > parameters to orb init function, and the java
> client can locate the
> > naming service in the remote host).  However I
> have no idea to let
> > the java client call the omniORB CORBA server S in
> the remote host
> > through ssh tunneling. I tried to generate an
> "false" IOR with
> > locahost ip (127.0.0.1) and port 10001 and gives
> the "false" IOR to
> > java client but it does not work.
> 
> In what way does it not work?  It should work.
> 
> Cheers,
> 
> Duncan.
> 
> -- 
>  -- Duncan Grisby         --
>   -- duncan at grisby.org     --
>    -- http://www.grisby.org --
> 



	
		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 



More information about the omniORB-list mailing list