Hi All,

I've solved it. It was my fault. Under my restrictive security configuration (-Djava.security.manager==myjava.policy) I forgot to give these permissions:

 permission java.util.PropertyPermission "*", "read,write";
 permission java.lang.RuntimePermission "setIO";

The System.getProperties() needs to have the previous PropertyPermission to be able to load all the properties. Also the RuntimePermission "setIO" was required if redirecting the console (System.setOut)

The code that was throwing the Exception is the following, but no security exception was on the stack trace.

public class LoggingConfiguration extends ConfigurationAbstractImpl {
...
...
...
 protected void load() {
   Logger bootLogger = LoggerFactory.getBootLogger();

   // first we check whether the system property
   //   org.apache.ojb.broker.util.logging.Logger
   // is set (or its alias LoggerClass which is deprecated)
   ClassLoader contextLoader   = ClassHelper.getClassLoader();
   String      loggerClassName = null;

   _loggerClass      = null;
   properties        = new Properties();
   loggerClassName   = getLoggerClass(System.getProperties());

-->_loggerConfigFile = getLoggerConfigFile(System.getProperties());<---

...
...
...
}


Sean C. McCarthy


Sean C. McCarthy wrote:
Hi,

I'm trying to debug this:

------------------
java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:219)
at org.apache.ojb.broker.util.ClassHelper.getClass(Unknown Source)
at org.apache.ojb.broker.util.ClassHelper.getClass(Unknown Source)
at org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown Source)
at org.apache.ojb.broker.util.configuration.impl.ConfigurationAbstractImpl.getClass(Unknown Source)
at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.init(Unknown Source)
at org.apache.ojb.broker.core.PersistenceBrokerFactoryFactory.<clinit>(Unknown Source)
at org.apache.ojb.broker.PersistenceBrokerFactory.createPersistenceBroker(Unknown Source)
...
...
...


Caused by: java.lang.NullPointerException
at org.apache.ojb.broker.util.logging.LoggerFactoryImpl.getLogger(Unknown Source)
at org.apache.ojb.broker.util.logging.LoggerFactory.getLogger(Unknown Source)
at org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl.<clinit>(Unknown Source)
... 77 more
-------------------------------


The code runs fine with permission AllPermission but it fails to do under the following configuration related to OJB:

// Java Policy
// For "JVM pre-1.4 access bug workaround die to
// restrictive security manager" Exception
permission java.lang.reflect.ReflectPermission "suppressAccessChecks";
// Several other permissions
permission java.io.FilePermission "<<ALL FILES>>", "read";
permission java.util.PropertyPermission "*", "read";
permission java.lang.RuntimePermission "createClassLoader";
permission java.lang.RuntimePermission "getClassLoader";
permission java.lang.RuntimePermission "accessClassInPackage.*";
permission java.lang.RuntimePermission "defineClassInPackage.*";
permission java.lang.RuntimePermission "accessDeclaredMembers";
permission java.lang.RuntimePermission "getClassLoader";

I tried to pass the OJB-logging.properties file as a java property, but it doesn't help.

I would say it is a policy configuration problem since it only happens when the policy permissions are restricted. With AllPermission it runs just fine.

I'm using sun-jvm 1.4.2_06 and OJB 1.0.1. I haven't been able to track this down. Any information would be appreciated.

    Sean C. McCarthy

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to