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

[static native image] Failed to load native library:sqlite #104

Open
lost22git opened this issue Sep 29, 2023 · 4 comments
Open

[static native image] Failed to load native library:sqlite #104

lost22git opened this issue Sep 29, 2023 · 4 comments

Comments

@lost22git
Copy link

lost22git commented Sep 29, 2023

  • quarkus static native image build args configuration
quarkus.native.additional-build-args="--libc=musl,--static"

ref: https://quarkus.io/guides/building-native-image#build-fully-static-native-executables

  • error info when startup:
Failed to load native library:sqlite-3.43.0.0-0705174b-80e6-4a43-85a8-38f01135a3d8-libsqlitejdbc.so. osinfo: Linux/x86_64
java.lang.UnsatisfiedLinkError: Can't load library: /tmp/sqlite-3.43.0.0-0705174b-80e6-4a43-85a8-38f01135a3d8-libsqlitejdbc.so
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.NativeLibrarySupport.loadLibraryAbsolute(NativeLibrarySupport.java:100)
        at java.base@21/java.lang.ClassLoader.loadLibrary(ClassLoader.java:114)
        at java.base@21/java.lang.Runtime.load0(Runtime.java:852)
        at java.base@21/java.lang.System.load(System.java:2021)
        at org.sqlite.SQLiteJDBCLoader.loadNativeLibrary(SQLiteJDBCLoader.java:264)
        at org.sqlite.SQLiteJDBCLoader.extractAndLoadLibraryFile(SQLiteJDBCLoader.java:221)
        at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:329)
        at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:72)
        at org.sqlite.core.NativeDB.load(NativeDB.java:67)
        at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:280)
        at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:67)
        at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:28)
        at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:19)
        at org.sqlite.JDBC.createConnection(JDBC.java:104)
        at org.sqlite.JDBC.connect(JDBC.java:77)
        at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:226)
        at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:536)
        at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:517)
        at java.base@21/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:75)
        at java.base@21/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.base@21/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base@21/java.lang.Thread.runWith(Thread.java:1596)
        at java.base@21/java.lang.Thread.run(Thread.java:1583)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:833)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:211)
Failed to load native library through System.loadLibrary
java.lang.UnsatisfiedLinkError: No sqlitejdbc in java.library.path
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.NativeLibrarySupport.loadLibraryRelative(NativeLibrarySupport.java:136)
        at java.base@21/java.lang.ClassLoader.loadLibrary(ClassLoader.java:106)
        at java.base@21/java.lang.Runtime.loadLibrary0(Runtime.java:916)
        at java.base@21/java.lang.System.loadLibrary(System.java:2059)
        at org.sqlite.SQLiteJDBCLoader.loadNativeLibraryJdk(SQLiteJDBCLoader.java:283)
        at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:353)
        at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:72)
        at org.sqlite.core.NativeDB.load(NativeDB.java:67)
        at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:280)
        at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:67)
        at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:28)
        at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:19)
        at org.sqlite.JDBC.createConnection(JDBC.java:104)
        at org.sqlite.JDBC.connect(JDBC.java:77)
        at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:226)
        at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:536)
        at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:517)
        at java.base@21/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:75)
        at java.base@21/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.base@21/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base@21/java.lang.Thread.runWith(Thread.java:1596)
        at java.base@21/java.lang.Thread.run(Thread.java:1583)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:833)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:211)
@alexeysharandin
Copy link
Member

Hi @lost22git , could you plz provide reproducer for this.
I see what agoral pool init in build time instead of runtime as expected.

@lost22git
Copy link
Author

@alexeysharandin
Copy link
Member

alexeysharandin commented Oct 2, 2023

@lost22git

compilation in ubuntu with musl

root@de5aee2deac9:/tmp/test-quarkus# ./gradlew clean && ./gradlew native -Pstatic -x test

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.4-rc-1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 930ms
2 actionable tasks: 2 executed

> Task :app:compileJava
/tmp/test-quarkus/app/src/main/java/lost/test/quarkus/FighterMapper.java:11: warning: Unmapped target properties: "id, createdAt, updatedAt".
    Fighter fromFighterCreate(FighterCreate fighterCreate);
            ^
