slideharmony | 1 Feb 14:42 2008
Picon

exception on startup


Hello,
this is a newbie question!
when I start Tomcat I get the following exception:

Exception in thread "MultiThreadedHttpConnectionManager cleanup"
java.lang.NullPointerException
	at org.apache.log4j.LogManager.getLogger(LogManager.java:188)
	at org.apache.log4j.Logger.getLogger(Logger.java:104)
	at
org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229)
	at
org.apache.commons.logging.impl.Log4JLogger.isDebugEnabled(Log4JLogger.java:239)
	at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$ReferenceQueueThread.handleReference(MultiThreadedHttpConnectionManager.java:1063)
	at
org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$ReferenceQueueThread.run(MultiThreadedHttpConnectionManager.java:1084)

anybody can help me?
I have put the log4j.xml file in WEB-INF/classes directory!

any help would be appreciated!
thanks

rmura

--

-- 
View this message in context: http://www.nabble.com/exception-on-startup-tp15226846p15226846.html
Sent from the Log4j - Users mailing list archive at Nabble.com.
(Continue reading)

Beth Hechanova | 2 Feb 03:23 2008

logging only one level of messages

I have a log file that I would like only "trace" messages written to it.
However when I create my properties file such that the logger specifies
the trace level, I also get the debug, info, etc. messages in that log
file.  Is there a way to enforce just trace messages?

My properties file looks like:

log4j.category.com.xxx.businesslogic =trace, lcdlog

log4j.appender.lcdlog=org.apache.log4j.FileAppender

log4j.appender.lcdlog.File=/data/logs/lcd.log

log4j.appender.lcdlog.layout=org.apache.log4j.PatternLayout

log4j.appender.lcdlog.layout.ConversionPattern=[%d{MM/dd/yyyy HH:mm:ss}]
%-p - %m%n

And of course I have another appender to handle the other log messages.

Is it possible to set things up in the properties file to only get the
trace messages?

I'm using log4j 1.2.15 on a linux system.

Thanks,

Beth

(Continue reading)

James A. N. Stauffer | 2 Feb 04:10 2008
Picon

Re: logging only one level of messages

With XML config you can use a LevelFilter and put a cap on the level.

On Feb 1, 2008 8:23 PM, Beth Hechanova <bhechanova <at> imsconsultants.com> wrote:
> I have a log file that I would like only "trace" messages written to it.
> However when I create my properties file such that the logger specifies
> the trace level, I also get the debug, info, etc. messages in that log
> file.  Is there a way to enforce just trace messages?
>
>
>
> My properties file looks like:
>
>
>
> log4j.category.com.xxx.businesslogic =trace, lcdlog
>
>
>
> log4j.appender.lcdlog=org.apache.log4j.FileAppender
>
> log4j.appender.lcdlog.File=/data/logs/lcd.log
>
> log4j.appender.lcdlog.layout=org.apache.log4j.PatternLayout
>
> log4j.appender.lcdlog.layout.ConversionPattern=[%d{MM/dd/yyyy HH:mm:ss}]
> %-p - %m%n
>
>
>
> And of course I have another appender to handle the other log messages.
(Continue reading)

Jacob Kjome | 2 Feb 06:22 2008

Re: exception on startup

You say you get this when you start Tomcat?  Looks to me like it's when it's 
shutting down, given the "cleanup" in the message.  Where do you have log4j.jar? 
In WEB-INF/lib?  What version of Tomcat?  There were certain versions of Tomcat 
that were particularly bad about mucking with classloaders and doing aggressive 
cleanup leading to NullPointerExceptions.  Try the latest one.  I know it works 
for me.

Jake

