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
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
--
Thanks, Andy, this way works. Zzou
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...
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
"Vladislav Vladimirov" <ch...@bastun.net> wrote in message
news:4061b404$1...@newsgroups.bea.com...
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);
> 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