0

I'm trying to crete a simple Websocket application based on tutorial here: http://docs.oracle.com/javaee/7/tutorial/doc/websocket004.htm

So the code looks something like this:

@ServerEndpoint("/echo")
public class EchoEndpoint {
 @OnMessage
 public void onMessage(Session session, String msg) {
 try {
 session.getBasicRemote().sendText(msg);
 } catch (IOException e) { ... }
 }
}

I'm running Weblogic 12c. I thought the annotation should be automatically picked up and websocket endpoint created on the address localhost:8888/myApp/echo, but when I try to connect there with this js test: http://www.websocket.org/echo.html, nothing happens. Also when I attach debugger, I see that the EchoEndpoint class was not loaded. What else should I do to make it running? I see nothing else in the Oracle tutorial

asked Nov 1, 2013 at 18:03
1
  • I have the same issue with WLS 12.2.1.3 wich supports jsr356, see. Commented Nov 6, 2018 at 15:14

1 Answer 1

1

The Tyrus library requires a JEE7 container, Weblogic only supports JEE6.

Follow this tutorial to get websockets in Weblogic. http://docs.oracle.com/middleware/1212/wls/WLPRG/websockets.htm

answered Nov 27, 2013 at 0:12
Sign up to request clarification or add additional context in comments.

1 Comment

Hi. It works now when I use @WebSocket annotation instead of @ServerEndpoint

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.