You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Yogi Nerella <yn...@gmail.com> on 2013/02/07 23:16:19 UTC

log4j2.0 - beta4 MDC.put(String, String) method not found

Hi,

Any one seeing this error?

All log4j.xml files I am using are from the sample code only.

Thanks,
Yogi

log4j:WARN Continuable parsing error 2 and column 108
log4j:WARN Document root element "log4j:configuration", must match DOCTYPE
root "null".
log4j:WARN Continuable parsing error 2 and column 108
log4j:WARN Document is invalid: no grammar found.
log4j:WARN Unrecognized element appenders
log4j:WARN Unrecognized element loggers
log4j:WARN No appenders could be found for logger (log.Log4jLogger).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
more info.
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.103 sec
<<< FAILURE!
testHelloLogger(log.TestLog4jLogger)  Time elapsed: 0.089 sec  <<< ERROR!
java.lang.NoSuchMethodError:
org.apache.log4j.MDC.put(Ljava/lang/String;Ljava/lang/String;)V
        at log.Log4jLogger.addMyContext(Log4jLogger.java:45)
        at log.TestLog4jLogger.testHelloLogger(TestLog4jLogger.java:13)

Running log.TestSLF4jLogger
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec

Results :

Tests in error:
  TestLog4jLogger.testHelloLogger:13 ╗ NoSuchMethod
org.apache.log4j.MDC.put(Lja...

Tests run: 2, Failures: 0, Errors: 1, Skipped: 0

Re: log4j2.0 - beta4 MDC.put(String, String) method not found

Posted by Yogi Nerella <yn...@gmail.com>.
Gary,

My app has mixed code some classes using slf4j, some using log4j and some
using jdk commons logging, so I am trying to figure out, what is the best
way to merge to log4j version 2.

I am getting the log4j-beta04-bin.   When I am binding different binaries,
I am getting different errors.  I have resolved the MDC error by modifying
ThreadContext.put();

Yogi


On Fri, Feb 8, 2013 at 4:41 AM, Gary Gregory <ga...@gmail.com> wrote:

> What file did you download and run to get this? Or what is from a svn tag?
>
> Gary
>
> On Feb 7, 2013, at 17:16, Yogi Nerella <yn...@gmail.com> wrote:
>
> > Hi,
> >
> > Any one seeing this error?
> >
> > All log4j.xml files I am using are from the sample code only.
> >
> > Thanks,
> > Yogi
> >
> > log4j:WARN Continuable parsing error 2 and column 108
> > log4j:WARN Document root element "log4j:configuration", must match
> DOCTYPE
> > root "null".
> > log4j:WARN Continuable parsing error 2 and column 108
> > log4j:WARN Document is invalid: no grammar found.
> > log4j:WARN Unrecognized element appenders
> > log4j:WARN Unrecognized element loggers
> > log4j:WARN No appenders could be found for logger (log.Log4jLogger).
> > log4j:WARN Please initialize the log4j system properly.
> > log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
> > more info.
> > Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.103 sec
> > <<< FAILURE!
> > testHelloLogger(log.TestLog4jLogger)  Time elapsed: 0.089 sec  <<< ERROR!
> > java.lang.NoSuchMethodError:
> > org.apache.log4j.MDC.put(Ljava/lang/String;Ljava/lang/String;)V
> >        at log.Log4jLogger.addMyContext(Log4jLogger.java:45)
> >        at log.TestLog4jLogger.testHelloLogger(TestLog4jLogger.java:13)
> >
> > Running log.TestSLF4jLogger
> > Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
> >
> > Results :
> >
> > Tests in error:
> >  TestLog4jLogger.testHelloLogger:13 ╗ NoSuchMethod
> > org.apache.log4j.MDC.put(Lja...
> >
> > Tests run: 2, Failures: 0, Errors: 1, Skipped: 0
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Re: log4j2.0 - beta4 MDC.put(String, String) method not found

Posted by Gary Gregory <ga...@gmail.com>.
What file did you download and run to get this? Or what is from a svn tag?

Gary

On Feb 7, 2013, at 17:16, Yogi Nerella <yn...@gmail.com> wrote:

> Hi,
>
> Any one seeing this error?
>
> All log4j.xml files I am using are from the sample code only.
>
> Thanks,
> Yogi
>
> log4j:WARN Continuable parsing error 2 and column 108
> log4j:WARN Document root element "log4j:configuration", must match DOCTYPE
> root "null".
> log4j:WARN Continuable parsing error 2 and column 108
> log4j:WARN Document is invalid: no grammar found.
> log4j:WARN Unrecognized element appenders
> log4j:WARN Unrecognized element loggers
> log4j:WARN No appenders could be found for logger (log.Log4jLogger).
> log4j:WARN Please initialize the log4j system properly.
> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
> more info.
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.103 sec
> <<< FAILURE!
> testHelloLogger(log.TestLog4jLogger)  Time elapsed: 0.089 sec  <<< ERROR!
> java.lang.NoSuchMethodError:
> org.apache.log4j.MDC.put(Ljava/lang/String;Ljava/lang/String;)V
>        at log.Log4jLogger.addMyContext(Log4jLogger.java:45)
>        at log.TestLog4jLogger.testHelloLogger(TestLog4jLogger.java:13)
>
> Running log.TestSLF4jLogger
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
>
> Results :
>
> Tests in error:
>  TestLog4jLogger.testHelloLogger:13 ╗ NoSuchMethod
> org.apache.log4j.MDC.put(Lja...
>
> Tests run: 2, Failures: 0, Errors: 1, Skipped: 0

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: log4j2.0 - beta4 MDC.put(String, String) method not found

Posted by Ralph Goers <ra...@dslextreme.com>.
The MDC class in log4j-1.2-api does have the method.  Are you sure you have the correct jars?  What is processing the log4j configuration and emitting the messages?  It looks like something is passing a log4j 2 configuration to log4j 1.x.

Ralph


On Feb 7, 2013, at 2:16 PM, Yogi Nerella wrote:

> Hi,
> 
> Any one seeing this error?
> 
> All log4j.xml files I am using are from the sample code only.
> 
> Thanks,
> Yogi
> 
> log4j:WARN Continuable parsing error 2 and column 108
> log4j:WARN Document root element "log4j:configuration", must match DOCTYPE
> root "null".
> log4j:WARN Continuable parsing error 2 and column 108
> log4j:WARN Document is invalid: no grammar found.
> log4j:WARN Unrecognized element appenders
> log4j:WARN Unrecognized element loggers
> log4j:WARN No appenders could be found for logger (log.Log4jLogger).
> log4j:WARN Please initialize the log4j system properly.
> log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for
> more info.
> Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.103 sec
> <<< FAILURE!
> testHelloLogger(log.TestLog4jLogger)  Time elapsed: 0.089 sec  <<< ERROR!
> java.lang.NoSuchMethodError:
> org.apache.log4j.MDC.put(Ljava/lang/String;Ljava/lang/String;)V
>        at log.Log4jLogger.addMyContext(Log4jLogger.java:45)
>        at log.TestLog4jLogger.testHelloLogger(TestLog4jLogger.java:13)
> 
> Running log.TestSLF4jLogger
> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.001 sec
> 
> Results :
> 
> Tests in error:
>  TestLog4jLogger.testHelloLogger:13 ╗ NoSuchMethod
> org.apache.log4j.MDC.put(Lja...
> 
> Tests run: 2, Failures: 0, Errors: 1, Skipped: 0


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org