You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the issue
Hello! When I try to run a minimal example of embedded Jetty websocket server, it fails at runtime when a client connects if I compile it using native-image.
This repository contains the minimal server example: https://github.com/jetty-project/embedded-jetty-websocket-examples
it contais two projects.
javax.websocket-example - This one uses javax.websocket apis and works fine on native-image
native-jetty-websocket-example - This one uses org.eclipse.jetty.websocket apis, compiles fine using native-image, but fails at runtime, maybe due to MethodHandler issues?
I wrote my application using org.eclipse.jetty.websocket apis, and I would like to build a working native image.
Here is the log of WebsocketServer native-image after a client connection
2021-11-14 21:38:51.702:INFO :oejs.Server:main: jetty-10.0.7; built: 2021-10-06T19:34:02.766Z; git: da8a4553af9dd84080931fa0f8c678cd2d60f3d9; jvm 17.0.1
2021-11-14 21:38:51.703:INFO :oejss.DefaultSessionIdManager:main: Session workerName=node0
2021-11-14 21:38:51.703:INFO :oejsh.ContextHandler:main: Started o.e.j.s.ServletContextHandler@1c547e5a{/,null,AVAILABLE}
2021-11-14 21:38:51.703:INFO :oejs.AbstractConnector:main: Started ServerConnector@36773a20{HTTP/1.1, (http/1.1)}{0.0.0.0:6001}
2021-11-14 21:38:51.703:INFO :oejs.Server:main: Started Server@37942616{STARTING}[10.0.7,sto=0] @2ms
Use Ctrl+C to stop server
org.eclipse.jetty.websocket.api.exceptions.CloseException: org.eclipse.jetty.websocket.core.exception.WebSocketException: EventSocket OPEN method error: Invalid MethodHandle void([B, int, int) - expected void([B, int, int)
at org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandler.convertCause(JettyWebSocketFrameHandler.java:506)
at org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandler.onError(JettyWebSocketFrameHandler.java:258)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.lambda$closeConnection$2(WebSocketCoreSession.java:280)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1445)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1482)
at org.eclipse.jetty.websocket.core.server.internal.AbstractHandshaker$1.handle(AbstractHandshaker.java:212)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.closeConnection(WebSocketCoreSession.java:280)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.lambda$sendFrame$7(WebSocketCoreSession.java:514)
at org.eclipse.jetty.util.Callback$3.succeeded(Callback.java:137)
at org.eclipse.jetty.websocket.core.internal.TransformingFlusher.notifyCallbackSuccess(TransformingFlusher.java:151)
at org.eclipse.jetty.websocket.core.internal.TransformingFlusher$Flusher.process(TransformingFlusher.java:111)
at org.eclipse.jetty.util.IteratingCallback.processing(IteratingCallback.java:232)
at org.eclipse.jetty.util.IteratingCallback.iterate(IteratingCallback.java:214)
at org.eclipse.jetty.websocket.core.internal.TransformingFlusher.sendFrame(TransformingFlusher.java:75)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.sendFrame(WebSocketCoreSession.java:517)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.close(WebSocketCoreSession.java:236)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.processHandlerError(WebSocketCoreSession.java:367)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.lambda$onOpen$5(WebSocketCoreSession.java:401)
at org.eclipse.jetty.util.Callback$3.failed(Callback.java:143)
at org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandler.onOpen(JettyWebSocketFrameHandler.java:187)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.lambda$onOpen$6(WebSocketCoreSession.java:407)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1463)
at org.eclipse.jetty.server.handler.ContextHandler.handle(ContextHandler.java:1482)
at org.eclipse.jetty.websocket.core.server.internal.AbstractHandshaker$1.handle(AbstractHandshaker.java:212)
at org.eclipse.jetty.websocket.core.internal.WebSocketCoreSession.onOpen(WebSocketCoreSession.java:407)
at org.eclipse.jetty.websocket.core.internal.WebSocketConnection.onOpen(WebSocketConnection.java:545)
at org.eclipse.jetty.io.AbstractEndPoint.upgrade(AbstractEndPoint.java:483)
at org.eclipse.jetty.server.HttpConnection.upgrade(HttpConnection.java:419)
at org.eclipse.jetty.server.HttpConnection.onCompleted(HttpConnection.java:450)
at org.eclipse.jetty.server.HttpChannel.onCompleted(HttpChannel.java:884)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:398)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:282)
at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:319)
at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:100)
at org.eclipse.jetty.io.SocketChannelEndPoint$1.run(SocketChannelEndPoint.java:101)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:894)
at org.eclipse.jetty.util.thread.QueuedThreadPool$Runner.run(QueuedThreadPool.java:1038)
at java.lang.Thread.run(Thread.java:833)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:596)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:192)
Caused by: org.eclipse.jetty.websocket.core.exception.CloseException: org.eclipse.jetty.websocket.core.exception.WebSocketException: EventSocket OPEN method error: Invalid MethodHandle void([B, int, int) - expected void([B, int, int)
... 23 more
Caused by: org.eclipse.jetty.websocket.core.exception.WebSocketException: EventSocket OPEN method error: Invalid MethodHandle void([B, int, int) - expected void([B, int, int)
... 21 more
Caused by: org.eclipse.jetty.websocket.core.exception.InvalidSignatureException: Invalid MethodHandle void([B, int, int) - expected void([B, int, int)
at org.eclipse.jetty.websocket.core.internal.messages.ByteArrayMessageSink.<init>(ByteArrayMessageSink.java:42)
at java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499)
at java.lang.reflect.Constructor.newInstance(Constructor.java:480)
at com.oracle.svm.methodhandles.Util_java_lang_invoke_MethodHandle.invokeInternal(Target_java_lang_invoke_MethodHandle.java:210)
at java.lang.invoke.MethodHandle.invokeBasic(MethodHandle.java:81)
at java.lang.invoke.MethodHandle.invokeBasic(MethodHandle.java:0)
at java.lang.invoke.LambdaForm$MH.0x00000007c1014000.invoke_MT(LambdaForm$MH)
at org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandlerFactory.createMessageSink(JettyWebSocketFrameHandlerFactory.java:212)
at org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandler.onOpen(JettyWebSocketFrameHandler.java:174)
... 20 more
Socket Closed: [1011] org.eclipse.jetty.websocket.core.exception.WebSocketException: EventSocket OPEN method error: Invalid MethodHandle void([B,
Here are my config files and log during native-image build:
I think this issue is related to MethodHandle on GraalVM/Native-Image but I have no idea on how to fix it or if there is a workaround I can use.
Thank you for your help.
The text was updated successfully, but these errors were encountered:
Hi @hogfilho. I have reproduced the error as described. I have reported this issue with the native image team. You will receive a response accordingly.
Describe the issue
Hello! When I try to run a minimal example of embedded Jetty websocket server, it fails at runtime when a client connects if I compile it using native-image.
This repository contains the minimal server example:
https://github.com/jetty-project/embedded-jetty-websocket-examples
it contais two projects.
I wrote my application using org.eclipse.jetty.websocket apis, and I would like to build a working native image.
Steps to reproduce the issue
Describe GraalVM and your environment:
More details
--native-image-info
and--verbose
:native_library_info_20211114_213052.txt
target_info_20211114_213040.txt
jni-config.json.txt
predefined-classes-config.json.txt
proxy-config.json.txt
reflect-config.json.txt
resource-config.json.txt
serialization-config.json.txt
I think this issue is related to MethodHandle on GraalVM/Native-Image but I have no idea on how to fix it or if there is a workaround I can use.
Thank you for your help.
The text was updated successfully, but these errors were encountered: