Gradle testScoverage失败,NoClassDefFoundError使用MINA SSHD的项目.&l



我有一组使用MINA SSHD (org.apache.sshd)的类。这些类具有在1.7.0版本的MINA上运行的测试。我现在迁移到2.8.0,并重新运行了测试。我从MINA获得两个特定类的NoClassDefFoundError:

22:40:46.606 [sshd-SshServer[55f94b13](port=8022)-nio2-thread-2] DEBUG org.apache.sshd.server.session.ServerSessionImpl - readIdentification(ServerSessionImpl[null@/127.0.0.1:56869]) client version string: SSH-2.0-APACHE-SSHD-2.8.0
Exception in thread "sshd-SshClient[ef9d35b]-nio2-thread-1" java.lang.NoClassDefFoundError: Could not initialize class org.apache.sshd.common.util.logging.LoggingUtils
at org.apache.sshd.common.util.logging.AbstractLoggingBean.debug(AbstractLoggingBean.java:82)
at org.apache.sshd.common.io.nio2.Nio2Connector.access$200(Nio2Connector.java:42)
at org.apache.sshd.common.io.nio2.Nio2Connector$ConnectionCompletionHandler.onCompleted(Nio2Connector.java:180)
at org.apache.sshd.common.io.nio2.Nio2Connector$ConnectionCompletionHandler.onCompleted(Nio2Connector.java:116)
at org.apache.sshd.common.io.nio2.Nio2CompletionHandler.lambda$completed$0(Nio2CompletionHandler.java:38)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.sshd.common.io.nio2.Nio2CompletionHandler.completed(Nio2CompletionHandler.java:37)
at sun.nio.ch.Invoker.invokeUnchecked(Invoker.java:126)
at sun.nio.ch.Invoker$2.run(Invoker.java:218)
at sun.nio.ch.AsynchronousChannelGroupImpl$1.run(AsynchronousChannelGroupImpl.java:112)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:750)

22:59:22.798 [sshd-SshServer[55f94b13](port=8022)-nio2-thread-2] DEBUG org.apache.sshd.server.session.SessionFactory - messageReceived(Nio2Session[local=/127.0.0.1:8022, remote=/127.0.0.1:57245]) failed NoClassDefFoundError to handle message: Could not initialize class org.apache.sshd.common.SshConstants$LazyMessagesMapHolder
java.lang.NoClassDefFoundError: Could not initialize class org.apache.sshd.common.SshConstants$LazyMessagesMapHolder
at org.apache.sshd.common.SshConstants.getCommandMessageName(SshConstants.java:200)

奇怪的是,它说它找不到一个类是sshd-common工件的一部分,而其他类可以毫无问题地找到。

在我的主依赖项中,我使用2.8.0:

dependency group: 'org.apache.sshd', name: 'sshd-common', version: '2.8.0'
dependency group: 'org.apache.sshd', name: 'sshd-core', version: '2.8.0'
dependency group: 'org.apache.sshd', name: 'sshd-scp', version: '2.8.0'
dependency group: 'org.apache.sshd', name: 'sshd-sftp', version: '2.8.0'

在编写代码和测试的特定项目中,我也引入了特定的版本:

dependencies {
compile group: 'org.apache.sshd', name: 'sshd-common', version: '2.8.0'
compile group: 'org.apache.sshd', name: 'sshd-core', version: '2.8.0'
compile group: 'org.apache.sshd', name: 'sshd-scp', version: '2.8.0'
compile group: 'org.apache.sshd', name: 'sshd-sftp', version: '2.8.0'
compile project(':commands:expect4j')
compile project(':common:utils')
compile group: 'net.jcazevedo', name: 'moultingyaml_2.12'
compile group: 'org.scala-lang', name: 'scala-reflect', version: scalaVersion
compile group: 'org.bouncycastle', name: 'bcprov-jdk15on'
compile group: 'org.bouncycastle', name: 'bcpkix-jdk15on'
compile group: 'com.typesafe.scala-logging', name: 'scala-logging_2.12'
}
apply from: new File(rootProject.projectDir, 'gradle/scala.gradle')

没有其他关于org.apache.sshd的引用。我错过了什么?

Mina 2.8.0使用slf4j 1.7.32版本。

尝试添加此依赖版本。

implementation group: 'org.slf4j', name: 'slf4j-api', version: '1.7.32'

相关内容

  • 没有找到相关文章

最新更新