Skip to content

Commit f4dfdf9

Browse files
committed
Explicit initialization config could be quite interesting for
Yolean/kubernetes-kafka#310 because when I investigated the timeouts there I found reports that similar errors had been fixed by cleaning up (or trashing) persisted state. > Detected a direct/mapped ByteBuffer in the image heap. > A direct ByteBuffer has a pointer to unmanaged C memory, > and C memory from the image generator is not available at image run time. > A mapped ByteBuffer references a file descriptor, > which is no longer open and mapped at run time. Error: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Detected a direct/mapped ByteBuffer in the image heap. A direct ByteBuffer has a pointer to unmanaged C memory, and C memory from the image generator is not available at image run time.A mapped ByteBuffer references a file descriptor, which is no longer open and mapped at run time. To see how this object got instantiated use -H:+TraceClassInitialization. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image run time by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point. Detailed message: Trace: at parsing org.apache.zookeeper.server.persistence.FilePadding.padFile(FilePadding.java:78) Call path from entry point to org.apache.zookeeper.server.persistence.FilePadding.padFile(FileChannel): at org.apache.zookeeper.server.persistence.FilePadding.padFile(FilePadding.java:76)
1 parent 695f84f commit f4dfdf9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

native/zookeeper-server-start.Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ RUN native-image \
3434
-H:+ReportExceptionStackTraces \
3535
--no-fallback \
3636
-H:ConfigurationFileDirectories=/home/nonroot/native-config \
37+
--initialize-at-build-time \
38+
--initialize-at-run-time=org.apache.zookeeper.server.persistence.FileTxnLog \
39+
--initialize-at-run-time=org.apache.zookeeper.server.persistence.TxnLogToolkit \
40+
--initialize-at-run-time=org.apache.zookeeper.server.persistence.FilePadding \
3741
# Added because of org.apache.zookeeper.common.X509Util, org.apache.zookeeper.common.ZKConfig, javax.net.ssl.SSLContext ...
3842
--allow-incomplete-classpath \
3943
# -D options from entrypoint

0 commit comments

Comments
 (0)