Lucee 5.2.4.37 Error (expression)
Message
No matching function [WEBSOCKETSERVER] found
Stacktrace
The Error Occurred in
C:\inetpub\wwwroot\wstest\Application.cfc: line 9
7:
8: Application.objects.connMgrBroadcast =
9: Websocketserver("/ws/broadcast", new BroadcastListener());
10: }
11: }
This is very strange because the error that you are citing seems to come from Lucee and has nothing to do with IIS.
Please tell us more about your setup. I understand that you installed the latest version of the Lucee WebSocket Extension?
The only logical explanation I can think of is that you have two separate instances of Lucee, and the one that IIS is hooked into does not have the extension installed.
If you are calling Tomcat directly then you have to do it on its listening port, e.g. 8080. There is no need to stop IIS for that.
Yes, I figured that as well, just can’t find the reason.
I just checked, and I do have 2 websites, one on port 80 is hooked up to IIS, and the default one from tomcat on port 8888.
I did only have the extension on the Tomcat webapp, but I just installed it on the IIS app, and the error is the same?
For some reason I can’t call into tomcat:8888 when IIS runs, but since the box is just for test that’s okay
Would it make sense to delete the tomcat root app ?
BTW: I installed version 2.0.3 in both webapps, and followed the instructions for the servlet-filter-utils-1.1.1.jar and updating the web.xml with the filter
The way it works is that IIS is simply a proxy to Tomcat, so you only install the extension on Tomcat – never on IIS. The IIS connector needs to know how to handle the WebSocket connection but that’s a different story.
IIS listens by default on port 80. Tomcat by default listens on 8080 or on some Lucee set ups on 8888. If you have Tomcat listening on port 80 then you’d have a problem because it will “fight” with IIS on the port, and the first one that takes the port “wins” while the other will fail to start, so there’s defeinitely something weird with your setup.
It makes sense to delete anything you don’t need and don’t use, but as always – be careful to only delete stuff that you don’t need. It’s always a good idea to make a backup before you delete anything in case you do delete something that you need by accident.
Tomcat listens on port 8888, and I can use it and access the websocket test just fine, as long as IIS is not running, and I understand that all Lucee apps runs on Tomcat, which it’s also why I cant figure out whats wrong since the Websocketserver function is not found?
Let me try and delete the Tomcat webapp
When you add the filter in web.xml for the port 80 app in C:\inetpub\wwwroot, I should make a web.xml file in c:\inetpub\wwwroot\WEB-INF\ aas I read the tomcat docs?
Yes, I see your point, I have just only used tomcat
When I tried to add the filter settings for websockets in the {Tomcat}/conf/web.xml, Tomcat was not working properly, so I just added the filter options in an empty web-inf,/web.xml
Trying a reinstall of Lucee / Tomcat, will get back
If you get an error that WebsocketServer is not a known function then the extension is not installed properly.
Also keep in mind that the name of the function WebsocketServer applies to the most recent version of the extension only. Before that it was WebsocketRegister which is deprecated now. The reason for the name change is that I hope to add WebsocketClient at some point.
That’s a bug in the sort order (care to open a ticket for it in JIRA?). 2.0.3 is the most recent version and is the one that you should use as it fixes some issues in prior versions.
this works fine now, it is needed to get FF and Chrome to work
I am fairly sure the issue with v. 2.0.3 is this part of the configuration
Save the jar file servlet-filter-utils-1.1.1.jar to the classpath, e.g. if you’re using Tomcat it can go into {tomcat}/lib, or if you’re using Jetty then it can go into {jetty}/lib/ext
Add the following snippet to your web deployment descriptor (web.xml), be sure to modify the url-pattern to match your URLs that will used with WebSockets:
<!-- Required for the Lucee WebSocket Extension !-->
<filter>
<filter-name>HttpSessionInitializerFilter</filter-name>
<filter-class>net.twentyonesolutions.servlet.filter.HttpSessionInitializerFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>HttpSessionInitializerFilter</filter-name>
<!-- modify url-pattern to match your websocket endpoints !-->
<url-pattern>/ws/*</url-pattern>
</filter-mapping>
Where should servlet-filter-utils-1.1.1.jar be copied to, I realize the java classpath, so my guess is c:\lucee\tomcat\lib\ with a default Lucee setup
And where should the snippet to your web deployment descriptor (web.xml), be located?
can you make an empty web.xml here? c:\inetpub\wwwroot\WEB-INF\
I haven’t tested anymore for now, will post as soon as I am there, right now v. 1.1.0.3 works
Re this:
Save the jar file servlet-filter-utils-1.1.1.jar to the classpath
I am not using it now, stuck on. v. 1.1.0.3, I was just unsure where it should go? c:\lucee\tomcat\lib\ ?
Re web.xml I know it have to be proper xml with the footer etc, but will Tomcat just append / owerwrite any settings in the file top the default one? And is that the proper location to place it?
Settings in /WEB-INF/web.xml override Tomcat/conf/web.xml so yes, that’s a proper place to put it if you want to keep your configurations with the application code instead of having them in the Tomcat conf directory.