slideharmony wrote:
> Hello,
> this is a newbie question!
> when I start Tomcat I get the following exception:
> 
> Exception in thread "MultiThreadedHttpConnectionManager cleanup"
> java.lang.NullPointerException
> 	at org.apache.log4j.LogManager.getLogger(LogManager.java:188)
> 	at org.apache.log4j.Logger.getLogger(Logger.java:104)
> 	at
> org.apache.commons.logging.impl.Log4JLogger.getLogger(Log4JLogger.java:229)
> 	at
> org.apache.commons.logging.impl.Log4JLogger.isDebugEnabled(Log4JLogger.java:239)
> 	at
> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$ReferenceQueueThread.handleReference(MultiThreadedHttpConnectionManager.java:1063)
> 	at
> org.apache.commons.httpclient.MultiThreadedHttpConnectionManager$ReferenceQueueThread.run(MultiThreadedHttpConnectionManager.java:1084)
> 
> 
> anybody can help me?
> I have put the log4j.xml file in WEB-INF/classes directory!
(Continue reading)

Beth Hechanova | 2 Feb 23:14 2008

RE: logging only one level of messages

I switched my properties file to an xml configuration file and I still
cannot get it to work.  I have tried both the LevelMatchFilter and the
LevelRangeFilter.

Below is my current configuration file:

No matter what I try, I seem to either get nothing in the lcd.log file,
or all messages.  I only want trace messages.

I changed from a LevelMatchFilter b/c I found someone complaining that
it did not work - that the other levels returned "neutral", so they too
match (and indeed were logged to log file).  Then I tried specifying the
rest of the log levels - fatal, error, info, debug with a value of
"false" for AcceptOnMatch.  That didn't work either.

There seems to be something fundamentally that I am missing, but I can't
seem to figure it out.  What is the trick to using either a
LevelMatchFilter or a LevelRangeFilter?

Thanks,

Beth

<?xml version="1.0" encoding="UTF-8" ?>

<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

  <appender name="console" class="org.apache.log4j.ConsoleAppender"> 
(Continue reading)

Curt Arnold | 3 Feb 17:56 2008
Picon

Re: logging only one level of messages


On Feb 2, 2008, at 4:14 PM, Beth Hechanova wrote:

> I switched my properties file to an xml configuration file and I still
> cannot get it to work.  I have tried both the LevelMatchFilter and the
> LevelRangeFilter.
>
>
>
> Below is my current configuration file:
>
> No matter what I try, I seem to either get nothing in the lcd.log  
> file,
> or all messages.  I only want trace messages.
>
>
>
> I changed from a LevelMatchFilter b/c I found someone complaining that
> it did not work - that the other levels returned "neutral", so they  
> too
> match (and indeed were logged to log file).  Then I tried specifying  
> the
> rest of the log levels - fatal, error, info, debug with a value of
> "false" for AcceptOnMatch.  That didn't work either.
>
>
>
> There seems to be something fundamentally that I am missing, but I  
> can't
> seem to figure it out.  What is the trick to using either a
(Continue reading)

Beth Hechanova | 4 Feb 20:41 2008

RE: logging only one level of messages

I had tried adding a DenyAllFilter at one time and I still didn't get
the behavior I was looking for.

Just to be sure, I tried again today several scenarios:
1) The original scenario, using LevelRangeFilter for just TRACE messages
- no output in lcd.log

2) Same, but add DenyAllFilter as suggested.  Again, no output in
lcd.log

3) Change to LevelMatchFilter: LevelToMatch = TRACE; AcceptOnMatch =
true; with DenyAllFilter.  Now I get everything BUT TRACE messages in
lcd.log

4) Same as #3, but remove DenyAllFilter.  Same result

5) Same as #4: LevelToMatch = TRACE; but change AcceptOnMatch to false.
Same result, everything but TRACE in lcd.log

6) Just to be sure there is nothing specifc to TRACE messages, change
LevelTomatch = INFO, AcceptOnMatch to true; include DenyAllFilter.
Again, I get DEBUG messages into lcd.log (as well as the expected INFO
messages), but no TRACE messages.

Any other ideas on what I have set up incorrectly?  Or does this feature
have some problems?

Thanks again,
Beth

(Continue reading)

Beth Hechanova | 4 Feb 21:44 2008

RE: logging only one level of messages

Is there something specific to using the TRACE level logging and the
filters?  What I have now is my lcd.log set to deny ERROR and INFO
messages (there are no FATAL or WARN messages logged anywhere) and to
accept DEBUG and TRACE messages.  I see debug messages in the lcd.log,
but no trace messages, even though there are places in the application
logging via trace().

