You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Gary Gregory (JIRA)" <ji...@apache.org> on 2015/06/02 19:59:50 UTC

[jira] [Issue Comment Deleted] (LOG4J2-1037) Backward compatibility issue in log4j-1.2-api NDC pop() and peek()

     [ https://issues.apache.org/jira/browse/LOG4J2-1037?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gary Gregory updated LOG4J2-1037:
---------------------------------
    Comment: was deleted

(was: Should be easy to fix. But... at which level? It looks like we copied the v1.2 Javadoc all the way down to {{org.apache.logging.log4j.ThreadContext.pop()}} but left the implementation as a "plain" pop that throws a {{NoSuchElementException}}. What do we want in the core? Fix the Javadoc to match the code or fix the code to match the Javadoc? We can then adjust the API module as needed.

[~ralphgoers]: What was the intention for 2.0 here?)

> Backward compatibility issue in log4j-1.2-api NDC pop() and peek()
> ------------------------------------------------------------------
>
>                 Key: LOG4J2-1037
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-1037
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: log4j 1.2 emulation
>    Affects Versions: 2.2
>            Reporter: Marc Dergacz
>            Priority: Minor
>
> While going through and migrating our projects to log4j 2.2, there are several apps and 3rd party libraries that we use that depend on log4j 1.2.
> Whilst the log4j-1.2-api library pretty much works flawlessly for us, I ran into an issue today with the opensaml1 library which breaks when it tries to call NDC.pop().
> In log4j 1.2, NDC.pop() would check to see if the stack was empty and if it was, returned an empty string but with the log4j-1.2-api library, the DefaultThreadContextStack.pop() ends up throwing a NoSuchElementException which causes everything to fall over for us.
> Given the library is meant to provide backwards compatibility, shouldn't the behaviour also be the same?  At present, upgrading the OpenSAML library isn't an option, frustratingly.
> ] Unhandled exception:  - java.util.NoSuchElementException: The ThreadContext stack is empty
>         at org.apache.logging.log4j.spi.DefaultThreadContextStack.pop(DefaultThreadContextStack.java:185)
>         at org.apache.logging.log4j.ThreadContext.pop(ThreadContext.java:391)
>         at org.apache.log4j.NDC.pop(NDC.java:121)
>         at org.opensaml.SAMLException.getInstance(Unknown Source)
>         at org.opensaml.SAMLResponse.fromDOM(Unknown Source)
>        at org.opensaml.SAMLResponse.<init>(Unknown Source)
>         at org.jasig.cas.client.validation.Saml11TicketValidator.parseResponseFromServer(Saml11TicketValidator.java:51)
>         at 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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