1 warning
Warning: The option '-H:+PlatformInterfaceCompatibilityMode' is experimental and must be enabled via '-H:+UnlockExperimentalVMOptions' in the future.
Warning: The option '-H:ReflectionConfigurationResources=META-INF/native-image/io.netty/netty-transport/reflection-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.
========================================================================================================================
GraalVM Native Image: Generating 'app-0.0.1-runner' (static executable)...
========================================================================================================================
For detailed information and explanations on the build output, visit:
https://github.com/oracle/graal/blob/master/docs/reference-manual/native-image/BuildOutput.md
------------------------------------------------------------------------------------------------------------------------
The URL protocol jar is not tested and might not work as expected.
Supported URL protocols enabled by default: file,resource. Supported URL protocols available on demand: http,https.
SLF4J: Class path contains multiple SLF4J providers.
SLF4J: Found provider [ch.qos.logback.classic.spi.LogbackServiceProvider@29f0802c]
SLF4J: Found provider [org.slf4j.impl.JBossSlf4jServiceProvider@3a60c416]
SLF4J: See https://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual provider is of type [ch.qos.logback.classic.spi.LogbackServiceProvider@29f0802c]
11:18:13.597 [main] DEBUG io.netty.util.internal.logging.InternalLoggerFactory -- Using SLF4J as the default logging framework
11:18:13.598 [main] DEBUG io.netty.buffer.AbstractByteBuf -- -Dio.netty.buffer.checkAccessible: true
11:18:13.599 [main] DEBUG io.netty.buffer.AbstractByteBuf -- -Dio.netty.buffer.checkBounds: true
11:18:13.599 [main] DEBUG io.netty.util.ResourceLeakDetector -- -Dio.netty.leakDetection.level: disabled
11:18:13.599 [main] DEBUG io.netty.util.ResourceLeakDetector -- -Dio.netty.leakDetection.targetRecords: 4
11:18:13.600 [main] DEBUG io.netty.util.ResourceLeakDetectorFactory -- Loaded default ResourceLeakDetector: io.netty.util.ResourceLeakDetector@591fd34d
[1/8] Initializing...                                                                                    (7.1s @ 0.20GB)
 Java version: 21+35, vendor version: GraalVM CE 21+35.1
 Graal compiler: optimization level: 2, target machine: x86-64-v3
 C compiler: x86_64-linux-musl-gcc (linux, x86_64, 11.4.0)
 Garbage collector: Serial GC (max heap size: 80% of RAM)
 9 user-specific feature(s):
 - com.oracle.svm.thirdparty.gson.GsonFeature
 - io.quarkus.caffeine.runtime.graal.CacheConstructorsFeature
 - io.quarkus.hibernate.orm.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase
 - io.quarkus.hibernate.validator.runtime.DisableLoggingFeature: Disables INFO logging during the analysis phase for the [org.hibernate.validator.internal.util.Version] categories
 - io.quarkus.runner.Feature: Auto-generated class by Quarkus from the existing extensions
 - io.quarkus.runtime.graal.DisableLoggingFeature: Disables INFO logging during the analysis phase
 - org.eclipse.angus.activation.nativeimage.AngusActivationFeature
 - org.hibernate.graalvm.internal.GraalVMStaticFeature: Hibernate ORM's static reflection registrations for GraalVM
 - org.sqlite.nativeimage.SqliteJdbcFeature
------------------------------------------------------------------------------------------------------------------------
 5 experimental option(s) unlocked:
 - '-H:+AllowFoldMethods' (origin(s): command line)
 - '-H:+PlatformInterfaceCompatibilityMode' (origin(s): command line)
 - '-H:BuildOutputJSONFile' (origin(s): command line)
 - '-H:-UseServiceLoaderFeature' (origin(s): command line)
 - '-H:ReflectionConfigurationResources' (origin(s): 'META-INF/native-image/io.netty/netty-transport/native-image.properties' in 'file:///tmp/test-quarkus/app/build/app-0.0.1-native-image-source-jar/lib/io.netty.netty-transport-4.1.97.Final.jar')
------------------------------------------------------------------------------------------------------------------------
Build resources:
 - 9.19GB of memory (75.6% of 12.17GB system memory, determined at start)
 - 8 thread(s) (100.0% of 8 available processor(s), determined at start)
