[jacorb-developer] JacORB, endorsed dirs, class loaders and logging
Michael Thaler
michael.thaler2 at googlemail.com
Fri Jan 18 14:50:45 CET 2013
Hi,
we want to replace the standard JDK orb in one of our applications by
JacORB because JacORB is seems to be more robust, gives better error
messages and is more configurable. However, we ran into some problems.
First, to make it as easy as possible to employ our application we prefer
to give a single jar to our customers which they can run using java -jar
without using a custom start script that sets e.g. java.endorsed.dirs. But
this causes some problems. Here is a very simple application that just
creates an orb:
package jacorbjavatest;
import org.omg.CORBA.ORB;
import java.util.Properties;
public class Main {
public static void main(String args[]) throws Exception {
Properties props = System.getProperties();
props.put("org.omg.CORBA.ORBSingletonClass",
"org.jacorb.orb.ORBSingleton");
props.put("org.omg.CORBA.ORBClass", "org.jacorb.orb.ORB");
ORB orb = ORB.init(new String[] {}, props);
}
}
The program uses three libs: jacorb.jar, slf4j-api-1.6.4.jar and
slf4j-jdk14-1.6.4.jar. When I run the program, I get the following error
warnings:
18.01.2013 09:55:55 org.jacorb.config.JacORBConfiguration <init>
WARNUNG: no properties found for configuration jacorb
18.01.2013 09:55:55 org.jacorb.orb.ORBSingleton <init>
INFO: created ORBSingleton
18.01.2013 09:55:55 org.jacorb.orb.ORBSingleton <init>
WARNUNG: OMG.ORB classloader does not match JacORB ORBSingleton
classloader. This may cause problems; see the ProgrammingGuide for further
details
18.01.2013 09:55:55 org.jacorb.config.JacORBConfiguration <init>
WARNUNG: no properties found for configuration jacorb
18.01.2013 09:55:55 org.jacorb.orb.ORBSingleton <init>
INFO: created ORBSingleton
18.01.2013 09:55:55 org.jacorb.orb.ORBSingleton <init>
WARNUNG: OMG.ORB classloader does not match JacORB ORBSingleton
classloader. This may cause problems; see the ProgrammingGuide for further
details
Is there a way to get rid of the warning: WARNUNG: OMG.ORB classloader does
not match JacORB ORBSingleton classloader. This may cause problems; see the
ProgrammingGuide for further details? Will this cause any problems in
practice?
I know I can get rid of the warning by setting
-Djava.endorsed.dirs="c:\Program Files\jacorb-3.2\lib" (or to any other
directory that contains the above listet jars). But is there any other way
to do this that works from within a jar / running jvm?)
In addition, there is another problem: I add a special handler to the java
logger to send log messages over the network. However, setting a handler
using
Logger.getLogger("org.jacorb").addHandler(h)
does not work. I think the reason for this is that the orb is loaded by a
different classloader and thus logs to a different logger. Is there
anything I can do about that?
Best regards,
Michael
More information about the jacorb-developer
mailing list