Thanks again,
Reading the docs I think I managed to convert my WebSocket related
code to the new API. Instead of WebSocketListener/WebSocketAdapter I
now use Session.Listener and there where some other minor changes.
Everything compiles now.
However, JettyWebSocketServerContainer.upgrade throws an exception
so I must still be doing something wrong.
org.eclipse.jetty.websocket.api.exceptions.InvalidWebSocketException:
Cannot replace previously assigned [TEXT Handler] at
MethodHandle(ObjectSocketAdapter,String,boolean)void with public
void
nl.idfix.scriptlet.scripts.handlers.ScriptHandler$ObjectSocketAdapter.onWebSocketText(java.lang.String)
at
org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandlerMetadata.assertNotSet(JettyWebSocketFrameHandlerMetadata.java:159)
JettyWebSocketFrameHandlerMetadata.java:159
at
org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandlerMetadata.setTextHandle(JettyWebSocketFrameHandlerMetadata.java:131)
JettyWebSocketFrameHandlerMetadata.java:131
at
org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandlerFactory.createListenerMetadata(JettyWebSocketFrameHandlerFactory.java:213)
JettyWebSocketFrameHandlerFactory.java:213
at
org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandlerFactory.createMetadata(JettyWebSocketFrameHandlerFactory.java:129)
JettyWebSocketFrameHandlerFactory.java:129
at
org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandlerFactory.getMetadata(JettyWebSocketFrameHandlerFactory.java:119)
JettyWebSocketFrameHandlerFactory.java:119
at
org.eclipse.jetty.websocket.common.JettyWebSocketFrameHandlerFactory.newJettyFrameHandler(JettyWebSocketFrameHandlerFactory.java:140)
JettyWebSocketFrameHandlerFactory.java:140
at
org.eclipse.jetty.ee10.websocket.server.internal.JettyServerFrameHandlerFactory.newFrameHandler(JettyServerFrameHandlerFactory.java:42)
JettyServerFrameHandlerFactory.java:42
at
org.eclipse.jetty.websocket.core.server.internal.CreatorNegotiator.negotiate(CreatorNegotiator.java:68)
CreatorNegotiator.java:68
at
org.eclipse.jetty.websocket.core.server.internal.AbstractHandshaker.upgradeRequest(AbstractHandshaker.java:71)
AbstractHandshaker.java:71
at
org.eclipse.jetty.websocket.core.server.internal.HandshakerSelector.upgradeRequest(HandshakerSelector.java:47)
HandshakerSelector.java:47
at
org.eclipse.jetty.ee10.websocket.server.JettyWebSocketServerContainer.upgrade(JettyWebSocketServerContainer.java:231)
JettyWebSocketServerContainer.java:231
at
nl.idfix.util.servlet.JettyContainer$Servlet.service(JettyContainer.scala:62)
On 10-08-2023 15:41, Joakim Erdfelt
wrote:
Inline ...
It is a server side error, the client is my browser on
localhost.
Unfortunately this is not on any form of GIT. Only the
(Scala) code is in an SVN repo. I left everything mostly
as it as in the Jetty11 code.
...(snip)...
libraryDependencies += "org.eclipse.jetty.ee10" %
"jetty-ee10-servlet" % "12.0.0"
libraryDependencies += "org.eclipse.jetty.ee10.websocket"
% "jetty-ee10-websocket-jetty-api" % "12.0.0.beta0"
libraryDependencies += "org.eclipse.jetty.ee10.websocket"
% "jetty-ee10-websocket-jetty-server" % "12.0.0"
libraryDependencies += "org.eclipse.jetty.http2" %
"jetty-http2-server" % "12.0.0"
libraryDependencies += "org.eclipse.jetty.http3" %
"jetty-http3-server" % "12.0.0"
(Note the beta0 on the websocket API, there is no released
version available yet).
The Jetty WebSocket API is not ee specific.
It was moved to jetty-core around beta1.
The server layer exists for all ee# levels.
Even core
- Joakim
_______________________________________________