samuel tian 7年 前 Hi CRISTINA,I've compiled your code and deployed to the new Liferay 7.0.2 GA3 server for a test running.I'm having no error deploying the portlet which with the EchoWebSocketEndpoint class. However, I cannot get my client connected to the endpoint no matter what sort of addresses I use.Tried for: var logSocket = new WebSocket("ws://localhost:8080/o/w4u-test-1.0-SNAPSHOT(this is the name of my project war)/echo");orvar logSocket = new WebSocket("ws://localhost:8080/w4u-test-1.0-SNAPSHOT(this is the name of my project war)/echo");still getting the 404 error.And I'm getting:21:59:51,260 WARN [http-apr-8080-exec-5][code_jsp:181] {code="404", msg="ProxyServlet: /o/w4u-test-1.0-SNAPSHOT/echo", uri=/o/w4u-test-1.0-SNAPSHOT/echo}from the server console.Any help will be appreciated. 投票するためにはログインが必要です。 次として送信する: キャンセル Cristina Gonzalez samuel tian 7年 前 Hi Samuel, If you want to use this feature in 7.0.2 GA3, you should add this property to your portal-ext.properties file: module.framework.system.packages.extra=\ com.ibm.crypto.provider,\ com.ibm.db2.jcc,\ com.microsoft.sqlserver.jdbc,\ com.mysql.jdbc,\ com.p6spy.engine.spy,\ com.sun.security.auth.module,\ com.sybase.jdbc4.jdbc,\ oracle.jdbc,\ org.postgresql,\ org.apache.naming.java,\ org.hsqldb.jdbc,\ org.mariadb.jdbc,\ sun.misc,\ sun.net.util,\ sun.security.provider,\ javax.websocket;version="1.1.0",\ javax.websocket.server;version="1.1.0"You can found a full example with 7.0.0.GA3 in https://github.com/cgoncas/liferay-websocket-echo Thanks!! 投票するためにはログインが必要です。 次として送信する: キャンセル samuel tian Cristina Gonzalez 7年 前 Thank you very much for your prompt reply, Cristina.By following the example you've posted, we can now get it to work.One thing worth mentioning is that since now the endpoint is defined under OSGi root instead of the context of each portlet. Every time the project deployed to the server, it will not get unregistered and registered again with the portlet context itself. So every time we deploy the project we're getting a "Multiple Endpoints may not be deployed to the same path" exception. I saw there was a judgement in your code already:https://github.com/cgoncas/liferay-portal/blob/WEBSOCKET_LIFERAY_SUPPORT/modules/apps/foundation/websocket/websocket-whiteboard/src/main/java/com/liferay/websocket/whiteboard/internal/WebSocketEndpointTracker.java#L79. But I've no idea why is this not working properly under the tomcat bundle we're using.Except for the exception above, the end point worked well as before. 投票するためにはログインが必要です。 次として送信する: キャンセル Cristina Gonzalez samuel tian 7年 前 Thanks a lot for the feedback, Samuel. We will try to fix this issue as soon as possible. If you want to track it, just watch the issue https://issues.liferay.com/browse/LPS-69232 投票するためにはログインが必要です。 次として送信する: キャンセル Aldo De Vleeschauwer Cristina Gonzalez 7年 前 I checked the issue and it is marked as resolved but we still get the error. The bundle that we installed is "com.liferay.websocket.whiteboard-1.0.1.jar" and this corresponds with the latest version of the code I found on GitHub ? 投票するためにはログインが必要です。 次として送信する: キャンセル Milan Riha samuel tian 7年 前 Hi, I got this error when I forget leading /o/.. in org.osgi.http.websocket.endpoint.path property of endpoint component class. 投票するためにはログインが必要です。 次として送信する: キャンセル Cristina Gonzalez Milan Riha 7年 前 Hi Milan!If you want to use a path diferent to "/o", you should define it in the tomcat configuration, the same as if you want to define a servlet in other path.Thanks! 投票するためにはログインが必要です。 次として送信する: キャンセル Jaydip Lakhatariya Cristina Gonzalez 6年 前 Hi,Is there any way to use web socket in liferay 7 without declaring this property in portal-ext file. Actually I am developing plug and play module where user don't need to rely on adding this property and restart the server. Anything can be done so that I just deploy my module and everything gets set ?Regards,Jaydip 投票するためにはログインが必要です。 次として送信する: キャンセル Cristina Gonzalez Jaydip Lakhatariya 6年 前 Hey, No sorry, we need to export those pakages. Regards,Cristina 投票するためにはログインが必要です。 次として送信する: キャンセル alejandro soto Jaydip Lakhatariya 6年 前 actually you can, but need to compile the liferay source code on your own/side, i did that while testing a module, and have no config there 投票するためにはログインが必要です。 次として送信する: キャンセル alejandro soto alejandro soto 6年 前 i meant the entire liferay portal code, so that will generate a bundle, with tomcat and so on 投票するためにはログインが必要です。 次として送信する: キャンセル
Cristina Gonzalez samuel tian 7年 前 Hi Samuel, If you want to use this feature in 7.0.2 GA3, you should add this property to your portal-ext.properties file: module.framework.system.packages.extra=\ com.ibm.crypto.provider,\ com.ibm.db2.jcc,\ com.microsoft.sqlserver.jdbc,\ com.mysql.jdbc,\ com.p6spy.engine.spy,\ com.sun.security.auth.module,\ com.sybase.jdbc4.jdbc,\ oracle.jdbc,\ org.postgresql,\ org.apache.naming.java,\ org.hsqldb.jdbc,\ org.mariadb.jdbc,\ sun.misc,\ sun.net.util,\ sun.security.provider,\ javax.websocket;version="1.1.0",\ javax.websocket.server;version="1.1.0"You can found a full example with 7.0.0.GA3 in https://github.com/cgoncas/liferay-websocket-echo Thanks!! 投票するためにはログインが必要です。 次として送信する: キャンセル samuel tian Cristina Gonzalez 7年 前 Thank you very much for your prompt reply, Cristina.By following the example you've posted, we can now get it to work.One thing worth mentioning is that since now the endpoint is defined under OSGi root instead of the context of each portlet. Every time the project deployed to the server, it will not get unregistered and registered again with the portlet context itself. So every time we deploy the project we're getting a "Multiple Endpoints may not be deployed to the same path" exception. I saw there was a judgement in your code already:https://github.com/cgoncas/liferay-portal/blob/WEBSOCKET_LIFERAY_SUPPORT/modules/apps/foundation/websocket/websocket-whiteboard/src/main/java/com/liferay/websocket/whiteboard/internal/WebSocketEndpointTracker.java#L79. But I've no idea why is this not working properly under the tomcat bundle we're using.Except for the exception above, the end point worked well as before. 投票するためにはログインが必要です。 次として送信する: キャンセル Cristina Gonzalez samuel tian 7年 前 Thanks a lot for the feedback, Samuel. We will try to fix this issue as soon as possible. If you want to track it, just watch the issue https://issues.liferay.com/browse/LPS-69232 投票するためにはログインが必要です。 次として送信する: キャンセル Aldo De Vleeschauwer Cristina Gonzalez 7年 前 I checked the issue and it is marked as resolved but we still get the error. The bundle that we installed is "com.liferay.websocket.whiteboard-1.0.1.jar" and this corresponds with the latest version of the code I found on GitHub ? 投票するためにはログインが必要です。 次として送信する: キャンセル Milan Riha samuel tian 7年 前 Hi, I got this error when I forget leading /o/.. in org.osgi.http.websocket.endpoint.path property of endpoint component class. 投票するためにはログインが必要です。 次として送信する: キャンセル Cristina Gonzalez Milan Riha 7年 前 Hi Milan!If you want to use a path diferent to "/o", you should define it in the tomcat configuration, the same as if you want to define a servlet in other path.Thanks! 投票するためにはログインが必要です。 次として送信する: キャンセル Jaydip Lakhatariya Cristina Gonzalez 6年 前 Hi,Is there any way to use web socket in liferay 7 without declaring this property in portal-ext file. Actually I am developing plug and play module where user don't need to rely on adding this property and restart the server. Anything can be done so that I just deploy my module and everything gets set ?Regards,Jaydip 投票するためにはログインが必要です。 次として送信する: キャンセル Cristina Gonzalez Jaydip Lakhatariya 6年 前 Hey, No sorry, we need to export those pakages. Regards,Cristina 投票するためにはログインが必要です。 次として送信する: キャンセル alejandro soto Jaydip Lakhatariya 6年 前 actually you can, but need to compile the liferay source code on your own/side, i did that while testing a module, and have no config there 投票するためにはログインが必要です。 次として送信する: キャンセル alejandro soto alejandro soto 6年 前 i meant the entire liferay portal code, so that will generate a bundle, with tomcat and so on 投票するためにはログインが必要です。 次として送信する: キャンセル
samuel tian Cristina Gonzalez 7年 前 Thank you very much for your prompt reply, Cristina.By following the example you've posted, we can now get it to work.One thing worth mentioning is that since now the endpoint is defined under OSGi root instead of the context of each portlet. Every time the project deployed to the server, it will not get unregistered and registered again with the portlet context itself. So every time we deploy the project we're getting a "Multiple Endpoints may not be deployed to the same path" exception. I saw there was a judgement in your code already:https://github.com/cgoncas/liferay-portal/blob/WEBSOCKET_LIFERAY_SUPPORT/modules/apps/foundation/websocket/websocket-whiteboard/src/main/java/com/liferay/websocket/whiteboard/internal/WebSocketEndpointTracker.java#L79. But I've no idea why is this not working properly under the tomcat bundle we're using.Except for the exception above, the end point worked well as before. 投票するためにはログインが必要です。 次として送信する: キャンセル Cristina Gonzalez samuel tian 7年 前 Thanks a lot for the feedback, Samuel. We will try to fix this issue as soon as possible. If you want to track it, just watch the issue https://issues.liferay.com/browse/LPS-69232 投票するためにはログインが必要です。 次として送信する: キャンセル Aldo De Vleeschauwer Cristina Gonzalez 7年 前 I checked the issue and it is marked as resolved but we still get the error. The bundle that we installed is "com.liferay.websocket.whiteboard-1.0.1.jar" and this corresponds with the latest version of the code I found on GitHub ? 投票するためにはログインが必要です。 次として送信する: キャンセル Milan Riha samuel tian 7年 前 Hi, I got this error when I forget leading /o/.. in org.osgi.http.websocket.endpoint.path property of endpoint component class. 投票するためにはログインが必要です。 次として送信する: キャンセル Cristina Gonzalez Milan Riha 7年 前 Hi Milan!If you want to use a path diferent to "/o", you should define it in the tomcat configuration, the same as if you want to define a servlet in other path.Thanks! 投票するためにはログインが必要です。 次として送信する: キャンセル
Cristina Gonzalez samuel tian 7年 前 Thanks a lot for the feedback, Samuel. We will try to fix this issue as soon as possible. If you want to track it, just watch the issue https://issues.liferay.com/browse/LPS-69232 投票するためにはログインが必要です。 次として送信する: キャンセル Aldo De Vleeschauwer Cristina Gonzalez 7年 前 I checked the issue and it is marked as resolved but we still get the error. The bundle that we installed is "com.liferay.websocket.whiteboard-1.0.1.jar" and this corresponds with the latest version of the code I found on GitHub ? 投票するためにはログインが必要です。 次として送信する: キャンセル
Aldo De Vleeschauwer Cristina Gonzalez 7年 前 I checked the issue and it is marked as resolved but we still get the error. The bundle that we installed is "com.liferay.websocket.whiteboard-1.0.1.jar" and this corresponds with the latest version of the code I found on GitHub ? 投票するためにはログインが必要です。 次として送信する: キャンセル
Milan Riha samuel tian 7年 前 Hi, I got this error when I forget leading /o/.. in org.osgi.http.websocket.endpoint.path property of endpoint component class. 投票するためにはログインが必要です。 次として送信する: キャンセル Cristina Gonzalez Milan Riha 7年 前 Hi Milan!If you want to use a path diferent to "/o", you should define it in the tomcat configuration, the same as if you want to define a servlet in other path.Thanks! 投票するためにはログインが必要です。 次として送信する: キャンセル
Cristina Gonzalez Milan Riha 7年 前 Hi Milan!If you want to use a path diferent to "/o", you should define it in the tomcat configuration, the same as if you want to define a servlet in other path.Thanks! 投票するためにはログインが必要です。 次として送信する: キャンセル
Jaydip Lakhatariya Cristina Gonzalez 6年 前 Hi,Is there any way to use web socket in liferay 7 without declaring this property in portal-ext file. Actually I am developing plug and play module where user don't need to rely on adding this property and restart the server. Anything can be done so that I just deploy my module and everything gets set ?Regards,Jaydip 投票するためにはログインが必要です。 次として送信する: キャンセル Cristina Gonzalez Jaydip Lakhatariya 6年 前 Hey, No sorry, we need to export those pakages. Regards,Cristina 投票するためにはログインが必要です。 次として送信する: キャンセル alejandro soto Jaydip Lakhatariya 6年 前 actually you can, but need to compile the liferay source code on your own/side, i did that while testing a module, and have no config there 投票するためにはログインが必要です。 次として送信する: キャンセル alejandro soto alejandro soto 6年 前 i meant the entire liferay portal code, so that will generate a bundle, with tomcat and so on 投票するためにはログインが必要です。 次として送信する: キャンセル
Cristina Gonzalez Jaydip Lakhatariya 6年 前 Hey, No sorry, we need to export those pakages. Regards,Cristina 投票するためにはログインが必要です。 次として送信する: キャンセル
alejandro soto Jaydip Lakhatariya 6年 前 actually you can, but need to compile the liferay source code on your own/side, i did that while testing a module, and have no config there 投票するためにはログインが必要です。 次として送信する: キャンセル alejandro soto alejandro soto 6年 前 i meant the entire liferay portal code, so that will generate a bundle, with tomcat and so on 投票するためにはログインが必要です。 次として送信する: キャンセル
alejandro soto alejandro soto 6年 前 i meant the entire liferay portal code, so that will generate a bundle, with tomcat and so on 投票するためにはログインが必要です。 次として送信する: キャンセル
alejandro soto 7年 前 Does anybody getting this same error when module is started again ?Unble to register WebSocket endpoint class ... for path /../javax.websocket.DeploymentException: Multiple Endpoints may not be deployed to the same path [/../] : existing endpoint was class javax.websocket.Endpoint and new endpoint is class javax.websocket.Endpoint at org.apache.tomcat.websocket.server.WsServerContainer.addEndpoint(WsServerContainer.java:224) at com.liferay.websocket.whiteboard.internal.WebSocketEndpointTracker.addingService(WebSocketEndpointTracker.java:124) at com.liferay.websocket.whiteboard.internal.WebSocketEndpointTracker.addingService(WebSocketEndpointTracker.java:45) at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941) at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:1) at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256) 投票するためにはログインが必要です。 次として送信する: キャンセル
Jaydip Lakhatariya 6年 前 I am too getting the same error as below while deploying into the fresh server. I am using the Liferay whiteboard 1.0.1.javax.websocket.DeploymentException: Multiple Endpoints may not be deployed to the same path [/o/ka/socket] : existing endpoint was class javax.websocket.Endpoint and new endpoint is class javax.websocket.Endpoint/Can anyone have fix for this ?Regards,Jaydip 投票するためにはログインが必要です。 次として送信する: キャンセル
Simon Wiesmann 6年 前 It seems like the issue has resolved in liferay7 GA4. While also getting the "javax.websocket.DeploymentException: Multiple Endpoints" with liferay7 tomcat GA3 I do not get the error with GA4. In both cases the websocket whiteboard v1.0.1 was in use. 投票するためにはログインが必要です。 次として送信する: キャンセル
alejandro soto 6年 前 Have anybody tried running this from a real instance (not local) with domain/apache in-front of tomcat ? Seems not working for me, only on localhost environment 投票するためにはログインが必要です。 次として送信する: キャンセル Milan Riha alejandro soto 6年 前 Hi,is basically working (not tested thoroughly yet)What I does is setup extra Listen port for websocket communicationExample:Listen 88<VirtualHost *:88> ServerName xyz ProxyPass / ws://localhost:8080/</VirtualHost>and load wstunnel module directiveLoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.soTested in CentOS 7 投票するためにはログインが必要です。 次として送信する: キャンセル alejandro soto Milan Riha 6年 前 Hi Milan, that makes sense thanks so much but now getting 'Upgrade' header is missing, response is not returning proper websocket header, but it's using port 80, did you make any difference using 80 compared to port 88 ? 投票するためにはログインが必要です。 次として送信する: キャンセル Milan Riha alejandro soto 6年 前 Hi Alejandro, the point of this configuration was to separate standard http communication to 80 port and websocket communication to 88 on frontend side. Only this worked for me with apache. But now I found better solution with nginx instead of apache as proxy server. All work togheter on single 80 port. Just set different rules for different paths in nginx config. 投票するためにはログインが必要です。 次として送信する: キャンセル
Milan Riha alejandro soto 6年 前 Hi,is basically working (not tested thoroughly yet)What I does is setup extra Listen port for websocket communicationExample:Listen 88<VirtualHost *:88> ServerName xyz ProxyPass / ws://localhost:8080/</VirtualHost>and load wstunnel module directiveLoadModule proxy_wstunnel_module modules/mod_proxy_wstunnel.soTested in CentOS 7 投票するためにはログインが必要です。 次として送信する: キャンセル alejandro soto Milan Riha 6年 前 Hi Milan, that makes sense thanks so much but now getting 'Upgrade' header is missing, response is not returning proper websocket header, but it's using port 80, did you make any difference using 80 compared to port 88 ? 投票するためにはログインが必要です。 次として送信する: キャンセル Milan Riha alejandro soto 6年 前 Hi Alejandro, the point of this configuration was to separate standard http communication to 80 port and websocket communication to 88 on frontend side. Only this worked for me with apache. But now I found better solution with nginx instead of apache as proxy server. All work togheter on single 80 port. Just set different rules for different paths in nginx config. 投票するためにはログインが必要です。 次として送信する: キャンセル
alejandro soto Milan Riha 6年 前 Hi Milan, that makes sense thanks so much but now getting 'Upgrade' header is missing, response is not returning proper websocket header, but it's using port 80, did you make any difference using 80 compared to port 88 ? 投票するためにはログインが必要です。 次として送信する: キャンセル Milan Riha alejandro soto 6年 前 Hi Alejandro, the point of this configuration was to separate standard http communication to 80 port and websocket communication to 88 on frontend side. Only this worked for me with apache. But now I found better solution with nginx instead of apache as proxy server. All work togheter on single 80 port. Just set different rules for different paths in nginx config. 投票するためにはログインが必要です。 次として送信する: キャンセル
Milan Riha alejandro soto 6年 前 Hi Alejandro, the point of this configuration was to separate standard http communication to 80 port and websocket communication to 88 on frontend side. Only this worked for me with apache. But now I found better solution with nginx instead of apache as proxy server. All work togheter on single 80 port. Just set different rules for different paths in nginx config. 投票するためにはログインが必要です。 次として送信する: キャンセル