-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Closed
Copy link
Labels
Milestone
Description
Describe the bug
When declaring a websocket next endpoint with @SessionScoped
and the undertow extension is present quarkus fails with
jakarta.enterprise.context.ContextNotActiveException: SessionScoped context was not active when trying to obtain a bean instance for a client proxy of CLASS bean [class=foo.WebsocketController, id=lNM_wkJwmYkOEPs73Mdy8AVQkns]
- @SessionScoped is not supported by default. However, a Quarkus extension implementing session context can be used to enable this functionality (such as Undertow extension).
at io.quarkus.arc.impl.ClientProxies.notActive(ClientProxies.java:76)
at io.quarkus.arc.impl.ClientProxies.getSingleContextDelegate(ClientProxies.java:32)
at foo.WebsocketController_ClientProxy.arc$delegate(Unknown Source)
at foo.WebsocketController_ClientProxy.open(Unknown Source)
at foo.WebsocketController_WebSocketServerEndpoint.doOnOpen(Unknown Source)
at io.quarkus.websockets.next.runtime.WebSocketEndpointBase$4.call(WebSocketEndpointBase.java:167)
at io.quarkus.websockets.next.runtime.WebSocketEndpointBase$4.call(WebSocketEndpointBase.java:161)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$4(ContextImpl.java:192)
at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:270)
at io.vertx.core.impl.ContextImpl$1.execute(ContextImpl.java:221)
at io.vertx.core.impl.WorkerTask.run(WorkerTask.java:56)
at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
at org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
at org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
at org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:1583)
Expected behavior
Adding the Undertow extension should not make the websocket fail if it is @SessionScoped
Actual behavior
No response
How to Reproduce?
Simply having the undertow
extension and websockets-next
and the following is enough
@SessionScoped
@WebSocket(path = "/ws")
public class WebsocketController {
@OnOpen
void open(){
Log.info("Connected");
}
}
Reproducer
- Clone the reproducer https://github.com/Malandril/quarkus-bug-websocket-undertow
- run
quarkus dev
- try to connect using websockets to ws://localhost:8080/ws
Output of uname -a
or ver
linux
Output of java -version
21
Quarkus version or git rev
3.19.1
Build tool (ie. output of mvnw --version
or gradlew --version
)
gradle
Additional information
This happens since quarkus 3.18