Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Exception: org.omg.CORBA.MARSHAL

843793Apr 25 2002 — edited Apr 26 2002
Hello!
My NameService problem (http://forum.java.sun.com/thread.jsp?forum=15&thread=246581) has been solved by IOR and with a help of a collegue. But I still has problems. Let's clear the situation:
I have to connect to a CORBA sever object (powered by VisiBroker) with a pure JAVA IDL (1.4.0) client. The server object is successfully bound into the NameService, it can be seen perfectly in the VisiBroker Console. The client successfully found the NameService, could locate the Server object, but when I invoke its only method (wstring resolve(wstring) ) the Client throws an org.omg.CORBA.MARSHAL exception.
My question is: Is it an incompatibility between the JAVA's default ORB and VisiBroker's ORB, and they won't be able to communicate ever, or it is my mistake, I made something wrong?

Here is the program call:
(you can see, that the remote reference (obj) is not null, so it has been acquired!)
C:\Private\Proggy\Java\corba>java com.nokia.corbatest.ct2 IOR:000000....
com.nokia.nap.requestfrontend._RFEStub:IOR:000000000000002a494....
Exception in thread "main" org.omg.CORBA.MARSHAL:   vmcid: 0x0  minor code: 0  completed: No
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
        at java.lang.Class.newInstance0(Class.java:296)
        at java.lang.Class.newInstance(Class.java:249)
        at com.sun.corba.se.internal.iiop.messages.ReplyMessage_1_2.getSystemException(ReplyMessage_1_2.java:90)
        at com.sun.corba.se.internal.iiop.ClientResponseImpl.getSystemException(ClientResponseImpl.java:105)
        at com.sun.corba.se.internal.corba.ClientDelegate.invoke(ClientDelegate.java:303)
        at org.omg.CORBA.portable.ObjectImpl._invoke(ObjectImpl.java:457)
        at com.nokia.nap.requestfrontend._RFEStub.resolve(_RFEStub.java:34)
        at com.nokia.corbatest.ct2.main(ct2.java:46)
And the source of the client:
import com.nokia.nap.requestfrontend.*;

import java.util.Properties;
import org.omg.CORBA.ORB;
import org.omg.CORBA.OBJ_ADAPTER;
import org.omg.CosNaming.NamingContextPackage.*;
import org.omg.CosNaming.NamingContext;
import org.omg.CosNaming.NamingContextHelper;
import org.omg.CosNaming.NameComponent;
import org.omg.PortableServer.POA;

import org.omg.CORBA.*;
import org.omg.CosNaming.*;


class ct2 {
    public static void main(String args[])throws NotFound, CannotProceed, RFEException,
            org.omg.CORBA.ORBPackage.InvalidName,
            org.omg.CosNaming.NamingContextPackage.InvalidName   {


        ORB orb = ORB.init(args, null);
        NamingContext ncRef = null;

        if(args.length==1)
            ncRef = NamingContextHelper.narrow(orb.string_to_object(args[0]));
        else
        {
            ncRef = NamingContextHelper.narrow(orb.resolve_initial_references("NameService"));
        }

        //create the naming path
        NameComponent name[] = { new NameComponent("RFE", "") };

        //resolve the path to a reference
        org.omg.CORBA.Object ref;
        RFE obj;

        ref = ncRef.resolve(name);
        obj = RFEHelper.narrow(ref);

        System.out.println(obj);

        System.out.println(obj.resolve("yo"));
    }
}

// The remote object's reference can be get this way also,
// but neither works...
//
// NamingContextExt nc =
//    NamingContextExtHelper.narrow(orb.string_to_object(args[0]));
// org.omg.CORBA.Object ref = nc.resolve_str("RFE");
Thanks,
Sanyi
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 24 2002
Added on Apr 25 2002
1 comment
1,208 views