You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Pierre Goupil <go...@gmail.com> on 2006/11/22 17:51:28 UTC

Tomcat & Log4j

Hi all !

I once had a Tomcat 5.5 and an Eclipse 3.2 that where running just fine and
then... the HDD crashed... I suffered no data lost but since then, I can't
start Tomcat anymore. The "server" view of Eclipse gives me the following
trace :


********************************
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: com.sun.org.apache.commons.logging.LogConfigurationException:
com.sun.org.apache.commons.logging.LogConfigurationException :
java.lang.NullPointerException (Caused by java.lang.NullPointerException)
(Caused by com.sun.org.apache.commons.logging.LogConfigurationException:
java.lang.NullPointerException (Caused by java.lang.NullPointerException ))
    at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.newInstance(
LogFactoryImpl.java:543)
    at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
LogFactoryImpl.java:235)
    at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getInstance (
LogFactoryImpl.java:209)
    at com.sun.org.apache.commons.logging.LogFactory.getLog(LogFactory.java
:351)
    at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:73)
Caused by: com.sun.org.apache.commons.logging.LogConfigurationException :
java.lang.NullPointerException (Caused by java.lang.NullPointerException)
    at
com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(
LogFactoryImpl.java:397)
    at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.newInstance (
LogFactoryImpl.java:529)
    ... 4 more
Caused by: java.lang.NullPointerException
    at
com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(
LogFactoryImpl.java:374)
    ... 5 more
********************************

I eventually felt into Commons-logging / Log4j neighborhood jam ! The log
system of my servlet (Log4j) doesn't work anymore, but I don't bother
because it doesn't start anyway. But, regarding Tomcat's log system
re-launching, it's an usual concern : lots of people talk about that. But
neither them nor me can find a solution. Of course I've found a lot of
tutorials, but they can't help...

I have re-installed my workstation, indeed.

I've tried to launch Tomcat via another plugin, too. I gave Sysdeo a try :
Tomcat runs, loads the servlet, but doesn't run it and keeps quiet. No
servlet log, no exception, no result ("resource unavailable").

If someone could help me find a definitive answer to that classical
question... (other than "42", of course ;-).

Thanx a lot and excuse me for my poor English, I'm a little froggie.


Pierre

-- 
"L'une des raisons pour lesquelles la vie est complexe
C'est qu'elle a une partie réelle et une partie imaginaire."

Re: Tomcat & Log4j

Posted by Pierre Goupil <go...@gmail.com>.
Hi !

Yes, of course ! I'm using WTP's "server" view. And I would like to be able
to launch Tomcat from it again.

Pierre

-- 
"L'une des raisons pour lesquelles la vie est complexe
C'est qu'elle a une partie réelle et une partie imaginaire."

Re: Tomcat & Log4j

Posted by olivier nouguier <ol...@gmail.com>.
Hi pierre,
 Simply what is your question ?
 Did you try wtp ?


On 11/22/06, Pierre Goupil <go...@gmail.com> wrote:
> Hi all !
>
> I once had a Tomcat 5.5 and an Eclipse 3.2 that where running just fine and
> then... the HDD crashed... I suffered no data lost but since then, I can't
> start Tomcat anymore. The "server" view of Eclipse gives me the following
> trace :
>
>
> ********************************
> Exception in thread "main" java.lang.ExceptionInInitializerError
> Caused by: com.sun.org.apache.commons.logging.LogConfigurationException:
> com.sun.org.apache.commons.logging.LogConfigurationException :
> java.lang.NullPointerException (Caused by java.lang.NullPointerException)
> (Caused by com.sun.org.apache.commons.logging.LogConfigurationException:
> java.lang.NullPointerException (Caused by java.lang.NullPointerException ))
>     at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.newInstance(
> LogFactoryImpl.java:543)
>     at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
> LogFactoryImpl.java:235)
>     at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getInstance (
> LogFactoryImpl.java:209)
>     at com.sun.org.apache.commons.logging.LogFactory.getLog(LogFactory.java
> :351)
>     at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:73)
> Caused by: com.sun.org.apache.commons.logging.LogConfigurationException :
> java.lang.NullPointerException (Caused by java.lang.NullPointerException)
>     at
> com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(
> LogFactoryImpl.java:397)
>     at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.newInstance (
> LogFactoryImpl.java:529)
>     ... 4 more
> Caused by: java.lang.NullPointerException
>     at
> com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(
> LogFactoryImpl.java:374)
>     ... 5 more
> ********************************
>
> I eventually felt into Commons-logging / Log4j neighborhood jam ! The log
> system of my servlet (Log4j) doesn't work anymore, but I don't bother
> because it doesn't start anyway. But, regarding Tomcat's log system
> re-launching, it's an usual concern : lots of people talk about that. But
> neither them nor me can find a solution. Of course I've found a lot of
> tutorials, but they can't help...
>
> I have re-installed my workstation, indeed.
>
> I've tried to launch Tomcat via another plugin, too. I gave Sysdeo a try :
> Tomcat runs, loads the servlet, but doesn't run it and keeps quiet. No
> servlet log, no exception, no result ("resource unavailable").
>
> If someone could help me find a definitive answer to that classical
> question... (other than "42", of course ;-).
>
> Thanx a lot and excuse me for my poor English, I'm a little froggie.
>
>
> Pierre
>
> --
> "L'une des raisons pour lesquelles la vie est complexe
> C'est qu'elle a une partie réelle et une partie imaginaire."
>


