Re: [jetty-users] Migrating 9 to 10: what replaces WebSocketServlet and JSON.parse() ?

2021-09-04 Thread Alexander Farber
Apologies for having asked such simple question, I have only some experience with embedded Java... I have added the org.eclipse.jetty jetty-slf4j-impl ${jetty.version} to the pom.xml and now my WAR servlet finally works well with Jetty

Re: [jetty-users] Migrating 9 to 10: what replaces WebSocketServlet and JSON.parse() ?

2021-09-03 Thread Joakim Erdfelt
> SLF4J: No SLF4J providers were found. > SLF4J: Defaulting to no-operation (NOP) logger implementation > SLF4J: See http://www.slf4j.org/codes.html#noProviders for further details. You don't have a provider in your classpath. Add one. You have many to choose from. Jetty's own jetty-slf4j-impl,

Re: [jetty-users] Migrating 9 to 10: what replaces WebSocketServlet and JSON.parse() ?

2021-09-03 Thread Alexander Farber
Thank you, Joakim, now my servlet runs, but - On Fri, Sep 3, 2021 at 6:32 PM Joakim Erdfelt wrote: > You are using a JettyWebSocketCreator. > > Get rid of factory.register(WordsListener.class); > Jetty 10 prints: SLF4J: No SLF4J providers were found. SLF4J: Defaulting to no-operation (NOP)

Re: [jetty-users] Migrating 9 to 10: what replaces WebSocketServlet and JSON.parse() ?

2021-09-03 Thread Joakim Erdfelt
You are using a JettyWebSocketCreator. Get rid of factory.register(WordsListener.class); Joakim Erdfelt / joa...@webtide.com On Fri, Sep 3, 2021 at 11:09 AM Alexander Farber wrote: > Hi, thank you for the helpful hints, now my WAR compiles. > > However when I launch it by: > > 1) First

Re: [jetty-users] Migrating 9 to 10: what replaces WebSocketServlet and JSON.parse() ?

2021-09-03 Thread Alexander Farber
Hi, thank you for the helpful hints, now my WAR compiles. However when I launch it by: 1) First running once on Win 10 / Java 11: java -jar jetty-home-10.0.6\start.jar jetty.home=jetty-home-10.0.6 jetty.base=jetty.base --add-module=http,servlet,webapp,deploy,resources,websocket 2) Then running

Re: [jetty-users] Migrating 9 to 10: what replaces WebSocketServlet and JSON.parse() ?

2021-09-01 Thread Lachlan Roberts
Alexander, You should only need to change your line with `JSON.toString(root)` to `new JSON().toJSON(root)`. As for the deprecated header() method, it says in the javadoc to use the `headers(Consumer)` method instead. So would look something like this: HttpClient httpClient = new HttpClient();

Re: [jetty-users] Migrating 9 to 10: what replaces WebSocketServlet and JSON.parse() ?

2021-09-01 Thread Alexander Farber
Hi Joakim and all - On Tue, Aug 31, 2021 at 6:19 PM Joakim Erdfelt wrote: > With that said, you appear to be using the Jetty implementation/apis. > So, switch to `org.eclipse.jetty.websocket.server.JettyWebSocketServlet` > instead. > > JSON json = new JSON(); > // configure json here > Map

Re: [jetty-users] Migrating 9 to 10: what replaces WebSocketServlet and JSON.parse() ?

2021-08-31 Thread Joakim Erdfelt
Jetty 10 still has the concept of a WebSocketServlet. But it's no longer generic and functions for all implementations/apis. With that said, you appear to be using the Jetty implementation/apis. So, switch to `org.eclipse.jetty.websocket.server.JettyWebSocketServlet` instead. Found in