I've done a lot of research but I still need some help dealing with class
loading & classpath setting with Orion.

The bottom line appears to be: How do I use Orion to set a classpath that
sun.misc.Launcher$AppClassLoader can see?


Details:
It appears that org.omg.CORBA.ORB is always used to init the ORB - it has
code that honors the orb.properties settings to instantiate the chosen orb
implementation.  OK.

But, when org.omg.CORBA.ORB runs it uses sun.misc.Launcher$AppClassLoader
as the class loader.  I'm guessing that this loader doesn't know about the
vbjorb.jar file placed in \orion\lib, which is why this error results:

java.lang.ExceptionInInitializerError: org.omg.CORBA.INITIALIZE:
can't instantiate default ORB implementation com.visigenic.vbroker.orb.ORB
minor code: 0  completed: No
 at org.omg.CORBA.ORB.create_impl(ORB.java:305)
 at org.omg.CORBA.ORB.<clinit>(ORB.java:202)

So, how do I set a classpath that sun.misc.Launcher$AppClassLoader can see?

If it helps make this any clearer here is the relevant code from
org.omg.CORBA.ORB:

    private static ORB create_impl(String className, ClassLoader cl) {
        try {
            return (ORB) Class.forName(className).newInstance();
 } catch (ClassNotFoundException ex) {
     // Eat the exception and try again below...
        } catch (Exception ex) {
     throw new INITIALIZE(                 /* <<<<<<<<<<<<<  line 305 */
              "can't instantiate default ORB implementation " + className);

        }
        try {
            return (ORB) Class.forName(className, true, cl).newInstance();
        } catch (Exception ex) {
     throw new INITIALIZE(
              "can't instantiate default ORB implementation " + className);

        }
    }

Rich Holladay wrote:

> We use Visibroker for CORBA, instead of the 1.2 sun.* packages.  In
> order to start our CORBA implementation under vbroker instead of sun we
> needed to add an orb.properties file in JDK1.2.2\jre\lib containing:
>
> # Make VisiBroker for Java the default ORB
> org.omg.CORBA.ORBClass=com.visigenic.vbroker.orb.ORB
> org.omg.CORBA.ORBSingletonClass=com.visigenic.vbroker.orb.ORB
>
> When I run the application under Orion that accesses the CORBA
> implementation it is trying to use the com.sun.CORBA.iiop.ORB.  When we
> run it under Apache/JServ it uses com.visigenic.vbroker.orb.ORB.
>
> I don't think anything needed to be done to get JServ to use the
> visigenic classes, aside from creating the orb.properties file as
> mentioned above.
>
> The vbroker jar files are in orion\lib - which I understand is scanned
> for jars/zips to include at startup.
>
> What am I missing in configuring Orion to use the right classes?
>
> Thanks

Reply via email to