Hi Thomas
*_loggerClass = Log4jLoggerImpl.class;* crash when LogingConfiguration , it could seem surprising but it is sure.
The problem arrive when PersistenceBrokerFactoryBaseImpl make LogFactory.getLogger getLogger make first a "new LogingConfiguration()" Which call the load() method in it's constructor.
The crash arrive exactly *in LogingConfiguration.java, line 161*.
This is probably linked to the fact that dbManager is a JINI service.
I have added :
System.out.println("yep, so use log4j");
_loggerClass = Log4jLoggerImpl.class;
_loggerConfigFile = "log4j.properties";
System.out.println("After yep, so use log4j");and you can see below that it crash just after yep, so use log4j
The debug build give no information here, because debug use logger which does not load.
I have tried first to get debug working, but *this stack come from release compile with jar-debug.*
That is why I have been obliged to add debug messages.
If you look at the stack below :
Load of *ojbLoggingPropFile fail first* : Load of *ojbPropFile fail also*.
Do we need to adapt our application to support new logging elements ? Any idea welcome.
Thanks for your help.
Andre
I have controlled, Log4jLoggerImpl.class is present in my JINI service jar.
STARTING DBMANAGER !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
[BOOT] WARN: Value "org.apache.ojb.odmg.collections.DListImpl_2" is illegal for key "OqlCollectionClass" (should be a class, using default value class org.apache.ojb.odmg.collections.DListImpl)
BEGIN getLogger org.apache.ojb.broker.core.PersistenceBrokerFactoryBaseImpl
New LoggingConfiguration
LoggingConfiguration load oggerFactory.getBootLogger
LoggingConfiguration load ClassHelper.getClassLoader
LoggingConfiguration load loggerClassName == null trying to load the OJB-logging.properties
LoggingConfiguration load ojbLoggingPropFile = OJB-logging.properties
LoggingConfiguration contextLoader
LoggingConfiguration contextLoader.getResourceAsStream(OJB-logging.properties)
Found logging properties file OJB-logging.properties
LoggingConfiguration load ojbLoggingPropFile exception java.lang.NullPointerException
LoggingConfiguration load loggerClassName == null deprecated: load the OJB.properties file
LoggingConfiguration load ojbPropFile = OJB.properties
LoggingConfiguration contextLoader.getResourceAsStream(OJB.properties)
Found OJB properties file OJB.properties
LoggingConfiguration load ojbPropFile exception java.lang.NullPointerException
still no logger configured - lets check whether commons-logging is configured
but perhaps there is a log4j.properties file ?
yep, so use log4j
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.defaultPersistenceBroker(Unknown Source)
at org.compiere.mfg_scm.dbManager.TaskConsumer.<init>(Unknown Source)
at org.compiere.mfg_scm.dbManager.DbManagerImpl.createTaskConsumer(Unknown Source)
at org.compiere.mfg_scm.dbManager.DbManagerImpl.addTaskConsumer(Unknown Source)
at org.compiere.mfg_scm.dbManager.DbManagerImpl.initialize(Unknown Source)
at com.sun.rio.jsb.ServiceBeanAdapter.doStart(ServiceBeanAdapter.java:277)
at com.sun.rio.jsb.ServiceBeanAdapter.access$000(ServiceBeanAdapter.java:101)
at com.sun.rio.jsb.ServiceBeanAdapter$1.run(ServiceBeanAdapter.java:237)
at com.sun.rio.jsb.ServiceBeanAdapter.start(ServiceBeanAdapter.java:248)
at com.sun.rio.boot.ServiceBeanLoader.load(ServiceBeanLoader.java:171)
at com.sun.rio.cybernode.JSBDelegate$2.run(JSBDelegate.java:342)
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)
... 19 more
Thomas Dudziak wrote:
A Leg wrote:
Hi Thomas
In fact I have been obliged to add System.out element in code to be able to get a trace.
Now I have a full trace.
But I still don't know what to do to solve my problem.
Please use a debug build of OJB, otherwise its hard to tell where the NullPointerException occurs. You can simply run the OJB build.xml file with the target jar-debug, then copy the created OJB jar from the dist folder over the one in your project. BTW, which version of OJB do you use ?
Also, if you are able to set system properties for your project (in a normal app you would use the -D commandline switch of the java executable), then you can change the log level of the boot loggerto INFO or DEBUG to see more log messages via the OJB.bootLogLevel system property.
Tom
--------------------------------------------------------------------- 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]
