Closed devurandom closed 2 years ago
Sorry, --initialize-at-run-time
does not even work for this namespace:
Exception in thread "main" java.lang.ExceptionInInitializerError
Caused by: java.io.FileNotFoundException: Could not locate [REDACTED]__init.class, [REDACTED].clj or [REDACTED].cljc on classpath.
How do I fix this correctly?
@devurandom Clojure namespace need to be initialized at build time, always, that is the entire point of this project. All Java packages that are used in top level expressions also need to be initialized at build time. The solution is to add an extra --initialize-at-build-time=com.faster.xml.jackson
Another solution could be to delay the usage of such a Java class using a function or a delay
.
I need to pass
--initialize-at-run-time=my.namespace.containing.main
to override graal-build-time's decision to initialise it at build time.Otherwise I will get many errors like:
(This affects several classes in
com.fasterxml.jackson
,org.javamoney.moneta
andcom.zaxxer.hikari
.)For convenience: Would it be possible to mark the namespace containing
-main
with some metadata, so that graal-build-time could recognise it and not try to initialise it at build time?For even more convenience: If the Graal compiler can deduce that
No instances of com.fasterxml.jackson.core.io.SerializedString are allowed in the image heap as this class should be initialized at image runtime.
, is it somehow possible for graal-build-time to do the same and automatically skip initialising namespaces requiring these classes?