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

Porblems in invoking remote CORBA server object from EJB

19 views
Skip to first unread message

zzou

unread,
Oct 16, 2003, 2:42:17 PM10/16/03
to

Hi, all

Has anyone invoke a remote CORBA servant from a weblogic component running ionside
weblogic server 8.1?

I have a simmple EJB which is using a helper class to initialize the orba, and
invoke a remote CORBA
servant developed using JDK 1.4 and RMI/IIOP. The helper class is running fine
in standalone java
client, but some how it failed when I run it from weblogic server.

The error message is:
ERROR: Caught NamingContextPackage.NotFound exception: IDL:omg.org/CosNaming/Nam
ingContext/NotFound:1.0

The sample code to do initialization is as follows:
=====================================================
// Get the root naming context.
org.omg.CORBA.Object objRef;
try {
objRef = orb.resolve_initial_references("NameService");
}
catch (org.omg.CORBA.ORBPackage.InvalidName e) {
System.err.println("ERROR: Caught InvalidName exception: " + e.getMessage());
return null;
}

NamingContext ncRef = NamingContextHelper.narrow(objRef);
System.out.println("Resolved ORB nameserver...");

// Resolve the OSS object reference in Naming service.
NameComponent nc = new NameComponent(services, "");
NameComponent path[] = {
nc};

System.out.println("Attempting to get factory (" + services + ")...");


try {
ossFactory = OSSServerHelper.narrow(ncRef.resolve(path));
}
catch (org.omg.CosNaming.NamingContextPackage.InvalidName e) {
System.err.println("ERROR: Caught InvalidName exception: " + e.getMessage());
return null;
}
catch (org.omg.CosNaming.NamingContextPackage.NotFound e) {
System.err.println(
"ERROR: Caught NamingContextPackage.NotFound exception: " +
e.getMessage());
return null;
}
catch (org.omg.CosNaming.NamingContextPackage.CannotProceed e) {
System.err.println("ERROR: Caught CannotProceed exception: " +
e.getMessage());
return null;
}
================================================

Anyone has any suggestion? Thanks very much, zzou

Andy Piper

unread,
Oct 16, 2003, 3:40:37 PM10/16/03
to
"zzou" <zhihon...@verizon.com> writes:

You missed out how you initialized the ORB. If you just called
ORB.init() then this is the problem as this will go to the local WLS
NameService. Also there were some bugs fixed in this area in both SP1
and SP2, so its possible that you are running into one of those. The way that will probably work in the version of WLS that you have is by doing:

ORB.init().string_to_object("corbaloc:iiop:foreignHost:foreignPort/NameService");

andy

--

zzou

unread,
Oct 16, 2003, 4:25:21 PM10/16/03
to

Thanks, Andy, this way works. Zzou

Derek Lee

unread,
Mar 18, 2004, 10:23:23 PM3/18/04
to
I also have a problem on CORBA call problem by using WLS8.1, which is
connecting to Visibroker 4.5. And program is very simple

