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 bug
Using a custom encoder in the native mode fails with a failure on reflective instantiation.
A user needs to use @RegisterForReflection to make it work.
Expected behavior
I'd expect all encoders and decoders to be registered for reflection automatically
Environment (please complete the following information):
Output of uname -a or ver:
Linux t580 5.0.17-200.fc29.x86_64 #1 SMP Mon May 20 15:39:10 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Output of java -version:
java version "1.8.0_201"
Java(TM) SE Runtime Environment (build 1.8.0_201-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.201-b09, mixed mode)
GraalVM version (if different from Java):
RC15
Quarkus version or git rev: 0.16.0
Additional context
The stack trace:
UT026001: Unable to instantiate endpoint: java.lang.RuntimeException: java.lang.InstantiationException: Type `com.example.JsonEncoder` can not be instantiated reflectively as it does not have a no-parameter constructor or the no-parameter constructor has not been added explicitly to the native image.
at io.quarkus.arc.runtime.ArcDeploymentTemplate$DefaultInstanceFactory.create(ArcDeploymentTemplate.java:152)
at io.quarkus.undertow.runtime.UndertowDeploymentTemplate$6$1.createInstance(UndertowDeploymentTemplate.java:414)
at io.undertow.websockets.jsr.EncodingFactory.createEncoding(EncodingFactory.java:126)
at io.undertow.websockets.jsr.EndpointSessionHandler.onConnect(EndpointSessionHandler.java:121)
at io.undertow.websockets.jsr.JsrWebSocketFilter$1.handleUpgrade(JsrWebSocketFilter.java:165)
at io.undertow.server.protocol.http.HttpReadListener.exchangeComplete(HttpReadListener.java:385)
at io.undertow.server.protocol.http.HttpServerConnection.exchangeComplete(HttpServerConnection.java:232)
at io.undertow.server.HttpServerExchange.invokeExchangeCompleteListeners(HttpServerExchange.java:1279)
at io.undertow.server.HttpServerExchange.terminateResponse(HttpServerExchange.java:1563)
at io.undertow.server.Connectors.terminateResponse(Connectors.java:147)
at io.undertow.server.protocol.http.HttpTransferEncoding$3.handleEvent(HttpTransferEncoding.java:197)
at io.undertow.server.protocol.http.HttpTransferEncoding$3.handleEvent(HttpTransferEncoding.java:195)
at io.undertow.conduits.HeadStreamSinkConduit.exitFlush(HeadStreamSinkConduit.java:192)
at io.undertow.conduits.HeadStreamSinkConduit.flush(HeadStreamSinkConduit.java:133)
at org.xnio.conduits.ConduitStreamSinkChannel.flush(ConduitStreamSinkChannel.java:162)
at io.undertow.channels.DetachableStreamSinkChannel.flush(DetachableStreamSinkChannel.java:119)
at org.xnio.channels.Channels.flushBlocking(Channels.java:63)
at io.undertow.servlet.spec.ServletOutputStreamImpl.close(ServletOutputStreamImpl.java:618)
at io.undertow.servlet.spec.HttpServletResponseImpl.closeStreamAndWriter(HttpServletResponseImpl.java:486)
at io.undertow.servlet.spec.HttpServletResponseImpl.responseDone(HttpServletResponseImpl.java:575)
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:351)
at io.undertow.servlet.handlers.ServletInitialHandler.access$100(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:138)
at io.undertow.servlet.handlers.ServletInitialHandler$2.call(ServletInitialHandler.java:135)
at io.undertow.servlet.core.ServletRequestContextThreadSetupAction$1.call(ServletRequestContextThreadSetupAction.java:48)
at io.undertow.servlet.core.ContextClassLoaderSetupAction$1.call(ContextClassLoaderSetupAction.java:43)
at io.quarkus.undertow.runtime.UndertowDeploymentTemplate$7$1$1.call(UndertowDeploymentTemplate.java:469)
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:272)
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:81)
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:104)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:364)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:830)
at org.jboss.threads.ContextClassLoaderSavingRunnable.run(ContextClassLoaderSavingRunnable.java:35)
at org.jboss.threads.EnhancedQueueExecutor.safeRun(EnhancedQueueExecutor.java:2011)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.doRunTask(EnhancedQueueExecutor.java:1538)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1395)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:29)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:32)
at java.lang.Thread.run(Thread.java:748)
at org.jboss.threads.JBossThread.run(JBossThread.java:479)
at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:473)
at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
Caused by: java.lang.InstantiationException: Type `com.example.JsonEncoder` can not be instantiated reflectively as it does not have a no-parameter constructor or the no-parameter constructor has not been added explicitly to the native image.
at java.lang.Class.newInstance(DynamicHub.java:740)
at io.quarkus.arc.runtime.ArcDeploymentTemplate$DefaultInstanceFactory.create(ArcDeploymentTemplate.java:144)
... 41 more
The text was updated successfully, but these errors were encountered:
Describe the bug
Using a custom encoder in the native mode fails with a failure on reflective instantiation.
A user needs to use
@RegisterForReflection
to make it work.Expected behavior
I'd expect all encoders and decoders to be registered for reflection automatically
Actual behavior
Application fails to instantiate a custom encoder for a web socket server.
To Reproduce
Steps to reproduce the behavior:
git clone https://github.com/michalszynkiewicz/failing-email-service
mvn clean package -Pnative
http://localhost:8080
Environment (please complete the following information):
uname -a
orver
:java -version
:RC15
Additional context
The stack trace:
The text was updated successfully, but these errors were encountered: