mina-sshd
mina-sshd copied to clipboard
Add support for native image
Description
Add graalvm reachability metadata to the project.
Motivation
Due to the heavy use of reflection, it is currently very hard to use sshd in native images. With reachability metadata, any application that consumes this library would automatically include the necessary classes and resources to create a native image.
Alternatives considered
Alternatively, metadata can be contributed to the reachability metadata repository.
Additional context
No response
Hi @gbaso
Did you manage to actually get an apache mina sshd build working with native image? I'm getting a lot of reflection issues related to bouncycastle, JceRandom, and Log4j?
2 fatal errors detected:
Fatal error: java.lang.SecurityException: Sealing violation: package org.bouncycastle.crypto is sealed
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoader.getAndVerifyPackage(NativeImageClassLoader.java:547)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoader.defineClass(NativeImageClassLoader.java:512)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoader.findClassViaClassPath(NativeImageClassLoader.java:487)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoader.loadClass(NativeImageClassLoader.java:674)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)
at java.base/java.lang.Class.getDeclaredConstructors0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredConstructors(Class.java:3006)
at java.base/java.lang.Class.getDeclaredConstructors(Class.java:2356)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.reflect.ReflectionDataBuilder.lambda$registerAllDeclaredConstructorsQuery$0(ReflectionDataBuilder.java:407)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.reflect.ReflectionDataBuilder.lambda$runConditionalInAnalysisTask$1(ReflectionDataBuilder.java:184)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:166)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:152)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(ForkJoinTask.java:1735)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(ForkJoinTask.java:1726)
at java.base/java.util.concurrent.ForkJoinTask$InterruptibleTask.exec(ForkJoinTask.java:1650)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
at java.base/java.util.concurrent.ForkJoinPool.externalHelpQuiesce(ForkJoinPool.java:2458)
at java.base/java.util.concurrent.ForkJoinPool.helpQuiescePool(ForkJoinPool.java:2492)
at java.base/java.util.concurrent.ForkJoinPool.awaitQuiescence(ForkJoinPool.java:3740)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.complete(CompletionExecutor.java:208)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis.doTypeflow(PointsToAnalysis.java:640)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis.finish(PointsToAnalysis.java:627)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.AbstractAnalysisEngine.runAnalysis(AbstractAnalysisEngine.java:160)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:821)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:567)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:533)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:545)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:732)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:151)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:99)
Fatal error: java.lang.SecurityException: Sealing violation: package org.bouncycastle.crypto is sealed
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoader.getAndVerifyPackage(NativeImageClassLoader.java:547)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoader.defineClass(NativeImageClassLoader.java:512)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoader.findClassViaClassPath(NativeImageClassLoader.java:487)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageClassLoader.loadClass(NativeImageClassLoader.java:674)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:490)
at java.base/java.lang.Class.getDeclaredMethods0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredMethods(Class.java:3035)
at java.base/java.lang.Class.privateGetPublicMethods(Class.java:3060)
at java.base/java.lang.Class.getMethods(Class.java:1998)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.reflect.ReflectionDataBuilder.lambda$registerAllMethodsQuery$0(ReflectionDataBuilder.java:366)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.reflect.ReflectionDataBuilder.lambda$runConditionalInAnalysisTask$1(ReflectionDataBuilder.java:184)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.executeCommand(CompletionExecutor.java:166)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.lambda$executeService$0(CompletionExecutor.java:152)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(ForkJoinTask.java:1735)
at java.base/java.util.concurrent.ForkJoinTask$RunnableExecuteAction.compute(ForkJoinTask.java:1726)
at java.base/java.util.concurrent.ForkJoinTask$InterruptibleTask.exec(ForkJoinTask.java:1650)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:507)
at java.base/java.util.concurrent.ForkJoinPool.externalHelpQuiesce(ForkJoinPool.java:2458)
at java.base/java.util.concurrent.ForkJoinPool.helpQuiescePool(ForkJoinPool.java:2492)
at java.base/java.util.concurrent.ForkJoinPool.awaitQuiescence(ForkJoinPool.java:3740)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.util.CompletionExecutor.complete(CompletionExecutor.java:208)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis.doTypeflow(PointsToAnalysis.java:640)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.PointsToAnalysis.finish(PointsToAnalysis.java:627)
at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.AbstractAnalysisEngine.runAnalysis(AbstractAnalysisEngine.java:160)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.runPointsToAnalysis(NativeImageGenerator.java:821)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.doRun(NativeImageGenerator.java:567)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGenerator.run(NativeImageGenerator.java:533)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.buildImage(NativeImageGeneratorRunner.java:545)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.build(NativeImageGeneratorRunner.java:732)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.start(NativeImageGeneratorRunner.java:151)
at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.NativeImageGeneratorRunner.main(NativeImageGeneratorRunner.java:99)
Working around that and building a java sftp server with graalvm
WARNING: A restricted method in java.lang.System has been called
WARNING: java.lang.System::load has been called by org.fusesource.jansi.internal.JansiLoader in an unnamed module (file:bob/java/maven-mvnd-1.0.2-linux-amd64/mvn/lib/jansi-2.4.1.jar)
WARNING: Use --enable-native-access=ALL-UNNAMED to avoid a warning for callers in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
WARNING: A terminally deprecated method in sun.misc.Unsafe has been called
WARNING: sun.misc.Unsafe::objectFieldOffset has been called by com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper (file:bob/java/maven-mvnd-1.0.2-linux-amd64/mvn/lib/guava-33.2.1-jre.jar)
WARNING: Please consider reporting this to the maintainers of class com.google.common.util.concurrent.AbstractFuture$UnsafeAtomicHelper
WARNING: sun.misc.Unsafe::objectFieldOffset will be removed in a future release
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------------< com.mycompany.app:my-app >----------------------
[INFO] Building my-app 1.0-SNAPSHOT
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- clean:3.2.0:clean (default-clean) @ my-app ---
[INFO] Deleting bob/java/target
[INFO]
[INFO] --- resources:3.3.1:resources (default-resources) @ my-app ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory bob/java/src/main/resources
[INFO]
[INFO] --- compiler:3.13.0:compile (default-compile) @ my-app ---
[INFO] Recompiling the module because of changed source code.
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 5270 source files with javac [forked debug target 24] to target/classes
[WARNING] bob/java/src/main/java/org/apache/sshd/common/compression/package-info.java:[24,30] a package-info.java file has already been seen for package org.apache.sshd.common.compression
[WARNING] bob/java/src/main/java/org/apache/sshd/agent/unix/AprLibrary.java:[99,19] [removal] finalize() in Object has been deprecated and marked for removal
[WARNING] bob/java/src/main/java/org/apache/sshd/agent/unix/AprLibrary.java:[103,13] [removal] finalize() in Object has been deprecated and marked for removal
[WARNING] bob/java/src/main/java/org/apache/sshd/common/io/nio2/Nio2CompletionHandler.java:[37,8] [removal] AccessController in java.security has been deprecated and marked for removal
[WARNING] bob/java/src/main/java/org/apache/sshd/common/io/nio2/Nio2CompletionHandler.java:[45,8] [removal] AccessController in java.security has been deprecated and marked for removal
[WARNING] bob/java/src/main/java/org/apache/sshd/common/util/threads/SshdThreadFactory.java:[40,8] [removal] SecurityManager in java.lang has been deprecated and marked for removal
[WARNING] bob/java/src/main/java/org/apache/sshd/common/util/threads/SshdThreadFactory.java:[40,34] [removal] getSecurityManager() in System has been deprecated and marked for removal
[WARNING] bob/java/src/main/java/org/apache/sshd/common/util/threads/SshdThreadFactory.java:[51,22] [removal] getSecurityManager() in System has been deprecated and marked for removal
[WARNING] bob/java/src/main/java/org/apache/sshd/common/util/threads/SshdThreadFactory.java:[52,20] [removal] AccessController in java.security has been deprecated and marked for removal
[WARNING] bob/java/src/main/java/org/apache/sshd/server/auth/gss/CredentialHelper.java:[52,26] [removal] <T>doAs(Subject,PrivilegedExceptionAction<T>) in Subject has been deprecated and marked for removal
where T is a type-variable:
T extends Object declared in method <T>doAs(Subject,PrivilegedExceptionAction<T>)
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/BERBitStringParser.java:[13,7] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/BEROctetStringParser.java:[13,7] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/BERSequenceParser.java:[10,7] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/BERSetParser.java:[10,7] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/DERExternal.java:[23,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/DLExternal.java:[23,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/DEROctetStringParser.java:[11,7] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/DLBitStringParser.java:[11,7] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/DLSequenceParser.java:[10,7] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/DLSetParser.java:[10,7] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/math/ec/ECCurve.java:[694,15] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/math/ec/ECCurve.java:[1156,15] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/math/ec/ECCurve.java:[1214,15] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x500/X500Name.java:[44,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/SubjectPublicKeyInfo.java:[77,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/SubjectPublicKeyInfo.java:[101,31] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/SubjectPublicKeyInfo.java:[129,25] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/bc/ExternalValue.java:[102,25] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/GeneralName.java:[67,15] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[45,45] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[51,45] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[57,45] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[63,45] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[69,45] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[194,45] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[250,34] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[256,34] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[258,40] [removal] Boolean(boolean) in Boolean has been deprecated and marked for removal
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[259,41] [removal] Boolean(boolean) in Boolean has been deprecated and marked for removal
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[403,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[466,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[499,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[542,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[556,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[591,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[604,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[618,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[633,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[655,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Name.java:[38,7] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmc/CMCStatusInfo.java:[124,25] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmc/CMCStatusInfoV2.java:[100,21] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmc/CMCStatusInfoV2.java:[113,25] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/crmf/CertReqMsg.java:[99,29] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/ReasonFlags.java:[27,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/ReasonFlags.java:[31,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/ReasonFlags.java:[35,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/ReasonFlags.java:[39,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/ReasonFlags.java:[43,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/ReasonFlags.java:[47,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/ReasonFlags.java:[51,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/ReasonFlags.java:[55,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/ReasonFlags.java:[59,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmc/RevokeRequest.java:[134,25] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/CRLReason.java:[34,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/CRLReason.java:[38,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/CRLReason.java:[42,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/CRLReason.java:[46,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/CRLReason.java:[50,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/CRLReason.java:[54,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/CRLReason.java:[58,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/CRLReason.java:[62,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/CRLReason.java:[66,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/CRLReason.java:[70,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/CMPCertificate.java:[30,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/CMPCertificate.java:[124,32] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/CRLStatus.java:[74,16] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/CertAnnContent.java:[26,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/PKIFreeText.java:[109,25] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/PKIFailureInfo.java:[81,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/PKIFailureInfo.java:[85,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/PKIFailureInfo.java:[89,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/PKIFailureInfo.java:[93,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/PKIFailureInfo.java:[97,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/PKIFailureInfo.java:[101,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/PKIFailureInfo.java:[105,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/PKIFailureInfo.java:[109,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/PKIFailureInfo.java:[113,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/PKIFailureInfo.java:[117,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/PKIFailureInfo.java:[121,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/PKIFailureInfo.java:[125,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/PKIFailureInfo.java:[129,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/PKIFailureInfo.java:[133,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/PKIFailureInfo.java:[137,28] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/cmp/RevDetails.java:[49,11] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Extensions.java:[28,45] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Extensions.java:[34,45] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Extensions.java:[40,45] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Extensions.java:[46,45] [dep-ann] deprecated item is not annotated with @Deprecated
[WARNING] bob/java/src/main/java/org/bouncycastle/asn1/x509/X509Extensions.java:[52,45] [dep-ann] deprecated item is not annotated with @Deprecated
[INFO]
[INFO] --- resources:3.3.1:testResources (default-testResources) @ my-app ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory bob/java/src/test/resources
[INFO]
[INFO] --- compiler:3.13.0:testCompile (default-testCompile) @ my-app ---
[INFO] Recompiling the module because of changed dependency.
[WARNING] File encoding has not been set, using platform encoding UTF-8, i.e. build is platform dependent!
[INFO] Compiling 1 source file with javac [forked debug target 24] to target/test-classes
[INFO]
[INFO] --- surefire:3.2.5:test (default-test) @ my-app ---
[INFO]
[INFO] --- jar:3.4.1:jar (default-jar) @ my-app ---
[INFO] Building jar: bob/java/target/my-app-1.0-SNAPSHOT.jar
[INFO]
[INFO] --- assembly:3.7.1:single (default) @ my-app ---
[INFO] Building jar: bob/java/target/my-app-1.0-SNAPSHOT-jar-with-dependencies.jar
[INFO]
[INFO] --- native:0.10.6:compile-no-fork (default) @ my-app ---
[INFO] Found GraalVM installation from JAVA_HOME variable.
[INFO] Downloaded GraalVM reachability metadata repository from file:/root/.m2/repository/org/graalvm/buildtools/graalvm-reachability-metadata/0.10.6/graalvm-reachability-metadata-0.10.6-repository.zip
[INFO] Executing: graalvm-jdk-24+36.1/bin/native-image -cp bob/java/target/my-app-1.0-SNAPSHOT.jar:/root/.m2/repository/org/apache/logging/log4j/log4j-core/2.24.3/log4j-core-2.24.3.jar:/root/.m2/repository/org/apache/logging/log4j/log4j-api/2.24.3/log4j-api-2.24.3.jar:/root/.m2/repository/com/unboundid/unboundid-ldapsdk/6.0.4/unboundid-ldapsdk-6.0.4.jar:/root/.m2/repository/org/slf4j/slf4j-api/2.0.17/slf4j-api-2.0.17.jar:/root/.m2/repository/com/ubirch/util/crypto_2.11/0.3.1/crypto_2.11-0.3.1.jar:/root/.m2/repository/org/scala-lang/scala-library/2.11.8/scala-library-2.11.8.jar:/root/.m2/repository/com/roundeights/hasher_2.11/1.2.0/hasher_2.11-1.2.0.jar:/root/.m2/repository/org/apache/tomcat/tomcat-jni/9.0.104/tomcat-jni-9.0.104.jar:/root/.m2/repository/xerces/xercesImpl/2.12.0/xercesImpl-2.12.0.jar:/root/.m2/repository/xml-apis/xml-apis/1.4.01/xml-apis-1.4.01.jar:/root/.m2/repository/net/i2p/crypto/eddsa/0.3.0/eddsa-0.3.0.jar --no-fallback -o bob/java/target/my-app -H:ReflectionConfigurationFiles=src/resources/META-INF/native-image/reflect-config.json -H:DynamicProxyConfigurationFiles=src/resources/META-INF/native-image/proxy-config.json --initialize-at-build-time --initialize-at-run-time=org.apache.sshd.common.kex.MontgomeryCurve --initialize-at-build-time=java.security.SecureRandom --initialize-at-run-time=org.apache.sshd.common.config.keys.loader.AESPrivateKeyObfuscator$LazyKeyLengthsHolder --initialize-at-run-time=org.apache.sshd.common.random.JceRandom --initialize-at-run-time=org.apache.sshd.common.random.JceRandom$Cache --initialize-at-build-time=org.bouncycastle com.app.SftpServer
Warning: The option '-H:ReflectionConfigurationFiles=src/resources/META-INF/native-image/reflect-config.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:DynamicProxyConfigurationFiles=src/resources/META-INF/native-image/proxy-config.json' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: Please re-evaluate whether any experimental option is required, and either remove or unlock it. The build output lists all active experimental options, including where they come from and possible alternatives. If you think an experimental option should be considered as stable, please file an issue.
Warning: Option 'DynamicProxyConfigurationFiles' is deprecated and might be removed in a future release. Please refer to the GraalVM release notes.
========================================================================================================================
GraalVM Native Image: Generating 'my-app' (executable)...
========================================================================================================================
Warning: The host machine does not support all features of 'x86-64-v3'. Falling back to '-march=compatibility' for best compatibility.
[1/8] Initializing... (21.6s @ 0.18GB)
Java version: 24+36, vendor version: Oracle GraalVM 24+36.1
Graal compiler: optimization level: 2, target machine: compatibility, PGO: ML-inferred
C compiler: gcc (redhat, x86_64, 4.8.5)
Garbage collector: Serial GC (max heap size: 80% of RAM)
2 user-specific feature(s):
- com.oracle.svm.polyglot.scala.ScalaFeature
- com.oracle.svm.thirdparty.gson.GsonFeature
------------------------------------------------------------------------------------------------------------------------
2 experimental option(s) unlocked:
- '-H:ReflectionConfigurationFiles': Use a reflect-config.json in your META-INF/native-image/<groupID>/<artifactID> directory instead. (origin(s): command line)
- '-H:DynamicProxyConfigurationFiles': Use a proxy-config.json in your META-INF/native-image/<groupID>/<artifactID> directory instead. (origin(s): command line)
------------------------------------------------------------------------------------------------------------------------
Build resources:
- 11.72GB of memory (75.6% of 15.51GB system memory, determined at start)
- 2 thread(s) (100.0% of 2 available processor(s), determined at start)
SLF4J(W): No SLF4J providers were found.
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.
[2/8] Performing analysis... [*****] (120.6s @ 0.76GB)
7,704 reachable types (80.5% of 9,570 total)
9,241 reachable fields (46.6% of 19,844 total)
40,434 reachable methods (53.7% of 75,293 total)
2,570 types, 12 fields, and 559 methods registered for reflection
60 types, 61 fields, and 55 methods registered for JNI access
4 native libraries: dl, pthread, rt, z
[3/8] Building universe... (12.4s @ 0.85GB)
[4/8] Parsing methods... [******] (32.5s @ 0.98GB)
[5/8] Inlining methods... [***] (8.5s @ 0.71GB)
[6/8] Compiling methods... [***************] (240.7s @ 1.01GB)
[7/8] Laying out methods... [***] (11.2s @ 1.34GB)
[8/8] Creating image... [****] (12.9s @ 0.93GB)
20.23MB (52.12%) for code area: 23,378 compilation units
16.25MB (41.87%) for image heap: 244,326 objects and 55 resources
2.33MB ( 6.01%) for other data
38.81MB in total
------------------------------------------------------------------------------------------------------------------------
Top 10 origins of code area: Top 10 object types in image heap:
9.17MB java.base 5.09MB byte[] for code metadata
6.20MB my-app-1.0-SNAPSHOT.jar 3.27MB byte[] for java.lang.String
3.34MB svm.jar (Native Image) 1.65MB java.lang.String
488.14kB log4j-api-2.24.3.jar 1.44MB java.lang.Class
158.91kB java.logging 450.74kB byte[] for reflection metadata
155.84kB jdk.proxy4 424.78kB java.util.concurrent.ConcurrentHashMap$Node
114.68kB com.oracle.svm.svm_enterprise 371.85kB byte[] for general heap data
106.09kB scala-library-2.11.8.jar 361.13kB com.oracle.svm.core.hub.DynamicHubCompanion
91.02kB slf4j-api-2.0.17.jar 320.50kB java.util.HashMap$Node
49.87kB eddsa-0.3.0.jar 255.11kB java.lang.Object[]
227.63kB for 13 more packages 2.66MB for 2063 more object types
Use '--emit build-report' to create a report with more details.
------------------------------------------------------------------------------------------------------------------------
Security report:
- Binary includes Java deserialization.
- Use '--enable-sbom' to assemble a Software Bill of Materials (SBOM).
Warning: The host machine does not support all features of 'x86-64-v3'. Falling back to '-march=compatibility' for best compatibility.
------------------------------------------------------------------------------------------------------------------------
Recommendations:
G1GC: Use the G1 GC ('--gc=G1') for improved latency and throughput.
PGO: Use Profile-Guided Optimizations ('--pgo') for improved throughput.
HEAP: Set max heap for improved and more predictable memory usage.
CPU: Enable more CPU features with '-march=native' for improved performance.
QBM: Use the quick build mode ('-Ob') to speed up builds during development.
------------------------------------------------------------------------------------------------------------------------
37.0s (7.9% of total time) in 1740 GCs | Peak RSS: 2.26GB | CPU load: 1.76
------------------------------------------------------------------------------------------------------------------------
Build artifacts:
bob/java/target/my-app (executable)
========================================================================================================================
Finished generating 'my-app' in 7m 47s.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 08:58 min
[INFO] Finished at: 2025-04-21T01:05:04+01:00
[INFO] ------------------------------------------------------------------------
there is some weirdness logging in so something in the build is not right.
[root@bob foo]# sftp root@localhost:2222
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
root@localhost's password:
Connected to localhost.
File "/root/2222" not found.
[root@bob foo]# mkdir -p /root/2222
[root@bob foo]# sftp root@localhost:2222
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
root@localhost's password:
Connected to localhost.
Changing to: /root/2222
sftp> ls -l
sftp> pwd
Remote working directory: /root/2222
In this case I am using a virtual file system so the user should be sandboxed to another folder but that doesn't happen. The '2222' is weird too that is the port that the user logged in under.
Another issue that can be seen is when logging in. In my code I have
sshd.setPasswordAuthenticator(new LoggingPasswordAuthenticator());
Which is just letting all users login without any password.
import org.apache.sshd.server.auth.AsyncAuthException;
import org.apache.sshd.server.auth.password.PasswordAuthenticator;
import org.apache.sshd.server.auth.password.PasswordChangeRequiredException;
import org.apache.sshd.server.session.ServerSession;
public class LoggingPasswordAuthenticator implements PasswordAuthenticator {
@Override
public boolean authenticate(String username, String password, ServerSession session) throws PasswordChangeRequiredException, AsyncAuthException {
return true; // Authentication with our dummy server always fails
}
}
however when actually testing it I have to use the actual password for the user or I get permission denied.
[root@bob foo]# sftp root@localhost:2222
Warning: Permanently added 'localhost' (ECDSA) to the list of known hosts.
root@localhost's password:
Permission denied, please try again.
KR Dave
With the help of the tracing agent I was able to get my application to work. I'm on java 21. YMMV.
First, you need to add the following flags to the image builder: -H:-AddAllFileSystemProviders --strict-image-heap.
Then register the resources (not sure if necessary):
- META-INF/services/org.apache.sshd.common.io.IoServiceFactoryFactory
- META-INF/services/java.nio.file.spi.FileSystemProvider
- META-INF/services/org.apache.sshd.server.subsystem.SubsystemFactory
- **/sshd-version.properties
Proxies:
- org.apache.sshd.common.session.SessionListener
- org.apache.sshd.common.channel.ChannelListener
- org.apache.sshd.common.forward.PortForwardingEventListener
Classes:
- java.security.KeyFactory
- java.security.KeyPairGenerator
- java.security.MessageDigest
- java.security.Signature
- java.security.interfaces.ECPrivateKey
- java.security.interfaces.ECPublicKey
- java.security.interfaces.RSAPrivateKey
- java.security.interfaces.RSAPublicKey
- javax.crypto.KeyAgreement
- org.apache.sshd.common.io.nio2.Nio2ServiceFactoryFactory
- org.apache.sshd.common.session.SessionListener
- org.apache.sshd.common.util.security.SunJCESecurityProviderRegistrar
- org.apache.sshd.common.util.security.bouncycastle.BouncyCastleSecurityProviderRegistrar
- org.apache.sshd.common.util.security.eddsa.EdDSASecurityProviderRegistrar
Hope this helps, at least as a starting point.
I'm using
Download with wget
wget https://download.oracle.com/graalvm/24/latest/graalvm-jdk-24_linux-x64_bin.tar.gz
I have most of that
META-INF/services/java.lang.System$LoggerFinder
reflect config
[
{
"name": "org.apache.sshd.common.forward.PortForwardingEventListener",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
},{
"name": "org.apache.sshd.common.random.JceRandom",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
}, {
"name": "org.apache.sshd.common.session.SessionListener",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
}, {
"name": "org.apache.sshd.common.util.security.SunJCESecurityProviderRegistrar",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
},{
"name": "org.apache.sshd.server.SshServer",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
}, {
"name": "org.apache.logging.log4j.core.Logger",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
}, {
"name" : "javax.crypto.KeyAgreement",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
}, {
"name" : "javax.crypto.Mac",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
},{
"name" : "javax.crypto.Cipher",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
}, {
"name" : "java.security.KeyFactory",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
}, {
"name" : "java.security.KeyPairGenerator",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
}, {
"name" : "java.security.MessageDigest",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
}, {
"name" : "java.security.Signature",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
}, {
"name" : "java.security.interfaces.ECPrivateKey",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
}, {
"name" : "java.security.interfaces.ECPublicKey",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
}, {
"name" : "java.security.interfaces.RSAPrivateKey",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
}, {
"name" : "java.security.interfaces.RSAPublicKey",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
},{
"name" : "org.apache.sshd.common.io.nio2.Nio2ServiceFactoryFactory",
"allDeclaredConstructors" : true,
"allPublicConstructors" : true,
"allDeclaredMethods" : true,
"allPublicMethods" : true,
"allDeclaredClasses" : true,
"allPublicClasses" : true
},{
"name": "org.bouncycastle.jce.provider.BouncyCastleProvider",
"allDeclaredConstructors": true,
"allPublicMethods": true
},{
"name": "org.apache.sshd.common.util.security.bouncycastle.BouncyCastleSecurityProviderRegistrar",
"allDeclaredConstructors": true,
"allPublicMethods": true
}
]
resource config
{
"resources": {
"includes": [
{
"pattern": "org/bouncycastle/.*"
},
{
"pattern": "java.nio.file.spi.FileSystemProvider"
},
{
"pattern": "org.apache.sshd.server.subsystem.SubsystemFactory"
},
{
"pattern": "META-INF/services/java.lang.System$LoggerFinder"
},
{
"pattern": "META-INF/services/java.net.spi.URLStreamHandlerProvider"
},
{
"pattern": "META-INF/services/java.nio.channels.spi.AsynchronousChannelProvider"
},
{
"pattern": "META-INF/services/org.apache.sshd.common.io.IoServiceFactoryFactory"
},
{
"pattern": "org/slf4j/impl/StaticLoggerBinder.class"
}
]
}
}
proxy config
[
["org.apache.logging.log4j.core.Appender"],
["org.apache.sshd.sftp.server.SftpEventListener"],
["org.apache.sshd.common.session.SessionListener"],
["org.apache.sshd.common.channel.ChannelListener"],
["org.apache.sshd.common.forward.PortForwardingEventListener"]
]
when I ran the tracing agent it gave
{
"reflection": [
{
"type": "com.sun.crypto.provider.DHKeyPairGenerator",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "java.security.AlgorithmParametersSpi"
},
{
"type": "java.security.KeyFactory",
"methods": [
{
"name": "getInstance",
"parameterTypes": [
"java.lang.String"
]
}
]
},
{
"type": "java.security.KeyPairGenerator",
"methods": [
{
"name": "getInstance",
"parameterTypes": [
"java.lang.String"
]
}
]
},
{
"type": "java.security.MessageDigest",
"methods": [
{
"name": "getInstance",
"parameterTypes": [
"java.lang.String"
]
}
]
},
{
"type": "java.security.Signature",
"methods": [
{
"name": "getInstance",
"parameterTypes": [
"java.lang.String"
]
}
]
},
{
"type": "javax.crypto.KeyAgreement",
"methods": [
{
"name": "getInstance",
"parameterTypes": [
"java.lang.String"
]
}
]
},
{
"type": "net.i2p.crypto.eddsa.EdDSAKey"
},
{
"type": "org.apache.sshd.common.io.nio2.Nio2ServiceFactoryFactory",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "org.apache.sshd.common.util.security.bouncycastle.BouncyCastleSecurityProviderRegistrar",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "org.apache.sshd.common.util.security.eddsa.EdDSASecurityProviderRegistrar",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "org.bouncycastle.jce.provider.BouncyCastleProvider"
},
{
"type": "sun.security.provider.MD5",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "sun.security.provider.NativePRNG",
"methods": [
{
"name": "<init>",
"parameterTypes": [
"java.security.SecureRandomParameters"
]
}
]
},
{
"type": "sun.security.provider.SHA",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "sun.security.provider.SHA2$SHA224",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "sun.security.provider.SHA2$SHA256",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "sun.security.provider.SHA5$SHA384",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": "sun.security.provider.SHA5$SHA512",
"methods": [
{
"name": "<init>",
"parameterTypes": []
}
]
},
{
"type": {
"proxy": [
"org.apache.sshd.common.channel.ChannelListener"
]
}
},
{
"type": {
"proxy": [
"org.apache.sshd.common.forward.PortForwardingEventListener"
]
}
},
{
"type": {
"proxy": [
"org.apache.sshd.common.session.SessionListener"
]
}
},
{
"type": {
"proxy": [
"org.apache.sshd.sftp.server.SftpEventListener"
]
}
}
],
"resources": [
{
"glob": "META-INF/services/java.lang.System$LoggerFinder"
},
{
"glob": "META-INF/services/java.net.spi.URLStreamHandlerProvider"
},
{
"glob": "META-INF/services/java.nio.channels.spi.AsynchronousChannelProvider"
},
{
"glob": "META-INF/services/org.apache.sshd.common.io.IoServiceFactoryFactory"
},
{
"glob": "org/slf4j/impl/StaticLoggerBinder.class"
}
],
"bundles": [],
"jni": [
{
"type": "java.lang.Boolean",
"methods": [
{
"name": "getBoolean",
"parameterTypes": [
"java.lang.String"
]
}
]
}
]
}
Alternatively, metadata can be contributed to the reachability metadata repository.
I think that would be the way to go. I know that there's a lot of reflection going on in Apache MINA sshd, especially in the area of SecurityProviders, and the proxying of various listeners.
But we will not be able to maintain any such metadata when our code changes. Better have such metadata be maintained where it is used, per version of the library, i.e., in the reachability metadata repository.