Harald Aamot created QPIDJMS-587:
------------------------------------

             Summary: io.netty:netty-transport-native-unix-common not managed 
but used
                 Key: QPIDJMS-587
                 URL: https://issues.apache.org/jira/browse/QPIDJMS-587
             Project: Qpid JMS
          Issue Type: Bug
          Components: qpid-jms-client, qpid-jms-discovery
    Affects Versions: 2.2.0
         Environment: linux OS running a Spring Boot app 2.7.11 and qpid-jms 
2.2.0 together.
            Reporter: Harald Aamot
             Fix For: 2.3.0


When using qpid-jms 2.2.0 running on a linux OS then netty transitively pulls 
in io.netty:netty-transport-native-unix-common .
The version for this depndency is not managed in qpid-jms.

When running a SpringBoot 2.7.11 application, Spring Boot manages io.netty on 
version 4.1.91.Final . This version then gets used for 
io.netty:netty-transport-native-unix-common, while the other netty components 
run on 4.1.86.Final (managed by qpid-jms).

This leads to a runtime exception when trying to connect.

Reason is this:
With netty 4.1.91.Final an incompatible change for qpid-jms has been made.
ChangelogĀ [https://netty.io/news/2023/04/03/4-1-91-Final.html]
incompatible changeĀ [https://github.com/netty/netty/issues/13317]
code changed thereĀ [https://github.com/netty/netty/pull/13318]

```

["jakarta.jms.JMSException: Could not initialize class 
io.netty.channel.unix.Errors","\tat 
org.apache.qpid.jms.provider.ProviderException.toJMSException(ProviderException.java:34)","\tat
 
org.apache.qpid.jms.exceptions.JmsExceptionSupport.create(JmsExceptionSupport.java:80)","\tat
 
org.apache.qpid.jms.exceptions.JmsExceptionSupport.create(JmsExceptionSupport.java:112)","\tat
 
org.apache.qpid.jms.JmsConnection.onAsyncException(JmsConnection.java:1564)","\tat
 
org.apache.qpid.jms.JmsConnection.onProviderException(JmsConnection.java:1548)","\tat
 
org.apache.qpid.jms.JmsConnection.onConnectionFailure(JmsConnection.java:1392)","\tat
 
org.apache.qpid.jms.provider.failover.FailoverProvider.lambda$reportReconnectFailure$3(FailoverProvider.java:808)","\tat
 java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown 
Source)","\tat java.base/java.util.concurrent.FutureTask.run(Unknown 
Source)","\tat 
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown
 Source)","\tat 
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown 
Source)","\tat 
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown 
Source)","\tat java.base/java.lang.Thread.run(Unknown Source)","Caused by: 
org.apache.qpid.jms.provider.exceptions.ProviderIOException: Could not 
initialize class io.netty.channel.unix.Errors","\tat 
org.apache.qpid.jms.provider.exceptions.ProviderExceptionSupport.createOrPassthroughFatal(ProviderExceptionSupport.java:46)","\tat
 
org.apache.qpid.jms.provider.amqp.AmqpProvider.connect(AmqpProvider.java:309)","\tat
 
org.apache.qpid.jms.provider.failover.FailoverProvider$14.run(FailoverProvider.java:747)","\t...
 6 more","Caused by: java.io.IOException: Could not initialize class 
io.netty.channel.unix.Errors","\tat 
org.apache.qpid.jms.util.IOExceptionSupport.create(IOExceptionSupport.java:45)","\tat
 
org.apache.qpid.jms.transports.netty.NettyTcpTransport$2.operationComplete(NettyTcpTransport.java:176)","\tat
 
org.apache.qpid.jms.transports.netty.NettyTcpTransport$2.operationComplete(NettyTcpTransport.java:171)","\tat
 
io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:590)","\tat
 
io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:557)","\tat
 
io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:492)","\tat
 
io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:636)","\tat
 
io.netty.util.concurrent.DefaultPromise.setFailure0(DefaultPromise.java:629)","\tat
 
io.netty.util.concurrent.DefaultPromise.tryFailure(DefaultPromise.java:118)","\tat
 
io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.connect(AbstractEpollChannel.java:637)","\tat
 
io.netty.channel.DefaultChannelPipeline$HeadContext.connect(DefaultChannelPipeline.java:1342)","\tat
 
io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:653)","\tat
 
io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:632)","\tat
 io.netty.handler.ssl.SslHandler.connect(SslHandler.java:714)","\tat 
io.netty.channel.AbstractChannelHandlerContext.invokeConnect(AbstractChannelHandlerContext.java:657)","\tat
 
io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:632)","\tat
 
io.netty.channel.AbstractChannelHandlerContext.connect(AbstractChannelHandlerContext.java:616)","\tat
 
io.netty.channel.DefaultChannelPipeline.connect(DefaultChannelPipeline.java:978)","\tat
 io.netty.channel.AbstractChannel.connect(AbstractChannel.java:265)","\tat 
io.netty.bootstrap.Bootstrap$3.run(Bootstrap.java:250)","\tat 
io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)","\tat
 
io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)","\tat
 
io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)","\tat
 io.netty.channel.epoll.EpollEventLoop.run(EpollEventLoop.java:406)","\tat 
io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)","\tat
 
io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)","\t...
 1 more","Caused by: java.lang.NoClassDefFoundError: Could not initialize class 
io.netty.channel.unix.Errors","\tat 
io.netty.channel.unix.Socket.connect(Socket.java:351)","\tat 
io.netty.channel.epoll.AbstractEpollChannel.doConnect0(AbstractEpollChannel.java:773)","\tat
 
io.netty.channel.epoll.EpollSocketChannel.doConnect0(EpollSocketChannel.java:144)","\tat
 
io.netty.channel.epoll.AbstractEpollChannel.doConnect(AbstractEpollChannel.java:758)","\tat
 
io.netty.channel.epoll.AbstractEpollChannel$AbstractEpollUnsafe.connect(AbstractEpollChannel.java:600)","\t...
 17 more"]} [2023-04-24T11:18:33.655Z] 
github.wdf.sap.corp/nextgenpayroll-montblanc/process-tracker-service/main: 
2023-04-24T11:18:18.885Z [APP/PROC/WEB/1] OUT \{"msg":"Connection attempt:[15] 
to: 
amqps://aba5da1c-7ba4-4a97-a7b8-bed634abc51d.messaging.eu10.mq.messagebroker.cloud.sap:7027
 
failed","level":"INFO","written_ts":"1682335098885062000","logger":"org.apache.qpid.jms.provider.failover.FailoverProvider","written_at":"2023-04-24T11:18:18.884Z","thread":"FailoverProvider:
 async work thread","type":"log"} [2023-04-24T11:18:33.655Z] 
github.wdf.sap.corp/nextgenpayroll-montblanc/process-tracker-service/main: 
2023-04-24T11:18:18.898Z [APP/PROC/WEB/1] OUT \{"msg":"Failed to connect after: 
15 
attempt(s)","level":"ERROR","written_ts":"1682335098898191000","logger":"org.apache.qpid.jms.provider.failover.FailoverProvider","written_at":"2023-04-24T11:18:18.897Z","thread":"FailoverProvider:
 async work thread","type":"log"} [2023-04-24T11:18:33.655Z] 
github.wdf.sap.corp/nextgenpayroll-montblanc/process-tracker-service/main: 
2023-04-24T11:18:18.898Z [APP/PROC/WEB/1] OUT \{"msg":"Connection 
ID:4c280ae9-787d-4ef2-bf11-1f3f9682e709:1 has failed due to: Could not 
initialize class 
io.netty.channel.unix.Errors","level":"WARN","written_ts":"1682335098898573000","logger":"org.apache.qpid.jms.JmsConnection","written_at":"2023-04-24T11:18:18.898Z","thread":"FailoverProvider:
 async work thread","type":"log"}

```

My proposal:
use the netty-bom to manage the dependencies in qpid-jms to never has something 
similar occur again. I'll create a PR ..



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to