[
https://issues.apache.org/jira/browse/SSHD-975?focusedWorklogId=417659&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-417659
]
ASF GitHub Bot logged work on SSHD-975:
---------------------------------------
Author: ASF GitHub Bot
Created on: 07/Apr/20 13:08
Start Date: 07/Apr/20 13:08
Worklog Time Spent: 10m
Work Description: rovarga commented on issue #118: [SSHD-975] Use
AbstractFactoryManager's classloader for proxies
URL: https://github.com/apache/mina-sshd/pull/118#issuecomment-610376299
> If this change fixes the issue then I believe we should apply it to
**all** the places where proxy wrappers are being created - which means also in
`ScpCommandFactory`, `AbstractSftpSubsystemHelper`,
`AbstractSftpEventListenerManager`, `AbstractConnectionService`, etc...
Agreed, think we should just use the method without ClassLoader argument and
instantiate the proxy in the classloader where the interface lives -- it's the
simplest and guaranteed to work. What do you think?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 417659)
Time Spent: 20m (was: 10m)
> SshClient subclasses fail in OSGi environment
> ---------------------------------------------
>
> Key: SSHD-975
> URL: https://issues.apache.org/jira/browse/SSHD-975
> Project: MINA SSHD
> Issue Type: Bug
> Affects Versions: 2.3.0, 2.4.0
> Reporter: Robert Varga
> Priority: Major
> Time Spent: 20m
> Remaining Estimate: 0h
>
> Attempting to subclass SshClient and use it in OSGi environment can fail with
> the following:
> {noformat}
> 2020-04-07T07:46:19,968 | WARN | nioEventLoopGroupCloseable-3-1 |
> ChannelInitializer | 64 - io.netty.common - 4.1.45.Final |
> Failed to initialize a channel. Closing: [id: 0xfedebbf7]
> java.lang.ExceptionInInitializerError: null
> at
> org.opendaylight.netconf.client.SshClientChannelInitializer.initialize(SshClientChannelInitializer.java:43)
> ~[402:org.opendaylight.netconf.client:1.9.0.SNAPSHOT]
> at
> org.opendaylight.netconf.nettyutil.ReconnectPromise.lambda$connect$0(ReconnectPromise.java:54)
> ~[420:org.opendaylight.netconf.netty-util:1.9.0.SNAPSHOT]
> at
> org.opendaylight.netconf.nettyutil.AbstractNetconfDispatcher$3.initChannel(AbstractNetconfDispatcher.java:206)
> ~[420:org.opendaylight.netconf.netty-util:1.9.0.SNAPSHOT]
> at
> org.opendaylight.netconf.nettyutil.AbstractNetconfDispatcher$3.initChannel(AbstractNetconfDispatcher.java:203)
> ~[420:org.opendaylight.netconf.netty-util:1.9.0.SNAPSHOT]
> at
> io.netty.channel.ChannelInitializer.initChannel(ChannelInitializer.java:129)
> [67:io.netty.transport:4.1.45.Final]
> at
> io.netty.channel.ChannelInitializer.handlerAdded(ChannelInitializer.java:112)
> [67:io.netty.transport:4.1.45.Final]
> at
> io.netty.channel.AbstractChannelHandlerContext.callHandlerAdded(AbstractChannelHandlerContext.java:956)
> [67:io.netty.transport:4.1.45.Final]
> at
> io.netty.channel.DefaultChannelPipeline.callHandlerAdded0(DefaultChannelPipeline.java:609)
> [67:io.netty.transport:4.1.45.Final]
> at
> io.netty.channel.DefaultChannelPipeline.access$100(DefaultChannelPipeline.java:46)
> [67:io.netty.transport:4.1.45.Final]
> at
> io.netty.channel.DefaultChannelPipeline$PendingHandlerAddedTask.execute(DefaultChannelPipeline.java:1463)
> [67:io.netty.transport:4.1.45.Final]
> at
> io.netty.channel.DefaultChannelPipeline.callHandlerAddedForAllHandlers(DefaultChannelPipeline.java:1115)
> [67:io.netty.transport:4.1.45.Final]
> at
> io.netty.channel.DefaultChannelPipeline.invokeHandlerAddedIfNeeded(DefaultChannelPipeline.java:650)
> [67:io.netty.transport:4.1.45.Final]
> at
> io.netty.channel.AbstractChannel$AbstractUnsafe.register0(AbstractChannel.java:502)
> [67:io.netty.transport:4.1.45.Final]
> at
> io.netty.channel.AbstractChannel$AbstractUnsafe.access$200(AbstractChannel.java:417)
> [67:io.netty.transport:4.1.45.Final]
> at
> io.netty.channel.AbstractChannel$AbstractUnsafe$1.run(AbstractChannel.java:474)
> [67:io.netty.transport:4.1.45.Final]
> at
> io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
> [64:io.netty.common:4.1.45.Final]
> at
> io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
> [64:io.netty.common:4.1.45.Final]
> at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
> [67:io.netty.transport:4.1.45.Final]
> at
> io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
> [64:io.netty.common:4.1.45.Final]
> at
> io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
> [64:io.netty.common:4.1.45.Final]
> at
> io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
> [64:io.netty.common:4.1.45.Final]
> at java.lang.Thread.run(Thread.java:834) [?:?]
> Caused by: java.lang.IllegalArgumentException:
> org.apache.sshd.common.forward.PortForwardingEventListener referenced from a
> method is not visible from class loader
> at java.lang.reflect.Proxy$ProxyBuilder.ensureVisible(Proxy.java:858)
> ~[?:?]
> at
> java.lang.reflect.Proxy$ProxyBuilder.validateProxyInterfaces(Proxy.java:681)
> ~[?:?]
> at java.lang.reflect.Proxy$ProxyBuilder.<init>(Proxy.java:627) ~[?:?]
> at java.lang.reflect.Proxy$ProxyBuilder.<init>(Proxy.java:635) ~[?:?]
> at java.lang.reflect.Proxy.lambda$getProxyConstructor$0(Proxy.java:415)
> ~[?:?]
> at
> jdk.internal.loader.AbstractClassLoaderValue$Memoizer.get(AbstractClassLoaderValue.java:329)
> ~[?:?]
> at
> jdk.internal.loader.AbstractClassLoaderValue.computeIfAbsent(AbstractClassLoaderValue.java:205)
> ~[?:?]
> at java.lang.reflect.Proxy.getProxyConstructor(Proxy.java:413) ~[?:?]
> at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1006) ~[?:?]
> at
> org.apache.sshd.common.util.EventListenerUtils.proxyWrapper(EventListenerUtils.java:193)
> ~[144:org.apache.sshd.osgi:2.3.0]
> at
> org.apache.sshd.common.helpers.AbstractFactoryManager.<init>(AbstractFactoryManager.java:107)
> ~[144:org.apache.sshd.osgi:2.3.0]
> at org.apache.sshd.client.SshClient.<init>(SshClient.java:189)
> ~[144:org.apache.sshd.osgi:2.3.0]
> at
> org.opendaylight.netconf.nettyutil.handler.ssh.client.NetconfSshClient.<init>(NetconfSshClient.java:19)
> ~[420:org.opendaylight.netconf.netty-util:1.9.0.SNAPSHOT]
> at org.apache.sshd.common.BaseBuilder.build(BaseBuilder.java:256)
> ~[144:org.apache.sshd.osgi:2.3.0]
> at org.apache.sshd.client.ClientBuilder.build(ClientBuilder.java:183)
> ~[144:org.apache.sshd.osgi:2.3.0]
> at org.apache.sshd.client.ClientBuilder.build(ClientBuilder.java:51)
> ~[144:org.apache.sshd.osgi:2.3.0]
> at org.apache.sshd.common.BaseBuilder.build(BaseBuilder.java:276)
> ~[144:org.apache.sshd.osgi:2.3.0]
> at
> org.opendaylight.netconf.nettyutil.handler.ssh.client.NetconfClientBuilder.build(NetconfClientBuilder.java:23)
> ~[420:org.opendaylight.netconf.netty-util:1.9.0.SNAPSHOT]
> at
> org.opendaylight.netconf.nettyutil.handler.ssh.client.AsyncSshHandler.<clinit>(AsyncSshHandler.java:45)
> ~[420:org.opendaylight.netconf.netty-util:1.9.0.SNAPSHOT]{noformat}
>
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]