我正试图使https://www.oracle.com/webfolder/technetwork/tutorials/obe/java/HomeWebsocket/WebsocketHome.html的旧Java 7 EE WebSocket应用程序在Payara Server 5.184 #badassfish(内部版本89)中工作
但是,WebSocket(@ServerEndpoint)无法实例化。
Severe: Exception in thread "glassfish-web-async-thread-1" Severe:
java.lang.NullPointerException at
org.apache.catalina.connector.InputBuffer$ReadHandlerImpl.processAllDataRead(InputBuffer.java:492) at
org.apache.catalina.connector.InputBuffer$ReadHandlerImpl.access$800(InputBuffer.java:385) at
org.apache.catalina.connector.InputBuffer$ReadHandlerImpl$2.run(InputBuffer.java:475) at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) at
java.lang.Thread.run(Thread.java:748)
通过启用CDI开发模式,我会看到:
WARN: WELD-001703: Unable to determine the @Intercepted Bean<?> for
[UnbackedAnnotatedField] @Inject @Intercepted private
org.jboss.weld.probe.InvocationMonitor.interceptedBean WARN:
PROBE-000020: A problem occured during monitoring of bean instance
construction: null java.lang.RuntimeException: at
com.magicpigeon.websocket.DeviceWebSocketServer.<init>(DeviceWebSocketServer.java:1) at
com.magicpigeon.websocket.DeviceWebSocketServer$Proxy$_$$_WeldSubclass.<init>(Unknown Source) at
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
DeviceWebSocketServer
是我的@ServerEndpoint类。
是否有与CDI相关的错误?我会缺少什么?。
代码在这里:https://github.com/DanielMerchan/WebsocketHome(如果有人想尝试一下)。过去,这在我以前使用Glassfish的Netbeans中起作用(不记得版本)。
谢谢。
答案 0 :(得分:0)
如果我保留Java EE 7,则可以使用。 不知道升级到Java EE 8会发生什么。