For completeness, here is my xml config file:  (I have also tried
setting the threshold to TRACE in the lcd.log, but that had no effect).

Beth

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">

  <appender name="console" class="org.apache.log4j.ConsoleAppender"> 
    <param name="Target" value="System.out"/> 
    <param name="Threshold" value="INFO"/> 
    <layout class="org.apache.log4j.PatternLayout"> 
      <param name="ConversionPattern" value="[%d{MM/dd/yyyy HH:mm:ss}]
%-p (%-F:%-L) - %m%n"/> 
    </layout> 
  </appender> 

  <appender name="rolling" class="org.apache.log4j.RollingFileAppender">

    <param name="File" value="/data/logs/pdlg.log"/> 
    <param name="Threshold" value="INFO"/> 
(Continue reading)

Curt Arnold | 4 Feb 22:53 2008
Picon

Re: logging only one level of messages


On Feb 4, 2008, at 2:44 PM, Beth Hechanova wrote:

> Is there something specific to using the TRACE level logging and the
> filters?  What I have now is my lcd.log set to deny ERROR and INFO
> messages (there are no FATAL or WARN messages logged anywhere) and to
> accept DEBUG and TRACE messages.  I see debug messages in the lcd.log,
> but no trace messages, even though there are places in the application
> logging via trace().
>
> For completeness, here is my xml config file:  (I have also tried
> setting the threshold to TRACE in the lcd.log, but that had no  
> effect).
>
> Beth
>

Trace was added in log4j 1.2.12 and had some bugs that were fixed in  
log4j 1.2.13.  Also, commons-logging had trace before log4j and would  
just change all commons.logging trace calls to log4j debug calls.   
Later versions on commons logging are aware that log4j added trace and  
will detect and use it when available.
Duseja, Sushil | 5 Feb 06:46 2008
Picon

Web Service Appender

Hello,

 

I am a newbie as far as web services and log4j are concerned. I want to write a web service appender using Axis and log4j. This appender should be able to call the web service.

 

Here’s what I have done:-

 

1) Created a service named MyService, using Axis, and deployed it successfully in tomcat.

2) Created a remote appender class MyAppender by extending AppenderSkeleton class.

3) Created a main class LogClass having loggers.

4) Created log4j.properties file so as to call MyAppender.

 

While running the main class, it seems as if the append() method is being called multiple times, which in turn creates multiple org.apache.axis.client.Service objects and that leads to the following exception:-

 

message =getBundle(org.apache.axis,org.apache.axis.i18n,resource,null,...)

java.lang.NullPointerException

 

message =loadBundle: Ignoring MissingResourceException: Can't find bundle for base name org.apache.axis.resource, locale en_US

java.lang.NullPointerException

 

message =Created org.apache.axis.i18n.resource, linked to parent null

java.lang.NullPointerException

 

message =getBundle(org.apache.axis,org.apache.axis.i18n,resource,null,...)

 

The program eventually terminates by throwing - Exception in thread "main" java.lang.StackOverflowError

 

 

Moreover, this web service is working absolutely fine when invoked from a class having just a main method. The above problem occurs when the same piece of code is moved inside a private method (executeWebService()) and the method is called from the append() method of the appender (MyAppender). Could anyone please point me to the problem with the appender (MyAppender)?

 

My Queries:-

1) Has it anything to do with the lifecycle of append() method? If yes, could someone elaborate on its lifecycle?

2) If this is not the correct way of writing a web service appender using log4j (given that the service is deployed in tomcat), how can I do so correctly?

 

Thanking you in anticipation.

 

Regards,

Sushil Duseja

 

PS: All the files discussed are attached with the mail.

Attachment (log4j.properties): application/octet-stream, 714 bytes
Attachment (LogClass.java): application/octet-stream, 552 bytes
Attachment (MyAppender.java): application/octet-stream, 8 KiB
Attachment (MyService.java): application/octet-stream, 143 bytes
---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe <at> ws.apache.org
For additional commands, e-mail: axis-user-help <at> ws.apache.org

Gmane