Hi all,
I've been trying to utilize the websocket in current trunk of ofbiz. Make new component in hot-deploy, using the exact chat example from tomcat and include the Java class. It can be compiled and ant start run without any problem, but my browser console keeps telling me that ws connection cannot be made. I have read the discussion from Jacopo in Tomcat mailing list too, tried to add the listener in web.xml and still my browser cannot make ws connection to my ofbiz instance. Have you guys any experience on this issue? Thanks in advance! Johnson Chandra |
On Apr 17, 2014, at 12:48 PM, MelonJaya <[hidden email]> wrote: > Hi all, > > I've been trying to utilize the websocket in current trunk of ofbiz. > Make new component in hot-deploy, using the exact chat example from tomcat > and include the Java class. It can be compiled and ant start run without > any problem, but my browser console keeps telling me that ws connection > cannot be made. > > I have read the discussion from Jacopo in Tomcat mailing list too, tried to > add the listener in web.xml and still my browser cannot make ws connection > to my ofbiz instance. Hi Johnson, I have indeed worked at implementing a prototype as a proof of concept for the integration of WebSockets in OFBiz. Unfortunately I was not able to complete my work and I am not sure when I will be able to continue it. I had a partial success playing with the JarScanner.setScanClassPath(true) flag; however, when used in OFBiz, you get several errors due to the presence of several jars in the classpath. I would too be curious to know if other did some experiments and had some success. Jacopo > > Have you guys any experience on this issue? > > Thanks in advance! > Johnson Chandra |
well, first of all, I notice that the ContextFilter filtered out the
request, so I put /websocket in allowedPaths. It works, but still the ws request is somehow cannot "arrived". My suspects are: 1. all request goes through ControlEventListener and LoginEventListener. Maybe it is the blocking part? (I will do some experiment with that) 2. I assume, all request are parsed according to webapp definition in ofbiz-component.xml, so that the request will be forwarded to the respective component. Could it be that this is why ws request connection got no response? since it must be somewhere a class that utilize catalina and handles request. Maybe someone knows better what and how the catalina/tomcat is being used in ofbiz framework? This issue could be the starting point for ofbiz-5522. Will keep you guys updated if any progress from my side. best regards, Johnson Chandra On Thu, Apr 17, 2014 at 6:29 PM, Jacopo Cappellato < [hidden email]> wrote: > > On Apr 17, 2014, at 12:48 PM, MelonJaya <[hidden email]> wrote: > > > Hi all, > > > > I've been trying to utilize the websocket in current trunk of ofbiz. > > Make new component in hot-deploy, using the exact chat example from > tomcat > > and include the Java class. It can be compiled and ant start run without > > any problem, but my browser console keeps telling me that ws connection > > cannot be made. > > > > I have read the discussion from Jacopo in Tomcat mailing list too, tried > to > > add the listener in web.xml and still my browser cannot make ws > connection > > to my ofbiz instance. > > Hi Johnson, > > I have indeed worked at implementing a prototype as a proof of concept for > the integration of WebSockets in OFBiz. > Unfortunately I was not able to complete my work and I am not sure when I > will be able to continue it. I had a partial success playing with the > JarScanner.setScanClassPath(true) flag; however, when used in OFBiz, you > get several errors due to the presence of several jars in the classpath. I > would too be curious to know if other did some experiments and had some > success. > > Jacopo > > > > > Have you guys any experience on this issue? > > > > Thanks in advance! > > Johnson Chandra > > |
In reply to this post by Jaya Melon
Hi
yes, i hav successfully use websockets to send information to connected when some event occures server side. in details, i used asterisk-java, to interact wieth an servisk server, and used websockets to communicate with client browser, to whox coming calls for examples. i used the old apache websocket api, which is deprecated. the new one still difficle to make working within ofbiz, i faced sale issues as jaccoppo. hope this help. Le 17/04/2014 12:48, MelonJaya a écrit : > Hi all, > > I've been trying to utilize the websocket in current trunk of ofbiz. > Make new component in hot-deploy, using the exact chat example from tomcat > and include the Java class. It can be compiled and ant start run without > any problem, but my browser console keeps telling me that ws connection > cannot be made. > > I have read the discussion from Jacopo in Tomcat mailing list too, tried to > add the listener in web.xml and still my browser cannot make ws connection > to my ofbiz instance. > > Have you guys any experience on this issue? > > Thanks in advance! > Johnson Chandra > |
HI Youssef,
I tried the old deprecated API but still cannot make websocket connection between browser and server(ofbiz embedded tomcat). Can you explain more how you do it? another alternative would be deploy ofbiz to (outside)Tomcat, but I am stuck too. On Sun, Apr 20, 2014 at 6:37 PM, Youssef Khaye <[hidden email]>wrote: > Hi > > yes, i hav successfully use websockets to send information to connected > when some event occures server side. > > in details, i used asterisk-java, to interact wieth an servisk server, and > used websockets to communicate with client browser, to whox coming calls > for examples. > > i used the old apache websocket api, which is deprecated. the new one > still difficle to make working within ofbiz, i faced sale issues as > jaccoppo. > > hope this help. > > > > Le 17/04/2014 12:48, MelonJaya a écrit : > > Hi all, >> >> I've been trying to utilize the websocket in current trunk of ofbiz. >> Make new component in hot-deploy, using the exact chat example from tomcat >> and include the Java class. It can be compiled and ant start run without >> any problem, but my browser console keeps telling me that ws connection >> cannot be made. >> >> I have read the discussion from Jacopo in Tomcat mailing list too, tried >> to >> add the listener in web.xml and still my browser cannot make ws connection >> to my ofbiz instance. >> >> Have you guys any experience on this issue? >> >> Thanks in advance! >> Johnson Chandra >> >> > |
hello;
you need to add following jars to your classpath: tomcat7-websocket.jar websocket-api.jar web.xml <web-app xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" version="3.0" metadata-complete="true"> <servlet> <servlet-name>AsteriskSocket</servlet-name> <servlet-class>org.ofbiz.service.asterisk.websocket.AsteriskSocket</servlet-class> </servlet> <servlet-mapping> <servlet-name>AsteriskSocket</servlet-name> <url-pattern>/ws</url-pattern> </servlet-mapping> </web-app> you need to copy the .class AsteriskSocket into your webapp dir, i used ant jar target to make it. + <property name="ws.src" value="build/classes/org/ofbiz/service/asterisk"/> + <property name="ws.dest" value="webapp/asterisk/WEB-INF/classes/org/ofbiz/service/asterisk"/> <target name="main-jar" depends="stubs"> <main-jar/> <test-jar/> + <mkdir dir="${ws.dest}"/> + <copy todir="${ws.dest}" flatten="true"> + <fileset dir="${ws.src}" includes="**"/> + </copy> </target> look at attachement for the websocket server side implementation hope this will help you. Le 24/04/2014 13:40, MelonJaya a écrit : > HI Youssef, > > I tried the old deprecated API but still cannot make websocket connection > between browser and server(ofbiz embedded tomcat). > Can you explain more how you do it? > > another alternative would be deploy ofbiz to (outside)Tomcat, but I am > stuck too. > > > > On Sun, Apr 20, 2014 at 6:37 PM, Youssef Khaye <[hidden email]>wrote: > >> Hi >> >> yes, i hav successfully use websockets to send information to connected >> when some event occures server side. >> >> in details, i used asterisk-java, to interact wieth an servisk server, and >> used websockets to communicate with client browser, to whox coming calls >> for examples. >> >> i used the old apache websocket api, which is deprecated. the new one >> still difficle to make working within ofbiz, i faced sale issues as >> jaccoppo. >> >> hope this help. >> >> >> >> Le 17/04/2014 12:48, MelonJaya a écrit : >> >> Hi all, >>> I've been trying to utilize the websocket in current trunk of ofbiz. >>> Make new component in hot-deploy, using the exact chat example from tomcat >>> and include the Java class. It can be compiled and ant start run without >>> any problem, but my browser console keeps telling me that ws connection >>> cannot be made. >>> >>> I have read the discussion from Jacopo in Tomcat mailing list too, tried >>> to >>> add the listener in web.xml and still my browser cannot make ws connection >>> to my ofbiz instance. >>> >>> Have you guys any experience on this issue? >>> >>> Thanks in advance! >>> Johnson Chandra >>> >>> AsteriskSocket.java (3K) Download Attachment |
Free forum by Nabble | Edit this page |