Problem:
- Product: BES 5.x and 6.x
- JDK: Sun JDK 1.3.x and 1.4.x
- Component: Web Container and Visibroker ORB
The web application calling CORBA service fails at following line with InvalidName exception:
rootObj = orb.resolve_initial_references("NameService");
Error reported in partition log is:
Cannot resolve initial reference "NamingService"
org.omg.CORBA.ORBPackage.InvalidName
at com.inprise.vbroker.orb.ORB.resolve_initial_references(ORB.java:946)
...
If you receive an error message of "Cannot resolve initial reference" when invoking CORBA service from a BES web application, you will need to apply the solution provided below.
Resolution:
Please ensure you are not initializing ORB using ORB.init() call. Instead you should obtain ORB from webcontainer using following code:
javax.naming.Context context = new javax.naming.InitialContext();
org.omg.CORBA.ORB orb = (com.inprise.vbroker.orb.ORB) context.lookup("java:comp/ORB");
org.omg.CORBA.Object rootObj = orb.resolve_initial_references("NameService");
#Security
#VisiBroker
#NamingService
#InvalidName