DUE TO SPAM, SIGN-UP IS DISABLED. Goto Selfserve wiki signup and request an account.
| Table of Contents |
|---|
GraalVM is becoming an increasingly popular target to deploy Apache CXF services. The most challenging deployments are the ones which bundle Apache CXF services and applications as native images. There are some limitations with that and there are certain improvements incorporated into Apache CXF recently to provide the way to overcome those.
JAX-RS Support
The Apache CXF's JAX-RS implementation does not rely on code generation and dynamic class loading at runtime. In many cases, producing GraalVM's native images is straightforward, assuming the benefits of the assisted configuration of native image builds could be taken of.
You may run into dynamic class generation and/or loading in a few cases:
- when CDI (or other kinds of runtime instrumentation) is involved
Samples
- https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/graalvm_basic
JAX-WS Support
For many JAX-WS services which rely on Apache CXF and use its code-generation capabilities, producing GraalVM's native images is straightforward, assuming the benefits of the assisted configuration of native image builds could be taken of.
Dynamic Servers / Clients
In certain scenarios Apache CXF does aggressive code generation and dynamic class loading at runtime. This violates one of the GraalVM's ahead-of-time compilation limitations which states that "... all classes and all bytecodes that are reachable at run time must be known at build time". Since 3.3.9 / 3.4.2 / 3.5.x there is a way to capture all dynamically generated classes in order to include them into the native image at build time and then use class loading (instead of class generation) at runtime. It eliminates the need for dynamic class generation and loading. The capturing capability is provided by GeneratedClassClassLoaderCapture extension (shown below).
...
You may run into dynamic class generation and/or loading in a few cases:
- when using JaxWsDynamicClientFactory (fully dynamic clients)
- when using request / response wrappers and fault exception wrappers (which may not generated at build time)
- when CDI (or other kinds of runtime instrumentation) is involved
Samples
- https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jaxws_graalvm
- https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jaxws_graalvm_dynamic