Native Build fails by ByteBuffer usage via google-cloud-pubsub
See original GitHub issueDescribe the bug
On Java non native mode works fine, but fails at native image generation by :
Caused by: com.oracle.graal.pointsto.constraints.UnsupportedFeatureException: Detected a direct/mapped ByteBuffer in the image heap. A direct ByteBuffer has a pointer to unmanaged C memory, and C memory from the image generator is not available at image run time.A mapped ByteBuffer references a file descriptor, which is no longer open and mapped at run time. Object has been initialized without the native-image initialization instrumentation and the stack trace can't be tracked. The object was probably created by a class initializer and is reachable from a static field. You can request class initialization at image run time by using the option --initialize-at-run-time=<class-name>. Or you can write your own initialization methods and call them explicitly from your main entry point. Detailed message: Trace: Object was reached by reading field io.grpc.netty.shaded.io.netty.buffer.PoolChunk.memory of constant io.grpc.netty.shaded.io.netty.buffer.PoolChunk@1f2001b6 reached by reading field io.grpc.netty.shaded.io.netty.buffer.PoolChunkList.head of constant io.grpc.netty.shaded.io.netty.buffer.PoolChunkList@3faa2618 reached by ....
Expected behavior
Be able to compile native image witn google-pubsub maven dependecies
Actual behavior fails
To Reproduce Steps to reproduce the behavior:
- Clone this repohttps://github.com/danipenaperez/issue-quarkus-google-pubsub (it is so simple ,generated from quarkus greeting artifact example) , and added google-pub-sub library. Only one java class exists.
- Execute native compilation : mvn package -Pnative
- See the failed stack trace
Configuration
# Add your application.properties here, if applicable.
defaults from greeting artifact generation quarkus
Screenshots (If applicable, add screenshots to help explain your problem.)
Environment (please complete the following information):
-
Output of
uname -a
orver
:Linux dpena 4.4.0-189-generic #219-Ubuntu SMP Tue Aug 11 12:26:50 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux -
Output of
java -version
: openjdk version “11.0.1” 2018-10-16 OpenJDK Runtime Environment (build 11.0.1+13-Ubuntu-3ubuntu116.04ppa1) -
GraalVM version (if different from Java): graalvm-ce-java11-20.1.0
-
Quarkus version or git rev: 1.7.0.Final
-
Build tool (ie. output of
mvnw --version
orgradlew --version
):
Additional context (Add any other context about the problem here.)
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
@danipenaperez
google-cloud-pubsub
is not yet supported by Quarkus, there is no extension for it.Normally, you would need to refer this issue on Google Cloud PubSub side or try to make native works by yourself …
But, your are lucky 😉 I start working on adding support for Google Cloud PubSub some times ago and we might have an extension soon or later on Quarkus. The PR is #9745
Closing this issue as it’s supported by the extension mentioned in https://github.com/quarkusio/quarkus/issues/12047#issuecomment-697627732