-- 
"Souviens-toi qu'au moment de ta naissance tout le monde était dans la
joie et toi dans les pleurs.
 Vis de manière qu'au moment de ta mort, tout le monde soit dans les
pleurs et toi dans la joie."

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat & Log4j

Posted by Pierre Goupil <go...@gmail.com>.
Hi !

Inline

2006/11/23, David Smith <dn...@cornell.edu>:
>
> I've read the entire thread and decided to go back to the original post
> for a re-read.


Yes, thank you !



Have you considered the possibility that your tomcat (or wtp) install
> has suffered some corruption during the HD crash?  You might want to try
> backing up the current setup, then re-install and add back in your
> webapp and other customizations.  Test at various places along the way
> until it all works or breaks.  If a fresh install works and then breaks
> after adding something back in, you've found the issue.


I'm gonna try this. In fact, this is the first thing I should have done.
Thank you for the advice !

Regards,

Pierre


-- 
"L'une des raisons pour lesquelles la vie est complexe
C'est qu'elle a une partie réelle et une partie imaginaire."

Re: Tomcat & Log4j

Posted by Dirk Wierdemann <Di...@eur.sas.com>.
Hi Pierre,

I recently ran into the same error.

After debugging the application in Eclipse, I saw which package in the
classpath led to the error and could savely delete it from CP. Badabing,
error gone.

Check if it brings you further.

Cheers,
Dirk