# Printing compilation-target information to: /tmp/test-quarkus/app/build/app-0.0.1-native-image-source-jar/reports/target_info_20231002_111814.txt
11:18:15.162 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent0 -- -Dio.netty.noUnsafe: false
11:18:15.163 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent0 -- Java version: 21
11:18:15.163 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent0 -- sun.misc.Unsafe.theUnsafe: available
11:18:15.164 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent0 -- sun.misc.Unsafe.copyMemory: available
11:18:15.164 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent0 -- sun.misc.Unsafe.storeFence: available
11:18:15.180 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent0 -- java.nio.Buffer.address: available
11:18:15.182 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent0 -- direct buffer constructor: unavailable: Unable to make private java.nio.DirectByteBuffer(long,long) accessible: module java.base does not "opens java.nio" to unnamed module @7fa8487e
11:18:15.182 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent0 -- java.nio.Bits.unaligned: unavailable, true, Unable to make static boolean java.nio.Bits.unaligned() accessible: module java.base does not "opens java.nio" to unnamed module @7fa8487e
11:18:15.183 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent0 -- jdk.internal.misc.Unsafe.allocateUninitializedArray(int): unavailable: class io.netty.util.internal.PlatformDependent0$7 cannot access class jdk.internal.misc.Unsafe (in module java.base) because module java.base does not export jdk.internal.misc to unnamed module @7fa8487e
11:18:15.183 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent0 -- java.nio.DirectByteBuffer.<init>(long, {int,long}): unavailable
11:18:15.183 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent -- sun.misc.Unsafe: available
11:18:15.185 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent -- maxDirectMemory: 9872867328 bytes (maybe)
11:18:15.185 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent -- -Dio.netty.tmpdir: /tmp (java.io.tmpdir)
11:18:15.185 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent -- -Dio.netty.bitMode: 64 (sun.arch.data.model)
11:18:15.186 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent -- -Dio.netty.maxDirectMemory: -1 bytes
11:18:15.186 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent -- -Dio.netty.uninitializedArrayAllocationThreshold: -1
11:18:15.187 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.CleanerJava9 -- java.nio.ByteBuffer.cleaner(): available
11:18:15.187 [ForkJoinPool-2-worker-2] DEBUG io.netty.util.internal.PlatformDependent -- -Dio.netty.noPreferDirect: false
11:18:15.337 [ForkJoinPool-2-worker-1] DEBUG io.netty.util.NetUtil -- -Djava.net.preferIPv4Stack: false
11:18:15.338 [ForkJoinPool-2-worker-1] DEBUG io.netty.util.NetUtil -- -Djava.net.preferIPv6Addresses: false
11:18:15.338 [ForkJoinPool-2-worker-1] DEBUG io.netty.util.NetUtilInitializations -- Loopback interface: lo (lo, 127.0.0.1)
11:18:15.338 [ForkJoinPool-2-worker-1] DEBUG io.netty.util.NetUtil -- /proc/sys/net/core/somaxconn: 4096
11:18:15.503 [ForkJoinPool-2-worker-1] DEBUG io.netty.util.internal.InternalThreadLocalMap -- -Dio.netty.threadLocalMap.stringBuilder.initialSize: 1024
11:18:15.503 [ForkJoinPool-2-worker-1] DEBUG io.netty.util.internal.InternalThreadLocalMap -- -Dio.netty.threadLocalMap.stringBuilder.maxSize: 4096
11:18:16,740 WARN  [io.qua.config] Unrecognized configuration key "quarkus" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
11:18:25.926 [ForkJoinPool-2-worker-5] DEBUG io.netty.util.Recycler -- -Dio.netty.recycler.maxCapacityPerThread: 4096
11:18:25.928 [ForkJoinPool-2-worker-5] DEBUG io.netty.util.Recycler -- -Dio.netty.recycler.ratio: 8
11:18:25.929 [ForkJoinPool-2-worker-5] DEBUG io.netty.util.Recycler -- -Dio.netty.recycler.chunkSize: 32
11:18:25.930 [ForkJoinPool-2-worker-5] DEBUG io.netty.util.Recycler -- -Dio.netty.recycler.blocking: false
11:18:25.931 [ForkJoinPool-2-worker-5] DEBUG io.netty.util.Recycler -- -Dio.netty.recycler.batchFastThreadLocalOnly: true
<=========----> 72% EXECUTING [55s]-5] DEBUG io.netty.channel.nio.NioEventLoop -- -Dio.netty.noKeySetOptimization: false
11:18:26.400 [ForkJoinPool-2-worker-5] DEBUG io.netty.channel.nio.NioEventLoop -- -Dio.netty.selectorAutoRebuildThreshold: 512
11:18:49.717 [ForkJoinPool-2-worker-4] DEBUG io.netty.channel.MultithreadEventLoopGroup -- -Dio.netty.eventLoopThreads: 16
11:18:50.296 [ForkJoinPool-2-worker-2] DEBUG io.netty.handler.codec.compression.Brotli -- Failed to load brotli4j; Brotli support will be unavailable.
java.lang.UnsatisfiedLinkError: Failed to find Brotli native library in classpath: /lib/linux-x86_64/libbrotli.so
        at com.aayushatharva.brotli4j.Brotli4jLoader.<clinit>(Brotli4jLoader.java:77)
        at io.netty.handler.codec.compression.Brotli.<clinit>(Brotli.java:46)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized0(Native Method)
        at java.base/jdk.internal.misc.Unsafe.ensureClassInitialized(Unsafe.java:1160)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ClassInitializationSupport.ensureClassInitialized(ClassInitializationSupport.java:177)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.classinitialization.ProvenSafeClassInitializationSupport.computeInitKindAndMaybeInitializeClass(ProvenSafeClassInitializationSupport.java:348)
