[ 
https://issues.apache.org/jira/browse/LOG4J2-51?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13114739#comment-13114739
 ] 

John Vasileff commented on LOG4J2-51:
-------------------------------------

Yes, the patch in LOG4J2-50 is required to fix CategoryTest.testClassName().

Where is the ClassCastException occurring?  I wonder if this is due to some 
interaction between the IDE and mvn build where a mix of old and new versions 
are being used.  Something like this happened to me, but after clean, etc., it 
cleared up.

$ git log --oneline | head
276d6e1 cleanup FQCN code
bac5439 remove dangerous logger factory override
12a7861 fix for Category.getInstance returning cached Logger
d6e9975 add test for Category when using a log4j2 Logger
2db42d3 Enhance comments on getThrowable
cdc19e5 Test that class name in log message is correct

$ mvn clean test
...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] ------------------------------------------------------------------------
[INFO] Apache Log4j 2 ........................................ SUCCESS [1.454s]
[INFO] Log4J API ............................................. SUCCESS [2.689s]
[INFO] Log4J2 Core ........................................... SUCCESS 
[1:03.924s]
[INFO] Log4J Compatibility API ............................... SUCCESS [3.471s]
[INFO] SLF4J Binding ......................................... SUCCESS [2.244s]
[INFO] Log4J2 Commons Logging ................................ SUCCESS [1.964s]
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 16 seconds
[INFO] Finished at: Mon Sep 26 11:55:33 EDT 2011
[INFO] Final Memory: 37M/265M
[INFO] ------------------------------------------------------------------------

$ cat log4j12-api/target/surefire-reports/org.apache.log4j.CategoryTest.txt 
-------------------------------------------------------------------------------
Test set: org.apache.log4j.CategoryTest
-------------------------------------------------------------------------------
Tests run: 7, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.657 sec


> ClassCastException in Category logger
> -------------------------------------
>
>                 Key: LOG4J2-51
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-51
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: log4j 1.2 emulation
>            Reporter: John Vasileff
>            Priority: Blocker
>         Attachments: 
> 0001-add-test-for-Category-when-using-a-log4j2-Logger.patch, 
> 0002-fix-for-Category.getInstance-returning-cached-Logger.patch, 
> 0003-remove-dangerous-logger-factory-override.patch
>
>
> When a Category is "created" with the same name as a previously created 
> log4j2 Logger, a ClassCastException occurs when calling category.l7dlog(...) 
> and others.
> See LOG4J2-50 for additional symptoms.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to