public static void main(String args[]){
try{
Properties props = new Properties();
props.put("org.omg.CORBA.ORBInitialPort", "3570");
props.put("org.omg.CORBA.ORBInitialHost", "192.168.42.142");
//
props.put("ORBInitRef","NameService=iioploc://192.168.42.142:3570/NameServic
e");
//
props.put("ORBInitRef","NameService=IOR:000000000000002b49444c3a6f6d672e6f72
672f436f734e616d696e672f4e616d696e67436f6e746578744578743a312e30000000000002
0000000000000084000102000000000f3139322e3136382e34322e31343200000df200000000
002100504d43000000040000000d2f434f4e544558545f504f41002020200000000132000000
000000035649530300000005000405011f000000000000000000000800000000564953000000
0001000000140000000000010001000000000001010900000000000000000000008400010200
0000000f3139322e3136382e34322e31343100000df200000000002100504d43000000040000
000d2f434f4e544558545f504f41002020200000000132000000000000035649530300000005
000405011f000000000000000000000800000000564953000000000100000014000000000001
0001000000000001010900000000");
org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init(args,props);
org.omg.CORBA.Object rootObj =
orb.resolve_initial_references("NameService");
NamingContextExt root = NamingContextExtHelper.narrow(rootObj);
} catch (Exception e) {
System.out.println("ERROR : " + e) ; e.printStackTrace(System.out);
}
}

But I got the following error
org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No
at
com.sun.corba.se.internal.iiop.ConnectionTable.getConnection(ConnectionTable
.java:148)
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:652)
at
com.sun.corba.se.internal.corba.ClientDelegate.createRequest(ClientDelegate.
java:594)
at
com.sun.corba.se.internal.corba.InitialNamingClient.resolve(InitialNamingCli
ent.java:1105)
at
com.sun.corba.se.internal.corba.InitialNamingClient.resolveUsingBootstrapPro
tocol(InitialNamingClient.java:788)
at
com.sun.corba.se.internal.corba.InitialNamingClient.cachedInitialReferences(
InitialNamingClient.java:1186)
at
com.sun.corba.se.internal.corba.InitialNamingClient.resolve_initial_referenc
es(InitialNamingClient.java:1079)
at
com.sun.corba.se.internal.corba.ORB.resolve_initial_references(ORB.java:2436
)

Thx,
Derek

"zzou" <zhihon...@verizon.com> wrote in message
news:3f8efeb1$1...@newsgroups.bea.com...

Andy Piper

unread,
Mar 19, 2004, 1:37:13 PM3/19/04
to
"Derek Lee" <dere...@so-net.com.hk> writes:

Is this in the client or server? Note that iioploc is a visi specific
thing. The correct syntax is:

corbaloc:iiop:host:port/NameService

Also your InitRef prop is wrong, it should be

org.omg.CORBA.ORBInitRef

andy

--

Vladislav Vladimirov

unread,
Mar 24, 2004, 11:15:00 AM3/24/04
to

It looks to me that it works fine from the stack trace,just the ior leads the broker
to non-exitent naming server.

Vladislav

Derek Lee

unread,
Mar 25, 2004, 3:37:31 AM3/25/04
to
Dear All,
I have solved this case by use Visibroker 6 lib with jdk1.4. However,
using weblogic.jar instead of wlclient.jar. Hope this can help all.
Derek

"Vladislav Vladimirov" <ch...@bastun.net> wrote in message
news:4061b404$1...@newsgroups.bea.com...

Madhavi Vemuri

unread,
Jan 7, 2005, 7:13:20 AM1/7/05
to
Hi,
I am using Weblogic8.1sp2. I am trying to corba object. ORB initializing happening but not orbinitializser is not executed.
We are using PortableInterceptors. So OrbInitlizer class we are implementing same thing i have set in the properties of ORB.init method.
But some how it is not executing that class while intializing. That getting below exception:

org.omg.CORBA.COMM_FAILURE: vmcid: SUN minor code: 201 completed: No


I dont know how to go about it.

Pls suggest to to procede.
I am giving below code snippet of my java program:

props.setProperty("org.omg.PortableInterceptor.ORBInitializerClass.com.abc.abc1.abc2.access.abc3.Abc3ValidationService", "");

props.put("org.omg.CORBA.ORBClass", "com.sun.corba.se.internal.iiop.ORB");

props.put("org.omg.CORBA.ORBSingletonClass", "com.sun.corba.se.internal.iiop.ORB");

orb.init(args,props);

Andy Piper

unread,
Jan 7, 2005, 2:43:32 PM1/7/05
to
Madhavi Vemuri <noad...@noaddress.given> writes:

> props.setProperty("org.omg.PortableInterceptor.ORBInitializerClass.com.abc.abc1.abc2.access.abc3.Abc3ValidationService", "");
>
> props.put("org.omg.CORBA.ORBClass", "com.sun.corba.se.internal.iiop.ORB");
>
> props.put("org.omg.CORBA.ORBSingletonClass", "com.sun.corba.se.internal.iiop.ORB");

These are the wrong classes for JDK 1.4. The ORBSingletonClass needs
to be set on the command-line. You can find the correct names here:

http://e-docs.bea.com/wls/docs81/notes/issues.html#1155566

andy

0 new messages