GraalVM generated native image errors out

I am trying to get my project graalvm compatible. I was successfully able to generate the native image with the --report-unsupported-elements-at-runtime option. I get the following error when I run the generated native image.

	at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:291)
	at clojure.lang.Namespace.<init>(Namespace.java:34)
	at clojure.lang.Namespace.findOrCreate(Namespace.java:176)
	at clojure.lang.Var.internPrivate(Var.java:156)
	at aerospike_migration.core.<clinit>(Unknown Source)
	at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:351)
	at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:271)
Caused by: java.io.FileNotFoundException: Could not locate clojure/core__init.class, clojure/core.clj or clojure/core.cljc on classpath.
	at clojure.lang.RT.load(RT.java:466)
	at clojure.lang.RT.load(RT.java:428)
	at clojure.lang.RT.doInit(RT.java:471)
	at clojure.lang.RT.<clinit>(RT.java:338)
	at com.oracle.svm.core.classinitialization.ClassInitializationInfo.invokeClassInitializer(ClassInitializationInfo.java:351)
	at com.oracle.svm.core.classinitialization.ClassInitializationInfo.initialize(ClassInitializationInfo.java:271)

What could be causing this issue?

How did you generate an Uberjar? Did you make sure you compile it or did you compile the other jar (if using lein). What flags did you use?

1 Like

Are you using --initialize-at-build-time?

1 Like

This was solved with help from @borkdude on the clojurians slack channel. Conversation link - https://clojurians.slack.com/archives/CAJN79WNT/p1599544654015800

Public archive: https://clojurians-log.clojureverse.org/graalvm/2020-09-08

1 Like