Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NullPointerException when client connects #12

Open
CanisLupusLupus opened this issue Jul 5, 2024 · 0 comments
Open

NullPointerException when client connects #12

CanisLupusLupus opened this issue Jul 5, 2024 · 0 comments

Comments

@CanisLupusLupus
Copy link

I've been trying to use websocket extension by following https://github.com/lucee/lucee-docs/blob/master/docs/recipes/websocket-extension.md but always get NullPointerException when client connects to websocket:

onError got involved for component [events] with session id [0]

java.lang.NullPointerException

        at org.lucee.extension.websocket.WebSocketEndpointFactory.register(WebSocketEndpointFactory.java:96)

        at org.lucee.extension.websocket.WebSocketEndpointFactory.setSessions(WebSocketEndpointFactory.java:292)

        at org.lucee.extension.websocket.BaseWebSocketEndpoint.onOpen(BaseWebSocketEndpoint.java:103)

        at org.lucee.extension.websocket.JavaxWebSocketEndpoint.onOpen(JavaxWebSocketEndpoint.java:32)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

        at java.base/java.lang.reflect.Method.invoke(Method.java:566)

        at org.apache.tomcat.websocket.pojo.PojoEndpointBase.doOnOpen(PojoEndpointBase.java:67)

        at org.apache.tomcat.websocket.pojo.PojoEndpointServer.onOpen(PojoEndpointServer.java:46)

        at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.init(WsHttpUpgradeHandler.java:131)

        at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:978)

        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791)

        at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:52)

        at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1190)

        at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)

        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:63)

        at java.base/java.lang.Thread.run(Thread.java:829)

I'm using websocket 1.0.0.11-RC (I've also tried 1.0.0.4-BETA) and lucee docker, I've tried multiple versions: 6.0.3.1, 6.1.0.235-RC and 6.2.0.1-SNAPSHOT. Lucee is running in single mode on Tomcat.
I'm sure I'm doing something wrong because the only way to make it work is by replacing line 100 in source/java/src/org/lucee/extension/websocket/util/WSUtil.java with return cw;.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant