Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tyrus support in GraalVM #1966

Closed
jbescos opened this issue Jun 10, 2020 · 2 comments · Fixed by #2097
Closed

Tyrus support in GraalVM #1966

jbescos opened this issue Jun 10, 2020 · 2 comments · Fixed by #2097
Assignees
Labels
enhancement New feature or request native-image P4 websocket WebSocket in Helidon
Milestone

Comments

@jbescos
Copy link
Member

jbescos commented Jun 10, 2020

Environment Details

  • Helidon Version: 2.0.0-RC1
  • Helidon SE
  • JDK version:GraalVM Version 20.1.0 (Java Version 11.0.7)
  • OS: Ubuntu 18.04.4 LTS
  • Docker version (if applicable):

Problem Description

I talked with @jsupol and he thinks we need to add the native properties in tyrus helidon module to allow reflection.

Exception in thread "main" java.lang.NullPointerException
at org.glassfish.tyrus.core.TyrusEndpointWrapper.(TyrusEndpointWrapper.java:250)
at org.glassfish.tyrus.core.TyrusEndpointWrapper.(TyrusEndpointWrapper.java:152)
at org.glassfish.tyrus.core.TyrusWebSocketEngine.register(TyrusWebSocketEngine.java:639)
at io.helidon.webserver.tyrus.TyrusSupport$Builder.lambda$build$1(TyrusSupport.java:198)
at java.lang.Iterable.forEach(Iterable.java:75)
at io.helidon.webserver.tyrus.TyrusSupport$Builder.build(TyrusSupport.java:195)
at io.helidon.webserver.examples.websocket.Main.createRouting(Main.java:54)
at io.helidon.webserver.examples.websocket.Main.startWebServer(Main.java:59)
at io.helidon.webserver.examples.websocket.Main.main(Main.java:85)

Steps to reproduce

cd helidon/examples/webserver/websocket
mvn package -Pnative-image
./target/helidon-examples-webserver-websocket

@jbescos
Copy link
Member Author

jbescos commented Jun 11, 2020

We can make it work in this way:

cd helidon/examples/webserver/websocket
mkdir -p src/main/resources/META-INF/native-image
$JAVA_HOME/bin/java -agentlib:native-image-agent=config-output-dir=src/main/resources/META-INF/native-image -jar target/helidon-examples-webserver-websocket.jar
mvn package -Pnative-image && ./target/helidon-examples-webserver-websocket

But this means that any user that wants to use tyrus natively, they need to generate that META-INF files too. There should be a better way to set the configuration directly in helidon/webserver/tyrus but I need to find out how.

@tomas-langer tomas-langer added enhancement New feature or request native-image websocket WebSocket in Helidon labels Jun 11, 2020
@tomas-langer
Copy link
Member

This is a known issue, websocket was not yet tested with native image.

@m0mus m0mus added the P4 label Jun 11, 2020
@romain-grecourt romain-grecourt added this to the 2.0.1 milestone Jun 18, 2020
@danielkec danielkec self-assigned this Jun 24, 2020
@m0mus m0mus modified the milestones: 2.0.1, 2.0.2 Jun 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request native-image P4 websocket WebSocket in Helidon
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants