We are developing a quarkus application using jCasbin. When trying to run a native image, an UnsupportedFeatureError is thrown, because aviator’s ASMCodeGenerator is trying to use ClassLoader::defineClass to generate a class from bytes at runtime when compiling the matcher function, which is not supported by GraalVM. Attempts of adding predefined-classes-config.json also failed, because the generated class names are dynamic (using timestamp), which makes the analysis result of graals native-image-agent useless …
Is there any way of configuring jCasbin so it can be run in a native application?
Finally figured it out:
<quarkus.native.additional-build-args>-J-Daviator.eval.mode=INTERPRETER</quarkus.native.additional-build-args>
Might be worth adding to the README, that this system property is required when building native applications using jCasbin:
aviator.eval.mode=INTERPRETER
thanks! Added to docs: https://github.com/casbin/casbin-website-v2/commit/5cecaa6b1b9d49d208cc87d4df0e677fc674f77b
Join the conversation
Sign up to reply, like and follow topics.
Suggested Topics
Want to read more? Browse other topics in Casbin or view latest topics.
1 / 3
Sep 2025
