Fork me on GitHub
#graalvm
<
2020-06-13
>
valerauko05:06:11

is it possible to add reflection config for an interface? i'm playing with netty and while i got it to compile it now throws tons of "missing method" warnings at runtime, all the ChannelInboundHandler interface.

valerauko06:06:48

hmm

[io.netty/netty-transport-native-epoll "4.1.50.Final" :classifier "linux-x86_64"]
installing that platform-specific binary won't let native-image compile. remove the :classifier and it works

borkdude06:06:29

@vale yes, I have lots of interfaces in the reflection config for babashka

valerauko06:06:15

gonna check it out for reference. for now i ran the -agentlib=native-image-agent thing and had graal generate the config files

borkdude06:06:44

That works but only for classes it actually runs during execution. In babashka it is unknown which classes are going to be used by a user

borkdude06:06:21

I generate the config using a script, the config itself it gitignored

valerauko06:06:47

yeah my goal was to just check if this will build at all (gonna turn it into a library eventually)

valerauko06:06:09

what script do you use to generate the config?

borkdude07:06:28

script/reflection

Kevin15:06:01

Hey, I'm trying to get HikariCP to work with GraalVM, but hitting a wall atm.

(hikari-cp/make-datasource {:jdbc-url "jdbc:})
This line, with GraalVM, returns the following error:
Exception in thread "main" com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: null
	at com.zaxxer.hikari.pool.HikariPool.throwPoolInitializationException(HikariPool.java:576)
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:562)
	at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
	at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:81)
	at hikari_cp.core$make_datasource.invokeStatic(core.clj:248)
	at myapp.main$_main.invokeStatic(main.clj:65)
	at myapp.main$_main.doInvoke(main.clj:64)
	at clojure.lang.RestFn.invoke(RestFn.java:397)
	at clojure.lang.AFn.applyToHelper(AFn.java:152)
	at clojure.lang.RestFn.applyTo(RestFn.java:132)
	at myapp.main.main(Unknown Source)
Caused by: java.lang.NullPointerException
	at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:369)
	at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:198)
	at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:467)
	at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:541)
However, when I run it with clj -m myapp.main it works. Anyone have an idea?

borkdude15:06:56

@kevin.van.rooijen Take a look at the pgmig project, it uses hikari. Could be Postgres a driver problem. You need this flag for postgres: https://github.com/babashka/babashka-sql-pods/blob/5d0f2a2ce8c7b82a8df1a51e8a44411e01c93d4f/script/compile#L60

Kevin15:06:29

haha I was litterally using that as reference, I actually have that flag enabled

Kevin15:06:43

I'll take a deeper look, thanks

Kevin15:06:21

Good to know that Hikari can work, I just need to figure it out

borkdude15:06:31

Where are you creating the data-source, not top level I hope?

Kevin15:06:54

No, I just put it in main for debugging purposes

borkdude15:06:22

I think pgmig used a patched version of hikari.

Kevin15:06:42

Yeah looks like it

nate22:06:36

many thanks to @borkdude for his help