Tellier Benoit created JAMES-2113:
-------------------------------------

             Summary: Get ride of bidirectional logging bridge in PROTOCOLS
                 Key: JAMES-2113
                 URL: https://issues.apache.org/jira/browse/JAMES-2113
             Project: James Server
          Issue Type: Bug
          Components: protocols
    Affects Versions: master
            Reporter: Tellier Benoit
             Fix For: master


I encountered this stack-trace in IMAP related code:

{code:java}
java.lang.UnsupportedOperationException: null
    at 
org.apache.james.protocols.lib.Slf4jLoggerAdapter.info(Slf4jLoggerAdapter.java:196)
    at 
org.apache.james.imapserver.netty.ImapIdleStateHandler.channelIdle(ImapIdleStateHandler.java:43)
    at 
org.jboss.netty.handler.timeout.IdleStateAwareChannelHandler.handleUpstream(IdleStateAwareChannelHandler.java:34)
    at 
org.jboss.netty.channel.DefaultChannelPipeline.sendUpstream(DefaultChannelPipeline.java:564)
    at 
org.jboss.netty.channel.DefaultChannelPipeline$DefaultChannelHandlerContext.sendUpstream(DefaultChannelPipeline.java:791)
    at 
org.jboss.netty.handler.timeout.IdleStateHandler.channelIdle(IdleStateHandler.java:392)
    at 
org.jboss.netty.handler.timeout.IdleStateHandler$1.run(IdleStateHandler.java:382)
    at 
org.jboss.netty.channel.socket.ChannelRunnableWrapper.run(ChannelRunnableWrapper.java:40)
    at 
org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:391)
    at 
org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:315)
    at 
org.jboss.netty.channel.socket.nio.AbstractNioWorker.run(AbstractNioWorker.java:89)
    at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:178)
    at 
org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108)
    at 
org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42)
    at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)

{code}

Turned out that:
 - ImapIdleStateHandler is logging to 
org.apache.james.protocols.lib.Slf4jLoggerAdapter
 - Which mimics the SFL4J Logger on top of 
org.apache.james.protocols.api.logger.Logger
 - Which appart some wrapper, is a wrapping around the SLF4J Looger 
(org.apache.james.protocols.api.logger.ProtocolLoggerAdapter)

And of course in Slf4jLoggerAdapter:


{code:java}
    public void info(String arg0, Object arg1, Object arg2) {
        throw new UnsupportedOperationException();
        
    }
{code}

The contextual logger should directly decorate SLF4J 
(org.apache.james.protocols.api.logger.ContextualLogger).

We could then remove org.apache.james.protocols.lib.Slf4jLoggerAdapter and 
org.apache.james.protocols.api.logger.ProtocolLoggerAdapter...



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to