11:18:59.883 [ForkJoinPool-2-worker-7] DEBUG io.netty.handler.ssl.JdkSslContext -- Default protocols (JDK): [TLSv1.3, TLSv1.2] teInitKindAndMaybeInitializeClass(ProvenSafeC
11:18:59.885 [ForkJoinPool-2-worker-7] DEBUG io.netty.handler.ssl.JdkSslContext -- Default cipher suites (JDK): [TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_AES_128_GCM_SHA256, TLS_AES_256_GCM_SHA384]
11:19:01.020 [main] DEBUG io.netty.resolver.DefaultHostsFileEntriesResolver -- -Dio.netty.hostsFileRefreshInterval: 0
<=========----> 72% EXECUTING [1m 5s]
> :app:quarkusAppPartsBuild
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.meta.AnalysisType.isInitialized(AnalysisType.java:911)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.maybeEagerlyInitialize(BytecodeParser.java:4444)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeStatic(BytecodeParser.java:1684)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.genInvokeStatic(BytecodeParser.java:1677)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBytecode(BytecodeParser.java:5441)
<=========----> 72% EXECUTING [1m 15s]g.graalvm.compiler.java.BytecodeParser.iterateBytecodesForBlock(BytecodeParser.java:3431)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.iterateBytecodesForBlock(SharedGraphBuilderPhase.java:741)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.handleBytecodeBlock(BytecodeParser.java:3391)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.processBlock(BytecodeParser.java:3233)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.build(BytecodeParser.java:1137)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase$SharedBytecodeParser.build(SharedGraphBuilderPhase.java:161)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.BytecodeParser.buildRootMethod(BytecodeParser.java:1029)
        at jdk.internal.vm.compiler/org.graalvm.compiler.java.GraphBuilderPhase$Instance.run(GraphBuilderPhase.java:101)
        at org.graalvm.nativeimage.builder/com.oracle.svm.hosted.phases.SharedGraphBuilderPhase.run(SharedGraphBuilderPhase.java:115)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.Phase.run(Phase.java:49)
        at jdk.internal.vm.compiler/org.graalvm.compiler.phases.BasePhase.apply(BasePhase.java:434)
# Printing native-library information to: /tmp/test-quarkus/app/build/app-0.0.1-native-image-source-jar/reports/native_library_info_20231002_111929.txt
[2/8] Performing analysis...  [*****]                                                                   (74.4s @ 1.82GB)
   20,631 reachable types   (89.0% of   23,173 total)
   27,963 reachable fields  (61.0% of   45,863 total)
  100,147 reachable methods (55.0% of  182,166 total)
    6,343 types,   166 fields, and 4,517 methods registered for reflection.AnalysisMethod.ensureGraphParsed(AnalysisMethod.java:843)
       72 types,    67 fields, and    72 methods registered for JNI accesses.InlineBeforeAnalysisGraphDecoder.lookupEncodedGraph(InlineBeforeAnalysisGraphDecoder.java:175)
        4 native libraries: dl, pthread, rt, zm.compiler.replacements.PEGraphDecoder.doInline(PEGraphDecoder.java:1211)
[3/8] Building universe...                                                                              (17.9s @ 1.74GB)
<=========----> 72% EXECUTING [1m 57s]                                                                   (9.2s @ 2.20GB)
<=========----> 72% EXECUTING [1m 56s]
> :app:quarkusAppPartsBuild
        at jdk.internal.vm.compiler/org.graalvm.compiler.nodes.GraphDecoder.processNextNode(GraphDecoder.java:921)
        at org.graalvm.nativeimage.pointsto/com.oracle.graal.pointsto.phases.InlineBeforeAnalysisGraphDecoder.processNextNode(InlineBeforeAnalysisGraphDecoder.java:344)
[5/8] Inlining methods...     [****]                                                                     (5.8s @ 2.60GB)
[6/8] Compiling methods...    [*********]                                                               (85.8s @ 3.25GB)
[7/8] Layouting methods...    [***]                                                                      (7.7s @ 2.37GB)
[8/8] Creating image...       [***]                                                                      (8.4s @ 3.14GB)
  38.51MB (47.34%) for code area:    64,343 compilation units
  42.34MB (52.04%) for image heap:  463,659 objects and 62 resources
 517.80kB ( 0.62%) for other datae.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.ensureFlowsGraphCreated(MethodTypeFlow.java:153)
  81.36MB in totalalvm.nativeimage.pointsto/com.oracle.graal.pointsto.flow.MethodTypeFlow.getOrCreateMethodFlowsGraphInfo(MethodTypeFlow.java:111)
------------------------------------------------------------------------------------------------------------------------servedUpdate$0(DefaultSpecialInvokeTypeFlow.java:88)
Top 10 origins of code area:                                Top 10 object types in image heap:ction.forEach(LightImmutableCollection.java:90)
  13.29MB java.base                                           12.52MB byte[] for code metadataInvokeTypeFlow.onObservedUpdate(DefaultSpecialInvokeTypeFlow.java:87)
   8.05MB org.hibernate.orm.hibernate-core-6.2.7.Final.jar     6.49MB byte[] for java.lang.Stringow.java:620)
   1.88MB c.f.jackson.core.jackson-databind-2.15.2.jar         4.99MB java.lang.Classs$1.run(PointsToAnalysis.java:491)
   1.55MB svm.jar (Native Image)                               4.18MB java.lang.Stringxecutor.executeCommand(CompletionExecutor.java:187)
   1.15MB app-0.0.1-runner.jar                                 1.73MB com.oracle.svm.core.hub.DynamicHubCompanionce$0(CompletionExecutor.java:171)
 891.47kB modified-io.vertx.vertx-core-4.4.5.jar               1.14MB byte[] for embedded resources:1423)
 648.64kB o.jboss.narayana.jta.narayana-jta-7.0.0.Final.jar    1.09MB byte[] for reflection metadata
 602.25kB jdk.proxy4                                         845.81kB java.lang.String[]ol.java:1312)
 593.86kB com.fasterxml.jackson.core.jackson-core-2.15.2.jar 762.76kB java.lang.Object[]
 442.72kB io.netty.netty-buffer-4.1.97.Final.jar             737.07kB byte[] for general heap data
   9.02MB for 124 more packages                                7.92MB for 4793 more object types)
------------------------------------------------------------------------------------------------------------------------std support will be unavailable.
Recommendations:rkJoinPool-2-worker-5] DEBUG io.netty.buffer.AdvancedLeakAwareByteBuf -- -Dio.netty.leakDetection.acquireAndReleaseOnly: false
 INIT: Adopt '-H:+StrictImageHeap' to prepare for the next GraalVM release.sion.ZlibCodecFactory -- -Dio.netty.noJdkZlibDecoder: false
 HEAP: Set max heap for improved and more predictable memory usage..compression.ZlibCodecFactory -- -Dio.netty.noJdkZlibEncoder: false
 CPU:  Enable more CPU features with '-march=native' for improved performance.pendent -- org.jctools-core.MpscChunkedArrayQueue: available
------------------------------------------------------------------------------------------------------------------------
                       21.6s (9.8% of total time) in 149 GCs | Peak RSS: 5.12GB | CPU load: 6.86
------------------------------------------------------------------------------------------------------------------------
Produced artifacts:
 /tmp/test-quarkus/app/build/app-0.0.1-native-image-source-jar/app-0.0.1-runner (executable)
 /tmp/test-quarkus/app/build/app-0.0.1-native-image-source-jar/app-0.0.1-runner-build-output-stats.json (build_info)
========================================================================================================================
Finished generating 'app-0.0.1-runner' in 3m 39s.

Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

For more on this, please refer to https://docs.gradle.org/8.4-rc-1/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.

BUILD SUCCESSFUL in 3m 49s
10 actionable tasks: 9 executed, 1 up-to-date

@alexeysharandin
Copy link
Member

alexeysharandin commented Oct 2, 2023

Understood. I see this error in app start.

root@de5aee2deac9:/tmp/test-quarkus# ./app/build/app-0.0.1-runner
11:41:18.232 [Thread-1] DEBUG io.netty.channel.DefaultChannelId -- -Dio.netty.processId: 6666 (auto-detected)
11:41:18.232 [Thread-1] DEBUG io.netty.channel.DefaultChannelId -- -Dio.netty.machineId: 40:16:4f:92:29:28:3e:e4 (user-set)
11:41:18.238 [main] DEBUG io.netty.util.concurrent.GlobalEventExecutor -- -Dio.netty.globalEventExecutor.quietPeriodSeconds: 1
__  ____  __  _____   ___  __ ____  ______
 --/ __ \/ / / / _ | / _ \/ //_/ / / / __/
 -/ /_/ / /_/ / __ |/ , _/ ,< / /_/ /\ \
--\___\_\____/_/ |_/_/|_/_/|_|\____/___/
2023-10-02 11:41:18,231 WARN  [io.qua.config] (main) Unrecognized configuration key "quarkus" was provided; it will be ignored; verify that the dependency extension for this configuration is set or that you did not make a typo
2023-10-02 11:41:18,244 WARN  [io.qua.agr.run.AgroalConnectionConfigurer] (JPA Startup Thread) Agroal does not support detecting if a connection is still usable after an exception for database kind: sqlite
Failed to load native library:sqlite-3.43.0.0-f478dde6-2043-4bfd-bfaf-9c7d1b8173ab-libsqlitejdbc.so. osinfo: Linux/x86_64
java.lang.UnsatisfiedLinkError: Can't load library: /tmp/sqlite-3.43.0.0-f478dde6-2043-4bfd-bfaf-9c7d1b8173ab-libsqlitejdbc.so
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.jdk.NativeLibrarySupport.loadLibraryAbsolute(NativeLibrarySupport.java:100)
        at java.base@21/java.lang.ClassLoader.loadLibrary(ClassLoader.java:114)
        at java.base@21/java.lang.Runtime.load0(Runtime.java:852)
        at java.base@21/java.lang.System.load(System.java:2021)
        at org.sqlite.SQLiteJDBCLoader.loadNativeLibrary(SQLiteJDBCLoader.java:264)
        at org.sqlite.SQLiteJDBCLoader.extractAndLoadLibraryFile(SQLiteJDBCLoader.java:221)
        at org.sqlite.SQLiteJDBCLoader.loadSQLiteNativeLibrary(SQLiteJDBCLoader.java:329)
        at org.sqlite.SQLiteJDBCLoader.initialize(SQLiteJDBCLoader.java:72)
        at org.sqlite.core.NativeDB.load(NativeDB.java:67)
        at org.sqlite.SQLiteConnection.open(SQLiteConnection.java:280)
        at org.sqlite.SQLiteConnection.<init>(SQLiteConnection.java:67)
        at org.sqlite.jdbc3.JDBC3Connection.<init>(JDBC3Connection.java:28)
        at org.sqlite.jdbc4.JDBC4Connection.<init>(JDBC4Connection.java:19)
        at org.sqlite.JDBC.createConnection(JDBC.java:104)
        at org.sqlite.JDBC.connect(JDBC.java:77)
        at io.agroal.pool.ConnectionFactory.createConnection(ConnectionFactory.java:226)
        at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:536)
        at io.agroal.pool.ConnectionPool$CreateConnectionTask.call(ConnectionPool.java:517)
        at java.base@21/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at io.agroal.pool.util.PriorityScheduledExecutor.beforeExecute(PriorityScheduledExecutor.java:75)
        at java.base@21/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
        at java.base@21/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base@21/java.lang.Thread.runWith(Thread.java:1596)
        at java.base@21/java.lang.Thread.run(Thread.java:1583)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:833)
        at org.graalvm.nativeimage.builder/com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:211)
Failed to load native library through System.loadLibrary

looks like something going wrong in https://github.com/xerial/sqlite-jdbc library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants