Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Eclipse Jetty 12.0.0 has been released!

Silvio,

Are you overriding both onWebSocketText and onWebSocketPartialText from the Session.Listener?
These cannot be used together for a particular message type (TEXT/BINARY).

cheers,
Lachlan


On Fri, Aug 11, 2023 at 7:15 PM Silvio Bierman via jetty-users <jetty-users@xxxxxxxxxxx> wrote:
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 ...

On Thu, Aug 10, 2023 at 8:16 AM Silvio Bierman <sbierman@xxxxxxxxxxxxxxxxxx> wrote:
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 

_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users

Back to the top