Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mina full class name in BuiltinIoServiceFactoryFactories #510

Closed
JinHeap opened this issue May 30, 2024 · 3 comments
Closed

Fix mina full class name in BuiltinIoServiceFactoryFactories #510

JinHeap opened this issue May 30, 2024 · 3 comments
Labels
bug An issue describing a bug in the code
Milestone

Comments

@JinHeap
Copy link
Contributor

JinHeap commented May 30, 2024

MINA("org.apache.sshd.common.io.mina.MinaServiceFactoryFactory"),

full class name in BuiltinIoServiceFactoryFactories for mina is unavailable. I have to modified the code from org.apache.sshd.common.io.mina.MinaServiceFactoryFactory to org.apache.sshd.mina.MinaServiceFactoryFactory in order to run SshClientMain with mina

mina-sshd> java -cp * org.apache.sshd.cli.client.SshClientMain -w 1 [email protected] -io mina
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.sshd.common.io.mina.MinaServiceFactoryFactory
at org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories.getFactoryClass(BuiltinIoServiceFactoryFactories.java:76)
at org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories.create(BuiltinIoServiceFactoryFactories.java:88)
at org.apache.sshd.cli.CliSupport.setupIoServiceFactory(CliSupport.java:149)
at org.apache.sshd.cli.client.SshClientCliSupport.setupDefaultClient(SshClientCliSupport.java:407)
at org.apache.sshd.cli.client.SshClientCliSupport.setupClient(SshClientCliSupport.java:447)
at org.apache.sshd.cli.client.SshClientCliSupport.setupClientSession(SshClientCliSupport.java:244)
at org.apache.sshd.cli.client.SshClientMain.main(SshClientMain.java:134)
Caused by: java.lang.ClassNotFoundException: org.apache.sshd.common.io.mina.MinaServiceFactoryFactory
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories.getFactoryClass(BuiltinIoServiceFactoryFactories.java:71)
... 6 more
Exception in thread "main" java.lang.RuntimeException: java.lang.ClassNotFoundException: org.apache.sshd.common.io.mina.MinaServiceFactoryFactory
at org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories.getFactoryClass(BuiltinIoServiceFactoryFactories.java:76)
at org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories.create(BuiltinIoServiceFactoryFactories.java:88)
at org.apache.sshd.cli.CliSupport.setupIoServiceFactory(CliSupport.java:149)
at org.apache.sshd.cli.client.SshClientCliSupport.setupDefaultClient(SshClientCliSupport.java:407)
at org.apache.sshd.cli.client.SshClientCliSupport.setupClient(SshClientCliSupport.java:447)
at org.apache.sshd.cli.client.SshClientCliSupport.setupClientSession(SshClientCliSupport.java:244)
at org.apache.sshd.cli.client.SshClientMain.main(SshClientMain.java:134)
Caused by: java.lang.ClassNotFoundException: org.apache.sshd.common.io.mina.MinaServiceFactoryFactory
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at org.apache.sshd.common.io.BuiltinIoServiceFactoryFactories.getFactoryClass(BuiltinIoServiceFactoryFactories.java:71)
... 6 more

@tomaswolf
Copy link
Member

Looks like an obvious bug. Probably this was missed in some earlier refactoring. Want to provide a PR?

@tomaswolf tomaswolf added the bug An issue describing a bug in the code label May 30, 2024
@JinHeap
Copy link
Contributor Author

JinHeap commented May 30, 2024

Looks like an obvious bug. Probably this was missed in some earlier refactoring. Want to provide a PR?

OK

tomaswolf pushed a commit to JinHeap/mina-sshd that referenced this issue May 30, 2024
The class name for the MinaServiceFactoryFactory was not updated in the
refactoring in commit 5cbae28.

Add a test that catches such mistakes, and exclude another test
from being run with the MinaServiceFactoryFactory because it cannot
work with a mocked ExecutorService.

Bug: apache#510
tomaswolf pushed a commit to JinHeap/mina-sshd that referenced this issue May 31, 2024
The class name for the MinaServiceFactoryFactory was not updated in the
refactoring in commit 5cbae28.

Add a test that catches such mistakes, and exclude another test
from being run with the MinaServiceFactoryFactory because it cannot
work with a mocked ExecutorService.

Bug: apache#510
tomaswolf pushed a commit that referenced this issue May 31, 2024
The class name for the MinaServiceFactoryFactory was not updated in the
refactoring in commit 5cbae28.

Add a test that catches such mistakes, and exclude another test
from being run with the MinaServiceFactoryFactory because it cannot
work with a mocked ExecutorService.

Bug: #510
@tomaswolf
Copy link
Member

PR was merged as commit 82e0ed1.

@tomaswolf tomaswolf added this to the 2.13.0 milestone May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An issue describing a bug in the code
Projects
None yet
Development

No branches or pull requests

2 participants