Pierre Goupil wrote:
> 
> Hi !
> 
> No, still no way. After a complete re-install I've put a
> log4j.propertiesalternatively in all the places you all told me to,
> but it does nothing :
> still the same exception...
> 
> Here's the file :
> 
> ********* ********* ********* ********* ********* ********* *********
> *********
> #définition du niveau et des Appender du rootLogger
> log4j.rootLogger=WARN,anAppender
> 
> #configuration de "monAppender"
> #nous allons envoyer les messages dans la console de Tomcat
> log4j.appender.anAppender=org.apache.log4j.ConsoleAppender
> 
> #définition du Layout pour "monAppender"
> log4j.appender.anAppender.layout=org.apache.log4j.PatternLayout
> 
> #définition du pattern d'affichage pour "monAppender"
> #voici un exemple de sortie que l'on va obtenir : 2005-06-18 14:53:37
> DEBUG
> [Main] Hello World
> log4j.appender.anAppender.layout.ConversionPattern=%d{MM-dd HH:mm:ss} %-5p
> [%c{1}] %m%n
> ********* ********* ********* ********* ********* ********* *********
> *********
> 
> I've found it in a tuto, so I guess it's corrct.
> 
> At this point I'm starting to think to a
> com.sun.org.apache.commons.loggingbug...
> 
> 
> Regards,
> 
> Pierre
> 
> 
> 
> 2006/11/23, David Smith <dn...@cornell.edu>:
>>
>> I've read the entire thread and decided to go back to the original post
>> for a re-read.
>>
>> Have you considered the possibility that your tomcat (or wtp) install
>> has suffered some corruption during the HD crash?  You might want to try
>> backing up the current setup, then re-install and add back in your
>> webapp and other customizations.  Test at various places along the way
>> until it all works or breaks.  If a fresh install works and then breaks
>> after adding something back in, you've found the issue.
>>
>> As to the location of log4j.properties, the ideal is to place one for
>> the server in server/classes for tomcat's internal classloader and one
>> in each webapp's WEB-INF/classes folder for each webapp's logging.  If
>> you place log4j.properties in common/lib, it becomes the log4j config
>> for all of tomcat -- the server's internal working and your webapps.
>>
>> I would recommend you don't mess with trying to set classpath for tomcat
>> unless you absolutely have to.
>>
>> --David
>>
>> Pierre Goupil wrote:
>> > Hi all !
>> >
>> > I once had a Tomcat 5.5 and an Eclipse 3.2 that where running just
>> > fine and
>> > then... the HDD crashed... I suffered no data lost but since then, I
>> > can't
>> > start Tomcat anymore. The "server" view of Eclipse gives me the
>> following
>> > trace :
>> >
>> >
>> > ********************************
>> > Exception in thread "main" java.lang.ExceptionInInitializerError
>> > Caused by:
>> com.sun.org.apache.commons.logging.LogConfigurationException:
>> > com.sun.org.apache.commons.logging.LogConfigurationException :
>> > java.lang.NullPointerException (Caused by
>> java.lang.NullPointerException
>> )
>> > (Caused by
>> com.sun.org.apache.commons.logging.LogConfigurationException:
>> > java.lang.NullPointerException (Caused by
>> > java.lang.NullPointerException ))
>> >    at
>> com.sun.org.apache.commons.logging.impl.LogFactoryImpl.newInstance
>> (
>> > LogFactoryImpl.java:543)
>> >    at
>> com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getInstance
>> (
>> > LogFactoryImpl.java:235)
>> >    at
>> > com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getInstance (
>> > LogFactoryImpl.java:209)
>> >    at
>> > com.sun.org.apache.commons.logging.LogFactory.getLog(LogFactory.java
>> > :351)
>> >    at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:73)
>> > Caused by:
>> com.sun.org.apache.commons.logging.LogConfigurationException:
>> > java.lang.NullPointerException (Caused by
>> java.lang.NullPointerException
>> )
>> >    at
>> >
>> com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor
>> (
>> > LogFactoryImpl.java:397)
>> >    at
>> > com.sun.org.apache.commons.logging.impl.LogFactoryImpl.newInstance (
>> > LogFactoryImpl.java:529)
>> >    ... 4 more
>> > Caused by: java.lang.NullPointerException
>> >    at
>> >
>> com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor
>> (
>> > LogFactoryImpl.java:374)
>> >    ... 5 more
>> > ********************************
>> >
>> > I eventually felt into Commons-logging / Log4j neighborhood jam ! The
>> log
>> > system of my servlet (Log4j) doesn't work anymore, but I don't bother
>> > because it doesn't start anyway. But, regarding Tomcat's log system
>> > re-launching, it's an usual concern : lots of people talk about that.
>> But
>> > neither them nor me can find a solution. Of course I've found a lot of
>> > tutorials, but they can't help...
>> >
>> > I have re-installed my workstation, indeed.
>> >
>> > I've tried to launch Tomcat via another plugin, too. I gave Sysdeo a
>> > try :
>> > Tomcat runs, loads the servlet, but doesn't run it and keeps quiet. No
>> > servlet log, no exception, no result ("resource unavailable").
>> >
>> > If someone could help me find a definitive answer to that classical
>> > question... (other than "42", of course ;-).
>> >
>> > Thanx a lot and excuse me for my poor English, I'm a little froggie.
>> >
>> >
>> > Pierre
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To start a new topic, e-mail: users@tomcat.apache.org
>> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>> For additional commands, e-mail: users-help@tomcat.apache.org
>>
>>
> 
> 
> -- 
> "L'une des raisons pour lesquelles la vie est complexe
> C'est qu'elle a une partie réelle et une partie imaginaire."
> 
> 

-- 
View this message in context: http://www.nabble.com/Tomcat---Log4j-tf2686289.html#a7757221
Sent from the Tomcat - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Tomcat & Log4j

