Skip to content

qbit boon reflect ClassCastException: [B incompatible with [C

I am trying to use qbit ( for the first time, and I have to deal with all dependencies manually (can’t use maven etc.)

I am getting the following exception:

Exception in thread "main" java.lang.ExceptionInInitializerError
at java.base/java.lang.J9VMInternals.ensureError(
at java.base/java.lang.J9VMInternals.recordInitializationFailure(
at io.advantageous.boon.core.reflection.Reflection.<clinit>(
at io.advantageous.boon.core.reflection.ClassMeta.classMeta(
at io.advantageous.qbit.QBit.registerReflectionAndJsonParser(
at io.advantageous.qbit.QBit.doGetFactory(
at io.advantageous.qbit.QBit.factory(
at io.advantageous.qbit.http.server.HttpServerBuilder.getFactory(
at com.myapp.main(
Caused by: java.lang.ClassCastException: [B incompatible with [C
io.advantageous.boon.core.reflection.FastStringUtils$StringImplementation$1.toCharArray (
at io.advantageous.boon.core.reflection.FastStringUtils.toCharArray(
at io.advantageous.boon.core.Str.underBarCase(
at io.advantageous.boon.core.Sys.sysProp(
at io.advantageous.boon.core.timer.TimeKeeperBasic.<init>(
at io.advantageous.boon.core.Sys.<clinit>(
... 9 more

The jar files I have added so far as dependencies are:

  • qbit-core-2.0.0.jar
  • qbit-web-0.8.18.jar — I have also tried not including this, but it seems to make no difference either way
  • boon-reflekt-0.6.6.jar

I have also tried adding the following, which seem to be dependencies according to maven, but with no success:

  • reactive-streams-1.0.0.jar
  • boon-json-0.6.6.jar
  • metrik-0.1.0.jar
  • slf4j-api-1.7.30.jar

Additionally, my project uses:

  • curator-recipes-4.2.0.jar
  • curator-x-discovery-4.2.0.jar
  • org.json.jar (not sure which version I have but the jar is from 18th September 2017)

Would anyone be able to tell me what I’m missing? The maven link for qbit is:



The problem is that the you are using Java 9+ and the boon dependency hasn’t been updated for Java 9+. The FastStringUtils class within this library does some reflective hackery to access internal fields of the String class, but the internal fields of String changed in Java 9.

This GitHub issue was opened in November 2015 for this problem and is still open almost five years later.

The workarounds are either to run your application in Java 8, or to run your project with the system property io.advantageous.boon.faststringutils.disable set to true. You can do this by adding the command-line argument -Dio.advantageous.boon.faststringutils.disable=true, or by adding the line

System.setProperty("io.advantageous.boon.faststringutils.disable", "true");

to your App class’s main method, before it calls the build() method shown in the stacktrace.

User contributions licensed under: CC BY-SA
3 People found this is helpful