掲示板

Liferay 7 + Liferay Faces Alloy + Websockets

7年前 に Marcus Hiebenga によって更新されました。

Liferay 7 + Liferay Faces Alloy + Websockets

New Member 投稿: 20 参加年月日: 17/01/11 最新の投稿
Hello,

I am trying to get websockets to work in a Liferay Faces Alloy portlet. Until now without success.
I am using Liferay 7.0-ga3. My gradle.build looks like this:


apply plugin: 'war'
apply plugin: 'java'

repositories {
     maven { url "https://repository.liferay.com/nexus/content/groups/public" }
     maven { url "http://repo.maven.apache.org/maven2" }
}

dependencies {
    compile group: 'com.liferay.faces', name: 'com.liferay.faces.alloy', version:'3.0.0'
    compile group: 'com.liferay.faces', name: 'com.liferay.faces.bridge.ext', version:'5.0.0'
    compile group: 'com.liferay.faces', name: 'com.liferay.faces.bridge.impl', version:'4.0.0'
    compile group: 'org.slf4j', name: 'slf4j-api', version: '1.7.22'
    compile group: 'org.slf4j', name: 'slf4j-log4j12', version: '1.7.22'
    
    compile group: "javax.websocket", name: "javax.websocket-api", version: "1.1"
	compileOnly group: "javax.servlet", name: "servlet-api", version: "2.5"
	compileOnly group: "org.osgi", name: "org.osgi.compendium", version: "5.0.0"
	compileOnly group: "org.osgi", name: "org.osgi.core", version: "5.0.0"
	
    testCompile 'junit:junit:4.12'
        
    runtime group: 'org.glassfish', name: 'javax.faces', version:'2.2.13'
    providedCompile group: 'javax.faces', name: 'javax.faces-api', version:'2.2'
}


I tried to adapt the tutorial from Cristina Gonzalez:
https://web.liferay.com/de/web/cristina.gonzalez/blog/-/blogs/define-websocket-server-endpoints-using-liferay-websocket-whiteboard
But it doesn´t work with liferay faces. It looks like that the websocket server never starts.
I haven't found a hint in the world wide web, how to acomplish websockets with liferay faces.

Please help me.

I have added my complete working gradle portlet.

Best regards
Marcus
thumbnail
7年前 に Juan Gonzalez によって更新されました。

RE: Liferay 7 + Liferay Faces Alloy + Websockets

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Hi Marcus.

In order to separate both problems and discard possible errors, did you try a simple portlet (non JSF) just to check if websocket is working in your 7 GA3 instance?

Seems more changes are need in order to make this working in 7 GA3, check Cristina comment in his blog post: https://web.liferay.com/web/cristina.gonzalez/blog/-/blogs/define-websocket-server-endpoints-using-liferay-websocket-whiteboard.

Additionally, read the needed change in portal-ext.properties here: https://github.com/cgoncas/liferay-websocket-echo

And finally, check with that sample web socket echo example to see if that works. After that, we could check what is failing when using JSF.

Thanks!
7年前 に Marcus Hiebenga によって更新されました。

RE: Liferay 7 + Liferay Faces Alloy + Websockets

New Member 投稿: 20 参加年月日: 17/01/11 最新の投稿
Hi Juan,

thank you for your tips. I got it working.

What had to be done:
1. Copy the file portal-ext.properties into the Liferay server root folder
2. Copy the file com.liferay.websocket.whiteboard-1.0.1.jar into the folder !!Liferay server root folder!!\osgi\modules
3. Deploy the working portlet

Big thanks to Cristina as well.

Regards
Marcus
thumbnail
7年前 に Juan Gonzalez によって更新されました。

RE: Liferay 7 + Liferay Faces Alloy + Websockets

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Good to hear that Marcus.

If you have any problem you know where to find us ;-).
thumbnail
6年前 に Kyle Joseph Stiemann によって更新されました。

Thread Split

Liferay Master 投稿: 760 参加年月日: 13/01/14 最新の投稿
Please do not reply to dead threads.

The new thread can be found at https://web.liferay.com/community/forums/-/message_boards/view_message/99417094.