You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Victor Batista <vb...@present-technologies.com> on 2003/10/14 13:21:53 UTC
Commons-Logging NullPointerException
Hello!
I am having some problems using Commons-Logging. I think this is a class
loading issue. Any help would be welcome.
When I run my program, which uses commons-logging indirectly (My program
uses the Quartz package, which uses commons-logging), everything works fine
on Windows and Linux (7.2 & 9.0). Now I have developed a watchdog module,
and my application is launched through it. The Watchdog uses the
Class.forName(...) to create the instance of my original application. With
this combination, I get the exception which is at the end of the email, only
on RedHat 9.0 (On Windows and RedHat 7.2 everityhing works fine). I have
tried with J2SDK 1.4.1, 1.4.2 and 1.4.2_01.
Any help would be really appreciated. Thanks in advance,
Victor Batista
* Nested Exception (Underlying Cause) ---------------
org.apache.commons.logging.LogConfigurationException:
java.lang.NullPointerException
at
org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:558)
at
org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:355)
at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:390)
at org.quartz.core.QuartzScheduler.getLog(QuartzScheduler.java:188)
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: Commons-Logging NullPointerException
Posted by "Craig R. McClanahan" <cr...@apache.org>.
José Antonio Pérez Testa wrote:
> I have to set the property when deploying in a tomcat 4.1 with JDK 1.4.
> My application ear includes commons-logging and log4j jars in its lib
> directory.
> Tomcat lib directory also includes commons-logging.jar
> Unfortunately commons-logging was unable to find any logger other than
> jdk 1.4 logger.
> Configuring that property ( although in a deprecated way, as you
> point :( ) brought my log4j logs back again!
> I think that was also a classloader issue!
More likely you're not using the right version of commons-logging (a
*critically* important detail in reporting problems is what version of
the software you are actually using). Version 1.0.3 is current, and was
released precisely to deal with class loading issues.
That being said, Log4JCategoryLog is deprecated, and not being
maintained. You're just asking for other kinds of trouble by continuing
to use it. You should really be using
"org.apache.commons.logging.impl.Log4JLogger" instead.
Craig
>
> Thanks all!
>
> Craig R. McClanahan wrote:
>
>> José Antonio Pérez Testa wrote:
>>
>>> Try defining the property explicitly:
>>>
>>> java
>>> -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategoryLog
>>> foo.bar.yourClass
>>
>>
>>
>>
>> While you can certainly set properties like this, the particular
>> class you propose here (Log4JCategoryLog) has been deprecated. You
>> should be using Log4JLogger if you're logging with Log4J -- but,
>> commons-logging will select that for you automatically if Log4J is in
>> the class path, so you should not need to configure it.
>>
>>>
>>>
>>> in the java launcher!
>>
>>
>>
>> Craig
>>
>>>
>>>
>>> Victor Batista wrote:
>>>
>>>> Hello!
>>>> I am having some problems using Commons-Logging. I think this
>>>> is a class
>>>> loading issue. Any help would be welcome.
>>>>
>>>> When I run my program, which uses commons-logging indirectly
>>>> (My program
>>>> uses the Quartz package, which uses commons-logging), everything
>>>> works fine
>>>> on Windows and Linux (7.2 & 9.0). Now I have developed a watchdog
>>>> module,
>>>> and my application is launched through it. The Watchdog uses the
>>>> Class.forName(...) to create the instance of my original
>>>> application. With
>>>> this combination, I get the exception which is at the end of the
>>>> email, only
>>>> on RedHat 9.0 (On Windows and RedHat 7.2 everityhing works fine). I
>>>> have
>>>> tried with J2SDK 1.4.1, 1.4.2 and 1.4.2_01.
>>>>
>>>> Any help would be really appreciated. Thanks in advance,
>>>> Victor Batista
>>>>
>>>>
>>>> * Nested Exception (Underlying Cause) ---------------
>>>> org.apache.commons.logging.LogConfigurationException:
>>>> java.lang.NullPointerException
>>>> at
>>>> org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:558)
>>>> at
>>>> org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:355)
>>>> at
>>>> org.apache.commons.logging.LogFactory.getLog(LogFactory.java:390)
>>>> at
>>>> org.quartz.core.QuartzScheduler.getLog(QuartzScheduler.java:188)
>>>>
>>>>
>>>>
>>>> ---------------------------------------------------------------------
>>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>>
>>>>
>>>>
>>>
>>> -------------------------------------------------------------------------------------------------------------------
>>>
>>> Este correo electrsnico y, en su caso, cualquier fichero anexo al
>>> mismo, contiene informacisn de caracter confidencial exclusivamente
>>> dirigida a su destinatario o destinatarios. Queda prohibida su
>>> divulgacisn, copia o distribucisn a terceros sin la previa
>>> autorizacisn escrita de Indra. En el caso de haber recibido este
>>> correo electrsnico por error, se ruega notificar inmediatamente esta
>>> circunstancia mediante reenvmo a la direccisn electrsnica del
>>> remitente.
>>>
>>> The information in this e-mail and in any attachments is
>>> confidential and solely for the attention and use of the named
>>> addressee(s). You are hereby notified that any dissemination,
>>> distribution or copy of this communication is prohibited without the
>>> prior written consent of Indra. If you have received this
>>> communication in error, please, notify the sender by reply e-mail
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>
> -------------------------------------------------------------------------------------------------------------------
>
> Este correo electrónico y, en su caso, cualquier fichero anexo al
> mismo, contiene información de carácter confidencial exclusivamente
> dirigida a su destinatario o destinatarios. Queda prohibida su
> divulgación, copia o distribución a terceros sin la previa
> autorización escrita de Indra. En el caso de haber recibido este
> correo electrónico por error, se ruega notificar inmediatamente esta
> circunstancia mediante reenvío a la dirección electrónica del remitente.
>
> The information in this e-mail and in any attachments is confidential
> and solely for the attention and use of the named addressee(s). You
> are hereby notified that any dissemination, distribution or copy of
> this communication is prohibited without the prior written consent of
> Indra. If you have received this communication in error, please,
> notify the sender by reply e-mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: Commons-Logging NullPointerException
Posted by José Antonio Pérez Testa <ja...@indra.es>.
I have to set the property when deploying in a tomcat 4.1 with JDK 1.4.
My application ear includes commons-logging and log4j jars in its lib
directory.
Tomcat lib directory also includes commons-logging.jar
Unfortunately commons-logging was unable to find any logger other than
jdk 1.4 logger.
Configuring that property ( although in a deprecated way, as you point
:( ) brought my log4j logs back again!
I think that was also a classloader issue!
Thanks all!
Craig R. McClanahan wrote:
> José Antonio Pérez Testa wrote:
>
>> Try defining the property explicitly:
>>
>> java
>> -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategoryLog
>> foo.bar.yourClass
>
>
>
> While you can certainly set properties like this, the particular class
> you propose here (Log4JCategoryLog) has been deprecated. You should
> be using Log4JLogger if you're logging with Log4J -- but,
> commons-logging will select that for you automatically if Log4J is in
> the class path, so you should not need to configure it.
>
>>
>>
>> in the java launcher!
>
>
> Craig
>
>>
>>
>> Victor Batista wrote:
>>
>>> Hello!
>>> I am having some problems using Commons-Logging. I think this is
>>> a class
>>> loading issue. Any help would be welcome.
>>>
>>> When I run my program, which uses commons-logging indirectly (My
>>> program
>>> uses the Quartz package, which uses commons-logging), everything
>>> works fine
>>> on Windows and Linux (7.2 & 9.0). Now I have developed a watchdog
>>> module,
>>> and my application is launched through it. The Watchdog uses the
>>> Class.forName(...) to create the instance of my original
>>> application. With
>>> this combination, I get the exception which is at the end of the
>>> email, only
>>> on RedHat 9.0 (On Windows and RedHat 7.2 everityhing works fine). I
>>> have
>>> tried with J2SDK 1.4.1, 1.4.2 and 1.4.2_01.
>>>
>>> Any help would be really appreciated. Thanks in advance,
>>> Victor Batista
>>>
>>>
>>> * Nested Exception (Underlying Cause) ---------------
>>> org.apache.commons.logging.LogConfigurationException:
>>> java.lang.NullPointerException
>>> at
>>> org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:558)
>>> at
>>> org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:355)
>>> at
>>> org.apache.commons.logging.LogFactory.getLog(LogFactory.java:390)
>>> at
>>> org.quartz.core.QuartzScheduler.getLog(QuartzScheduler.java:188)
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>>
>>>
>>>
>>
>> -------------------------------------------------------------------------------------------------------------------
>>
>> Este correo electrsnico y, en su caso, cualquier fichero anexo al
>> mismo, contiene informacisn de caracter confidencial exclusivamente
>> dirigida a su destinatario o destinatarios. Queda prohibida su
>> divulgacisn, copia o distribucisn a terceros sin la previa
>> autorizacisn escrita de Indra. En el caso de haber recibido este
>> correo electrsnico por error, se ruega notificar inmediatamente esta
>> circunstancia mediante reenvmo a la direccisn electrsnica del remitente.
>>
>> The information in this e-mail and in any attachments is confidential
>> and solely for the attention and use of the named addressee(s). You
>> are hereby notified that any dissemination, distribution or copy of
>> this communication is prohibited without the prior written consent of
>> Indra. If you have received this communication in error, please,
>> notify the sender by reply e-mail
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
-------------------------------------------------------------------------------------------------------------------
Este correo electrónico y, en su caso, cualquier fichero anexo al mismo, contiene información de carácter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgación, copia o distribución a terceros sin la previa autorización escrita de Indra. En el caso de haber recibido este correo electrónico por error, se ruega notificar inmediatamente esta circunstancia mediante reenvío a la dirección electrónica del remitente.
The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: Commons-Logging NullPointerException
Posted by "Craig R. McClanahan" <cr...@apache.org>.
José Antonio Pérez Testa wrote:
> Try defining the property explicitly:
>
> java
> -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategoryLog
> foo.bar.yourClass
While you can certainly set properties like this, the particular class
you propose here (Log4JCategoryLog) has been deprecated. You should be
using Log4JLogger if you're logging with Log4J -- but, commons-logging
will select that for you automatically if Log4J is in the class path, so
you should not need to configure it.
>
>
> in the java launcher!
Craig
>
>
> Victor Batista wrote:
>
>> Hello!
>> I am having some problems using Commons-Logging. I think this is
>> a class
>> loading issue. Any help would be welcome.
>>
>> When I run my program, which uses commons-logging indirectly (My
>> program
>> uses the Quartz package, which uses commons-logging), everything
>> works fine
>> on Windows and Linux (7.2 & 9.0). Now I have developed a watchdog
>> module,
>> and my application is launched through it. The Watchdog uses the
>> Class.forName(...) to create the instance of my original application.
>> With
>> this combination, I get the exception which is at the end of the
>> email, only
>> on RedHat 9.0 (On Windows and RedHat 7.2 everityhing works fine). I have
>> tried with J2SDK 1.4.1, 1.4.2 and 1.4.2_01.
>>
>> Any help would be really appreciated. Thanks in advance,
>> Victor Batista
>>
>>
>> * Nested Exception (Underlying Cause) ---------------
>> org.apache.commons.logging.LogConfigurationException:
>> java.lang.NullPointerException
>> at
>> org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:558)
>> at
>> org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:355)
>> at
>> org.apache.commons.logging.LogFactory.getLog(LogFactory.java:390)
>> at
>> org.quartz.core.QuartzScheduler.getLog(QuartzScheduler.java:188)
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>
>>
>
> -------------------------------------------------------------------------------------------------------------------
>
> Este correo electrsnico y, en su caso, cualquier fichero anexo al
> mismo, contiene informacisn de caracter confidencial exclusivamente
> dirigida a su destinatario o destinatarios. Queda prohibida su
> divulgacisn, copia o distribucisn a terceros sin la previa
> autorizacisn escrita de Indra. En el caso de haber recibido este
> correo electrsnico por error, se ruega notificar inmediatamente esta
> circunstancia mediante reenvmo a la direccisn electrsnica del remitente.
>
> The information in this e-mail and in any attachments is confidential
> and solely for the attention and use of the named addressee(s). You
> are hereby notified that any dissemination, distribution or copy of
> this communication is prohibited without the prior written consent of
> Indra. If you have received this communication in error, please,
> notify the sender by reply e-mail
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: Commons-Logging NullPointerException
Posted by José Antonio Pérez Testa <ja...@indra.es>.
Try defining the property explicitly:
java -Dorg.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JCategoryLog foo.bar.yourClass
in the java launcher!
Victor Batista wrote:
>Hello!
> I am having some problems using Commons-Logging. I think this is a class
>loading issue. Any help would be welcome.
>
> When I run my program, which uses commons-logging indirectly (My program
>uses the Quartz package, which uses commons-logging), everything works fine
>on Windows and Linux (7.2 & 9.0). Now I have developed a watchdog module,
>and my application is launched through it. The Watchdog uses the
>Class.forName(...) to create the instance of my original application. With
>this combination, I get the exception which is at the end of the email, only
>on RedHat 9.0 (On Windows and RedHat 7.2 everityhing works fine). I have
>tried with J2SDK 1.4.1, 1.4.2 and 1.4.2_01.
>
> Any help would be really appreciated. Thanks in advance,
> Victor Batista
>
>
>* Nested Exception (Underlying Cause) ---------------
>org.apache.commons.logging.LogConfigurationException:
>java.lang.NullPointerException
> at
>org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:558)
> at
>org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:355)
> at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:390)
> at org.quartz.core.QuartzScheduler.getLog(QuartzScheduler.java:188)
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
>
-------------------------------------------------------------------------------------------------------------------
Este correo electr�nico y, en su caso, cualquier fichero anexo al mismo, contiene informaci�n de car�cter confidencial exclusivamente dirigida a su destinatario o destinatarios. Queda prohibida su divulgaci�n, copia o distribuci�n a terceros sin la previa autorizaci�n escrita de Indra. En el caso de haber recibido este correo electr�nico por error, se ruega notificar inmediatamente esta circunstancia mediante reenv�o a la direcci�n electr�nica del remitente.
The information in this e-mail and in any attachments is confidential and solely for the attention and use of the named addressee(s). You are hereby notified that any dissemination, distribution or copy of this communication is prohibited without the prior written consent of Indra. If you have received this communication in error, please, notify the sender by reply e-mail
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
Re: Commons-Logging NullPointerException
Posted by "Craig R. McClanahan" <cr...@apache.org>.
Victor Batista wrote:
>Hello!
> I am having some problems using Commons-Logging. I think this is a class
>loading issue. Any help would be welcome.
>
> When I run my program, which uses commons-logging indirectly (My program
>uses the Quartz package, which uses commons-logging), everything works fine
>on Windows and Linux (7.2 & 9.0). Now I have developed a watchdog module,
>and my application is launched through it. The Watchdog uses the
>Class.forName(...) to create the instance of my original application. With
>this combination, I get the exception which is at the end of the email, only
>on RedHat 9.0 (On Windows and RedHat 7.2 everityhing works fine). I have
>tried with J2SDK 1.4.1, 1.4.2 and 1.4.2_01.
>
> Any help would be really appreciated. Thanks in advance,
>
It would help if you told us which version of commons-logging you are
using :-). It appears not to be 1.0.3 (because line 558 is in the
middle of a declaration), so upgrading to that is the first piece of advice.
It is also important to know which underlying logging system you are
trying to use (I presume you want to use JDK 1.4 logging, because the
JVMs you quote are all 1.4.x), an any configuration properties you are
setting.
> Victor Batista
>
>
Craig
>
>* Nested Exception (Underlying Cause) ---------------
>org.apache.commons.logging.LogConfigurationException:
>java.lang.NullPointerException
> at
>org.apache.commons.logging.LogFactory.newFactory(LogFactory.java:558)
> at
>org.apache.commons.logging.LogFactory.getFactory(LogFactory.java:355)
> at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:390)
> at org.quartz.core.QuartzScheduler.getLog(QuartzScheduler.java:188)
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org