Websocket Extension not working with Lucee 7.x

Looks like the current version of the Websocket Extension ( 3.0.0.17 ) still has some dependencies on javax and I think because it was was made to be compatible with both javax and jakarta libraries, the wrapper isn’t being called.

I’m not seeing anything in /any/ of the logs to show that the extension is loading up, failing or anything else – other than the entries are showing in the .CFConfig file (under the startup hooks and in the extensions node), the .jar files are ending up in the right place, and I see the .lex in the context/extensions/installed directory.

When calling the websocketInfo() function, it does execute, but gives the “WebSocketEndpointFactory failed to initialize within the Lucee engine (startup-hook)” error.

Exact same setup works for Lucee 6.2.4.24-light.

OS: docker, image lucee/lucee:7.0.1.100-light, extension injected via ENV variable
Java Version: Eclipse Adoptium 21.0.9
Tomcat Version: Apache Tomcat/11.0.15
Lucee Version: 7.0.1.100-light

1 Like

I got same problem, is there any solution?

I have a fix in the works

https://luceeserver.atlassian.net/browse/LDEV-6050

in the meantime, the workaround should be to simply to drop these javax jars in your /lib folder

https://repo1.maven.org/maven2/javax/servlet/javax.servlet-api/4.0.1/javax.servlet-api-4.0.1.jar
https://repo1.maven.org/maven2/javax/servlet/jsp/javax.servlet.jsp-api/2.3.3/javax.servlet.jsp-api-2.3.3.jar
https://repo1.maven.org/maven2/javax/el/javax.el-api/3.0.0/javax.el-api-3.0.0.jar
https://repo1.maven.org/maven2/javax/websocket/javax.websocket-api/1.1/javax.websocket-api-1.1.jar

Try the 3.0.0.18-SNAPSHOT

https://download.lucee.org/#3F9DFF32-B555-449D-B0EB5DB723044045

1 Like

@Zackster – looks like 3.0.0.18-SNAPSHOT is doing the same thing.

Dropping the jar files you listed into /opt/lucee/server/lucee-server/context/lib/ and restarting the container didn’t seem to do much either. Same error about the startup hook when I run the websocketinfo() function call.

lucee.runtime.exp.ApplicationException: WebSocketEndpointFactory failed to initialize within the Lucee engine (startup-hook).
 at lucee.runtime.op.ExceptonImpl.createApplicationException(ExceptonImpl.java:93)
 at org.lucee.extension.websocket.WebSocketEndpointFactory.getInstance(WebSocketEndpointFactory.java:193)
 at org.lucee.extension.websocket.udf.WebsocketInfo.invoke(WebsocketInfo.java:42)
 at lucee.runtime.functions.FunctionHandlerPool.invoke(FunctionHandlerPool.java:40)
 at index_cfm$cf.call(/index.cfm:1)
.......

ahhh, try the 7.0.2.6-SNAPSHOT or newer

https://luceeserver.atlassian.net/browse/LDEV-5957

Getting closer. It looks like it’s choking on the websocket extension’s register() function now

Exception in thread "Thread-1" java.lang.NoSuchMethodError: 'javax.servlet.ServletContext lucee.runtime.config.ConfigWeb.getServletContext()'
2025-12-31T21:48:45.328236832Z 	at org.lucee.extension.websocket.WebSocketEndpointFactory.register(WebSocketEndpointFactory.java:85)
2025-12-31T21:48:45.328239089Z 	at org.lucee.extension.websocket.WebSocketEndpointFactory$Registrar.run(WebSocketEndpointFactory.java:265)

Not unexpected with the initial function call failing, when we call the websocketinfo() function, we get this:

31.12.2025 21:51:00,681 ERROR [server.websocket] 
2025-12-31T21:51:00.685645785Z lucee.runtime.exp.NativeException: lucee.runtime.thread.ThreadUtil.createPageContext(lucee.runtime.config.ConfigWeb,java.io.OutputStream,java.lang.String,java.lang.String,java.lang.String,[Ljavax.servlet.http.Cookie;,[Llucee.commons.lang.Pair;,[B,[Llucee.commons.lang.Pair;,lucee.runtime.type.Struct,boolean,long)
2025-12-31T21:51:00.685648086Z 	at java.lang.Class.getMethod(Unknown Source) ~[?:?]
2025-12-31T21:51:00.685649435Z 	at org.lucee.extension.websocket.util.WSUtil.createPageContext(WSUtil.java:356) ~[org.lucee.websocket.extension-3.0.0.18-SNAPSHOT.jar:?]
2025-12-31T21:51:00.685650453Z 	at org.lucee.extension.websocket.util.WSUtil.createPageContext(WSUtil.java:346) ~[org.lucee.websocket.extension-3.0.0.18-SNAPSHOT.jar:?]
2025-12-31T21:51:00.685651407Z 	at org.lucee.extension.websocket.WebSocketEndpointFactory.register(WebSocketEndpointFactory.java:103) ~[org.lucee.websocket.extension-3.0.0.18-SNAPSHOT.jar:?]
2025-12-31T21:51:00.685652320Z 	at org.lucee.extension.websocket.WebSocketEndpointFactory.getInfo(WebSocketEndpointFactory.java:187) ~[org.lucee.websocket.extension-3.0.0.18-SNAPSHOT.jar:?]
2025-12-31T21:51:00.685653246Z 	at org.lucee.extension.websocket.udf.WebsocketInfo.invoke(WebsocketInfo.java:42) ~[org.lucee.websocket.extension-3.0.0.18-SNAPSHOT.jar:?]
2025-12-31T21:51:00.685654178Z 	at lucee.runtime.functions.FunctionHandlerPool.invoke(FunctionHandlerPool.java:40) ~[7.0.2.35-SNAPSHOT.lco:?]
2025-12-31T21:51:00.685655071Z 	at index_cfm$cf.call(/index.cfm:1) ~[?:?]

Same error on the published 3.0.0.17.