之前tomcat7没事,换成tomcat8后报错:
java.lang.IllegalArgumentException: javax.websocket.DeploymentException: endpoint 实例注册失败 at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:139) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:928) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1688) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191) at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Unknown Source) Caused by: javax.websocket.DeploymentException: endpoint 实例注册失败 at org.apache.tomcat.websocket.WsSession.<init>(WsSession.java:270) at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:127) ... 7 more Caused by: javax.naming.NameNotFoundException: 名称[cn.xxxx.websocket.PayWebsocketServer/xxCrudDao]未在此上下文中绑定。找不到[cn.xxxx.websocket.PayWebsocketServer]。 at org.apache.naming.NamingContext.lookup(NamingContext.java:824) at org.apache.naming.NamingContext.lookup(NamingContext.java:171) at org.apache.catalina.core.DefaultInstanceManager.lookupFieldResource(DefaultInstanceManager.java:576) at org.apache.catalina.core.DefaultInstanceManager.processAnnotations(DefaultInstanceManager.java:479) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:173) at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:165) at org.apache.tomcat.websocket.WsSession.<init>(WsSession.java:268) ... 8 more
解决方法就是: @Resource private xxCrudDao xxCrudDao; 改成 @Autowired private xxCrudDao xxCrudDao;
我也不知道为什么~~搜来的~~
|