Posted by Pierre Goupil <go...@gmail.com>.
Hi !

No, still no way. After a complete re-install I've put a
log4j.propertiesalternatively in all the places you all told me to,
but it does nothing :
still the same exception...

Here's the file :

********* ********* ********* ********* ********* ********* *********
*********
#définition du niveau et des Appender du rootLogger
log4j.rootLogger=WARN,anAppender

#configuration de "monAppender"
#nous allons envoyer les messages dans la console de Tomcat
log4j.appender.anAppender=org.apache.log4j.ConsoleAppender

#définition du Layout pour "monAppender"
log4j.appender.anAppender.layout=org.apache.log4j.PatternLayout

#définition du pattern d'affichage pour "monAppender"
#voici un exemple de sortie que l'on va obtenir : 2005-06-18 14:53:37 DEBUG
[Main] Hello World
log4j.appender.anAppender.layout.ConversionPattern=%d{MM-dd HH:mm:ss} %-5p
[%c{1}] %m%n
********* ********* ********* ********* ********* ********* *********
*********

I've found it in a tuto, so I guess it's corrct.

At this point I'm starting to think to a
com.sun.org.apache.commons.loggingbug...


Regards,

Pierre



2006/11/23, David Smith <dn...@cornell.edu>:
>
> I've read the entire thread and decided to go back to the original post
> for a re-read.
>
> Have you considered the possibility that your tomcat (or wtp) install
> has suffered some corruption during the HD crash?  You might want to try
> backing up the current setup, then re-install and add back in your
> webapp and other customizations.  Test at various places along the way
> until it all works or breaks.  If a fresh install works and then breaks
> after adding something back in, you've found the issue.
>
> As to the location of log4j.properties, the ideal is to place one for
> the server in server/classes for tomcat's internal classloader and one
> in each webapp's WEB-INF/classes folder for each webapp's logging.  If
> you place log4j.properties in common/lib, it becomes the log4j config
> for all of tomcat -- the server's internal working and your webapps.
>
> I would recommend you don't mess with trying to set classpath for tomcat
> unless you absolutely have to.
>
> --David
>
> Pierre Goupil wrote:
> > Hi all !
> >
> > I once had a Tomcat 5.5 and an Eclipse 3.2 that where running just
> > fine and
> > then... the HDD crashed... I suffered no data lost but since then, I
> > can't
> > start Tomcat anymore. The "server" view of Eclipse gives me the
> following
> > trace :
> >
> >
> > ********************************
> > Exception in thread "main" java.lang.ExceptionInInitializerError
> > Caused by: com.sun.org.apache.commons.logging.LogConfigurationException:
> > com.sun.org.apache.commons.logging.LogConfigurationException :
> > java.lang.NullPointerException (Caused by java.lang.NullPointerException
> )
> > (Caused by com.sun.org.apache.commons.logging.LogConfigurationException:
> > java.lang.NullPointerException (Caused by
> > java.lang.NullPointerException ))
> >    at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.newInstance
> (
> > LogFactoryImpl.java:543)
> >    at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getInstance
> (
> > LogFactoryImpl.java:235)
> >    at
> > com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getInstance (
> > LogFactoryImpl.java:209)
> >    at
> > com.sun.org.apache.commons.logging.LogFactory.getLog(LogFactory.java
> > :351)
> >    at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:73)
> > Caused by: com.sun.org.apache.commons.logging.LogConfigurationException:
> > java.lang.NullPointerException (Caused by java.lang.NullPointerException
> )
> >    at
> > com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor
> (
> > LogFactoryImpl.java:397)
> >    at
> > com.sun.org.apache.commons.logging.impl.LogFactoryImpl.newInstance (
> > LogFactoryImpl.java:529)
> >    ... 4 more
> > Caused by: java.lang.NullPointerException
> >    at
> > com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor
> (
> > LogFactoryImpl.java:374)
> >    ... 5 more
> > ********************************
> >
> > I eventually felt into Commons-logging / Log4j neighborhood jam ! The
> log
> > system of my servlet (Log4j) doesn't work anymore, but I don't bother
> > because it doesn't start anyway. But, regarding Tomcat's log system
> > re-launching, it's an usual concern : lots of people talk about that.
> But
> > neither them nor me can find a solution. Of course I've found a lot of
> > tutorials, but they can't help...
> >
> > I have re-installed my workstation, indeed.
> >
> > I've tried to launch Tomcat via another plugin, too. I gave Sysdeo a
> > try :
> > Tomcat runs, loads the servlet, but doesn't run it and keeps quiet. No
> > servlet log, no exception, no result ("resource unavailable").
> >
> > If someone could help me find a definitive answer to that classical
> > question... (other than "42", of course ;-).
> >
> > Thanx a lot and excuse me for my poor English, I'm a little froggie.
> >
> >
> > Pierre
> >
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


