0

is there any way to enable web sockets in Apache Ofbiz ?

I am trying to connect and get data from MQTT over web sockets.

Suneet Jain
  • 216
  • 1
  • 3
  • 17

1 Answers1

-1

Below is the solution that worked for me and enhancements are currently in progress over JIRA.

https://issues.apache.org/jira/browse/OFBIZ-7073

Websockets implementation need jar scanning enabled and it is currently disabled in OFBiz. Below is the code snippet of disabling jar scan from CatalinaContainer.java:

JarScanner jarScanner = context.getJarScanner();
if (jarScanner instanceof StandardJarScanner) {
StandardJarScanner standardJarScanner = (StandardJarScanner) jarScanner;
standardJarScanner.setScanClassPath(false);
}

Put the "tomcat-embed-websocket.jar" into Catalina Lib folder and

For enabling jar scanning, we need below code:

standardJarScanner.setScanClassPath(true); // Will increase server startup time.
Suneet Jain
  • 216
  • 1
  • 3
  • 17
  • Link only answers are not great, they can become useless if the page they link to disappears, please try and include the substance of the link in the answer – hardillb Jun 08 '16 at 13:53