当前位置: 动力学知识库 > 问答 > 编程问答 >

websocket - Apache Ofbiz enable web sockets

问题描述:

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

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

网友答案:

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.
分享给朋友:
您可能感兴趣的文章:
随机阅读: