tomcat 8.5,jdk1.7,用官网默认配置,404。请问下,这个问题?
报错信息:
WebSocket connection to 'ws://localhost:8080/view' failed: Error during WebSocket handshake: Unexpected response code: 404
代码:
@ServerEndpoint(value = "/view", configurator= NutWsConfigurator.class)
@IocBean
public class ViewSocket extends AbstractWsEndpoint {
public static ConcurrentHashMap<String, ViewSocket> viewSocketMap = new ConcurrentHashMap<>(1000);
@Inject
Dao dao;
@Override
public void onOpen(Session session, EndpointConfig config) {
super.onOpen(session, config);
viewSocketMap.put(session.getId(), this);
}
@Override
public void onClose(Session session, CloseReason closeReason) {
super.onClose(session, closeReason);
viewSocketMap.remove(session.getId());
}
@Override
public void onError(Session session, Throwable throwable) {
super.onError(session, throwable);
viewSocketMap.remove(session.getId());
}
public WsHandler createHandler(Session session, EndpointConfig config) {
ViewWsHandler handler = new ViewWsHandler(roomPrefix);
handler.setRoomProvider(roomProvider);
handler.setSession(session);
return handler;
}
2019-11-15 16:29:36,537 [INFO][org.nutz.ioc.loader.annotation.AnnotationIocLoader] - Found 244 classes in 1 base-packages!
这个里面,没有注入ViewSocket