-- 
"L'une des raisons pour lesquelles la vie est complexe
C'est qu'elle a une partie réelle et une partie imaginaire."

Re: Tomcat & Log4j

Posted by David Smith <dn...@cornell.edu>.
I've read the entire thread and decided to go back to the original post 
for a re-read.

Have you considered the possibility that your tomcat (or wtp) install 
has suffered some corruption during the HD crash?  You might want to try 
backing up the current setup, then re-install and add back in your 
webapp and other customizations.  Test at various places along the way 
until it all works or breaks.  If a fresh install works and then breaks 
after adding something back in, you've found the issue.

As to the location of log4j.properties, the ideal is to place one for 
the server in server/classes for tomcat's internal classloader and one 
in each webapp's WEB-INF/classes folder for each webapp's logging.  If 
you place log4j.properties in common/lib, it becomes the log4j config 
for all of tomcat -- the server's internal working and your webapps.

I would recommend you don't mess with trying to set classpath for tomcat 
unless you absolutely have to.

--David

Pierre Goupil wrote:
> Hi all !
>
> I once had a Tomcat 5.5 and an Eclipse 3.2 that where running just 
> fine and
> then... the HDD crashed... I suffered no data lost but since then, I 
> can't
> start Tomcat anymore. The "server" view of Eclipse gives me the following
> trace :
>
>
> ********************************
> Exception in thread "main" java.lang.ExceptionInInitializerError
> Caused by: com.sun.org.apache.commons.logging.LogConfigurationException:
> com.sun.org.apache.commons.logging.LogConfigurationException :
> java.lang.NullPointerException (Caused by java.lang.NullPointerException)
> (Caused by com.sun.org.apache.commons.logging.LogConfigurationException:
> java.lang.NullPointerException (Caused by 
> java.lang.NullPointerException ))
>    at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.newInstance(
> LogFactoryImpl.java:543)
>    at com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getInstance(
> LogFactoryImpl.java:235)
>    at 
> com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getInstance (
> LogFactoryImpl.java:209)
>    at 
> com.sun.org.apache.commons.logging.LogFactory.getLog(LogFactory.java
> :351)
>    at org.apache.catalina.startup.Bootstrap.<clinit>(Bootstrap.java:73)
> Caused by: com.sun.org.apache.commons.logging.LogConfigurationException :
> java.lang.NullPointerException (Caused by java.lang.NullPointerException)
>    at
> com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(
> LogFactoryImpl.java:397)
>    at 
> com.sun.org.apache.commons.logging.impl.LogFactoryImpl.newInstance (
> LogFactoryImpl.java:529)
>    ... 4 more
> Caused by: java.lang.NullPointerException
>    at
> com.sun.org.apache.commons.logging.impl.LogFactoryImpl.getLogConstructor(
> LogFactoryImpl.java:374)
>    ... 5 more
> ********************************
>
> I eventually felt into Commons-logging / Log4j neighborhood jam ! The log
> system of my servlet (Log4j) doesn't work anymore, but I don't bother
> because it doesn't start anyway. But, regarding Tomcat's log system
> re-launching, it's an usual concern : lots of people talk about that. But
> neither them nor me can find a solution. Of course I've found a lot of
> tutorials, but they can't help...
>
> I have re-installed my workstation, indeed.
>
> I've tried to launch Tomcat via another plugin, too. I gave Sysdeo a 
> try :
> Tomcat runs, loads the servlet, but doesn't run it and keeps quiet. No
> servlet log, no exception, no result ("resource unavailable").
>
> If someone could help me find a definitive answer to that classical
> question... (other than "42", of course ;-).
>
> Thanx a lot and excuse me for my poor English, I'm a little froggie.
>
>
> Pierre
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org