On Wed, 17 Apr 2002, Jason Dillon wrote:

> >>>Basically what happens is that a parameterless ORB.init() call is 
> >>>performed within a call to ORB.init(args, props). 
> >>>
> >>>Class org.jacorb.orb.ORB handles the call to ORB.init(args, props) and
> >>>indirectly performs the parameterless ORB.init() call, which should
> >>>be relayed to class org.jacorb.orb.ORBSingleton, per specified by a
> >>>system property. It appears that this class is not found... How come? 
> >>>It is in the same jar as the class org.jacorb.orb.ORB...
> >>>
> >>How does it find ORBSingleton?  Might need to use TCL...
> >>
> >
> >Don't know. ORB.init() is in class org.omg.ORB, which is provided by the 
> >JDK. I don't have the source. 
> >
> 
> ic... based on the context above I was assuming ORB.init() was 
> org.jacorb.orb.ORB()... as I know nothing about how iiop/corba works in 
> Java.

ORB.init is a static method of class org.omg.CORBA.ORB. This class is a
standard one and both jacorb and the jdk have implementations if it. 
The ORB.init() method should load an ORB-specific implementation class 
specified by a sysprop. In jacorb's case, it should load the class
org.jacorb.orb.ORBSingleton. 


> >Setting the context classloader might help... Looks like a hack, but is
> >worth a try. 
> >
> 
> JBoss should have already set the TCL, if not then it won't hurt to set 
> it... though it really depends on how the org.omb.ORB class finds the 
> target orb class... if that method does not look at the TCL when loading 
> the class then it will never work.

Yes, JBoss already set the TCL. This is why things work with Sun VMs 
and not with IBM VMs. See below.
> 
> The problem might be very similar to URL problem & protocol handlers, 
> since URL is on the system classpath & does not use the TCL when looking 
> for handler classes, its default mechanism to search for handlers by 
> setting a property can not be used to load JBoss handlers, as they do 
> not (and probably will never) live on the system classpath.

You are right. See below.

> 
> >Must disconnect now... Tomorrow I�ll let you know if TCL worked.
> >
> 
> I bet you can find the source for org.omb.ORB somewhere...

Yes I did. And guess what is the difference between the Sun version and
the IBM version of org.omg.CORBA.ORB...

Sun's ORB.init:

    ClassLoader cl = Thread.currentThread().getContextClassLoader();
    if (cl == null)
        cl = ClassLoader.getSystemClassLoader();

    try {
        return (ORB) Class.forName(className, true, cl).newInstance();
    }
    ...


IBM's ORB.init:

    // Dont use the ContextClassLoader because it would potentially
    // allow an untrusted applet to install the shared singleton ORB.
    // ClassLoader cl = Thread.currentThread().getContextClassLoader();

    ClassLoader cl = ClassLoader.getSystemClassLoader();
    singleton = create_impl(className, cl);

where create_impl(className, cl) does a

    return (ORB) Class.forName(className, true, cl).newInstance();


(The IBM guys commented out the TCL stuff on purpose.)

What now? I cannot see no other way out... Either we require IBM users 
to say 

    export JBOSS_CLASSPATH=$JBOSS_HOME/lib/jacorb.jar

or we hack run.sh to do it for them.

Cheers,

Francisco


_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to