JDBC Errors on Pivotal CloudFoundry Deployment

We are using PCF and I am trying to write a simple app to query Dremio via the 4.2.2 JDBC connector. It works great locally, but when I push to PCF it fails with an exception upon init. Any ideas on a solution or a workaround? I have tried both Autowiring the datasource and manually instantiating a connection class to see if there was any difference and there is not. I get this every time.

   2020-05-07T11:42:07.47-0500 [APP/PROC/WEB/0] OUT Caused by: java.lang.NullPointerException: null
   2020-05-07T11:42:07.47-0500 [APP/PROC/WEB/0] OUT 	at cdjd.io.netty.buffer.PooledByteBufAllocatorL$InnerAllocator.<init>(PooledByteBufAllocatorL.java:153) ~[jdbc.Driver-4.2.2.jar:4.2.2-202004211133290458-b550b6fa]
   2020-05-07T11:42:07.47-0500 [APP/PROC/WEB/0] OUT 	at cdjd.io.netty.buffer.PooledByteBufAllocatorL.<init>(PooledByteBufAllocatorL.java:49) ~[jdbc.Driver-4.2.2.jar:4.2.2-202004211133290458-b550b6fa]
   2020-05-07T11:42:07.47-0500 [APP/PROC/WEB/0] OUT 	at cdjd.org.apache.arrow.memory.NettyAllocationManager.<clinit>(NettyAllocationManager.java:33) ~[jdbc.Driver-4.2.2.jar:4.2.2-202004211133290458-b550b6fa]

I tried the 3.0.6 version of the driver as some have mentioned that it works sometimes in cases like this, but it is not working either.

Thank you

Try increasing the MaxDirectMemorySize. by default PCF sets it to 10M (I checked in the cloud version).

cf set-env test-java JAVA_OPTS '-Xmx422202K -Xss1M -XX:ReservedCodeCacheSize=240M -XX:MaxDirectMemorySize=500M -XX:MaxMetaspaceSize=114373K'

1 Like

I forgot to return here and say this worked for me. Thank you very much.