Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using JavaORB

1 view
Skip to first unread message

Raphas

unread,
May 2, 2002, 12:39:57 PM5/2/02
to
Hi,

I'm a complete newbie in CORBA and this is what I tried to do, connect to a
CORBA server in C++ :

Properties p=new Properties();
p.put("org.omg.CORBA.ORBInitialHost","exodus");
p.put("org.omg.CORBA.ORBInitialPort","33333");
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,p);

public SessionManager manager =
SessionManagerHelper.narrow(orb.string_to_object("corbaloc::iiop@exodus:33333/MyrdvSessionManager"));


SessionManager is a CORBA object.
I get the exception message on the last line :
org.omg.CORBA.BAD_PARAM: vmcid: SUN minor code: 707 completed: No

Do you know something about my syntax that may be wrong ? I couldn't find
anything on the web,
thanks

Raphaël

Erik Post

unread,
May 2, 2002, 1:58:12 PM5/2/02
to

Which Java SDK version are you using? Afaik, 1.3.x and earlier do not
support corbaloc URLs. You'll need to use some other way to pass the
object reference of the SessionManager to the client, for example by
using the name service or by reading the stringified IOR from a file.

Besides that, your corbaloc URL is incorrect: it should be
corbaloc:iiop:exodus:33333/MyrdvSessionManager, i.e. no @-character in
it.

HTH,
--
Erik Post
erikpost at eml dot cc


Raphas

unread,
May 3, 2002, 8:12:33 AM5/3/02
to
I am using the JDK Standard Edition Version 1.4.0

I tried your solution with the other syntax, but it is not working either.
Are you sure javaORB supports corbaloc URLs ?

Erik Post

unread,
May 3, 2002, 9:11:46 AM5/3/02
to
Raphas wrote:
> I am using the JDK Standard Edition Version 1.4.0
>
> I tried your solution with the other syntax, but it is not working
> either. Are you sure javaORB supports corbaloc URLs ?

The ORB in J2SE 1.4.0 supports corbaloc URLs, at least that's what the
source shows me :)

Are you sure you have passed a valid corbaloc URL? The minor code in the
exception indicates that there is something wrong with the format of the
corbaloc URL. A valid corbaloc URL looks like this:

corbaloc:iiop:hostname:port_number/some_identifier

Note the number of colons; if you put iiop in the corbaloc, there should
be only one consecutive colon. You can leave out the iiop protocol
specifier (which is the default protocol), but that means you have two
consecutive colons:

corbaloc::hostname:port_number/some_identifier

The exact specification of corbaloc URLs can be found in the CORBA
specification. Refer to section 13.6.10 in the CORBA 2.6 specification
for more info.

What happens if you remove the setting of the ORBInitialHost and
ORBInitialPort properties?

Raphas

unread,
May 6, 2002, 4:34:57 AM5/6/02
to
Sorry, but I have tried it all...

we have a C++ server that has CORBA objects. With a C++ seperate program I
am able to work with CORBA objects, using corbaloc. My JAVA program used to
work with IORs, now I have to work with corbaloc.
I seperated the code in a single JAVA progam so that there is no other
interference :

/*imports...*/

class corbaTest
{
public static void main (String[] arguments) throws
AuthFailed,PermDenied,Myrdv.Error,Exception
{
String args[] = null;
System.out.println("Getting ORB :");
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,null);
System.out.println("Connection : " + orb);
SessionManager man
ager = SessionManagerHelper.narrow(orb.string_to_object("corbaloc:iiop:192.168.1.x:43334/MyrdvSessionManager"));
System.out.println("OK");
}
}

OUPUT :
Getting ORB :
Connection : com.sun.corba.se.internal.Interceptors.PIORB@e102dc
Exception in thread "main" org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor
code: 201 completed: No
at
com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:173)
at
com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable.java:65)
at
com.sun.corba.se.internal.iiop.GIOPImpl.getConnection(GIOPImpl.java:67)
at
com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:638)
at
com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.java:580)
at
com.sun.corba.se.internal.corba.ClientDelegate.is_a(ClientDelegate.java:832)
at org.omg.CORBA.portable.ObjectImpl._is_a(ObjectImpl.java:112)
at Myrdv.SessionManagerHelper.narrow(SessionManagerHelper.java:59)
at corbaTest.main(corbaTest.java:17)


Looking at the minor code, the error 201 means :
Implementation of the list operation caught a Java exception while creating
the list iterator.

I launched the debugger and saw that the error appeared at the is_a() call
(in the narrow function) :

public static Myrdv.SessionManager narrow (org.omg.CORBA.Object obj)
{
if (obj == null)
return null;
else if (obj instanceof Myrdv.SessionManager)
return (Myrdv.SessionManager)obj;
else if (!obj._is_a (id ()))
throw new org.omg.CORBA.BAD_PARAM ();
else
{
org.omg.CORBA.portable.Delegate delegate =
((org.omg.CORBA.portable.ObjectImpl)obj)._get_delegate ();
return new Myrdv._SessionManagerStub (delegate);
}
}


I really need your help, I can't find anyting on the web.

Thanks,
Raphas

Erik Post

unread,
May 6, 2002, 7:05:59 AM5/6/02
to
Raphas wrote:
> Sorry, but I have tried it all...
>
> we have a C++ server that has CORBA objects. With a C++ seperate
> program I am able to work with CORBA objects, using corbaloc. My JAVA
> program used to work with IORs, now I have to work with corbaloc.

Why do you have to use corbalocs? The trouble with corbalocs is that
there is no standard for the object identifier part of the URL. A better
way is to use the naming service to have a client obtain a reference to
an object. In this case, your client could look up the name
MyrdvSessionManager in the name service, and obtain the reference to
that object.

> I seperated the code in a single JAVA progam so that there is no other
> interference :

[snip code]

> OUPUT :
> Getting ORB :
> Connection : com.sun.corba.se.internal.Interceptors.PIORB@e102dc
> Exception in thread "main" org.omg.CORBA.COMM_FAILURE: vmcid: SUN
> minor code: 201 completed: No

[snip rest of exception]

> Looking at the minor code, the error 201 means :
> Implementation of the list operation caught a Java exception while
> creating the list iterator.

Actually, the CORBA exception COM_FAILURE indicates communication was
lost while an operation was in progress. Sun's minor code 201 indicates
that a connection failure occured.

So it looks that the corbaloc URL is ok: no exception is thrown on
orb.string_to_object. The narrow operation will invoke an operation on
the remote object, and the COMM_FAILURE exception indicates something is
wrong with the communication. Are you sure your network is correctly
setup? The IP in the corbaloc indicates a non-routable IP address. Do
you have more than one network card in your machine?

> I launched the debugger and saw that the error appeared at the is_a()
> call (in the narrow function) :

The narrow operation is generated by the idl compiler, so it's very
unlikely there will a problem in that operation.

0 new messages