Can I use PrimePush a WebSocket in Axon.ivy 6.x?
Hi ivyTeam
I need to have a WebSocket in an ivyProject. I thought about using Primefaces Push Endpoints for this. I know about [this solution for ivy 4.x and 5.x][1] but this doesn't seem to work anymore. I get the following errors and no endpoints are available:
13:56:58.687 WARN [org.atmosphere.cpr.AsynchronousProcessor] [http-nio-8081-exec-3] [requestId=3]
Websocket protocol not supported
13:57:09.974 WARN [org.apache.catalina.loader.WebappClassLoaderBase] [localhost-startStop-2] []
The web application [ivy] appears to have started a thread named [Atmosphere-Scheduler-4] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:1134)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:809)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
13:57:09.975 WARN [org.apache.catalina.loader.WebappClassLoaderBase] [localhost-startStop-2] []
The web application [ivy] appears to have started a thread named [Atmosphere-Scheduler-5] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:1129)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:809)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
13:57:46.830 WARN [] [main] [executionContext=SYSTEM]
the logger can't be the child of org.eclipse.birt
13:59:28.618 WARN [org.atmosphere.cpr.DefaultAsyncSupportResolver] [http-nio-8081-exec-2] [requestId=1]
Found multiple containers, please specify which one to use: org.atmosphere.container.Tomcat7CometSupport, org.atmosphere.container.TomcatCometSupport, until you do, Atmosphere will use:class org.atmosphere.container.Tomcat7CometSupport
13:59:28.638 ERROR [org.primefaces.push.PushServlet] [http-nio-8081-exec-2] [requestId=1]
No Annotated class using @PushEndpoint found. Push will not work.
13:59:28.664 WARN [org.atmosphere.cpr.AsynchronousProcessor] [http-nio-8081-exec-2] [requestId=1]
Websocket protocol not supported
14:02:04.718 WARN [org.apache.catalina.loader.WebappClassLoaderBase] [localhost-startStop-2] []
The web application [ivy] appears to have started a thread named [Atmosphere-Scheduler-0] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:1134)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:809)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
14:02:04.720 WARN [org.apache.catalina.loader.WebappClassLoaderBase] [localhost-startStop-2] []
The web application [ivy] appears to have started a thread named [Atmosphere-Scheduler-6] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:1129)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:809)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
14:03:26.818 WARN [] [main] [executionContext=SYSTEM]
the logger can't be the child of org.eclipse.birt
14:04:38.170 WARN [org.atmosphere.cpr.DefaultAsyncSupportResolver] [http-nio-8081-exec-2] [requestId=2]
Found multiple containers, please specify which one to use: org.atmosphere.container.Tomcat7CometSupport, org.atmosphere.container.TomcatCometSupport, until you do, Atmosphere will use:class org.atmosphere.container.Tomcat7CometSupport
14:04:38.189 ERROR [org.primefaces.push.PushServlet] [http-nio-8081-exec-2] [requestId=2]
No Annotated class using @PushEndpoint found. Push will not work.
14:04:38.209 WARN [org.atmosphere.cpr.AsynchronousProcessor] [http-nio-8081-exec-2] [requestId=2]
Websocket protocol not supported
14:09:54.778 WARN [org.apache.catalina.loader.WebappClassLoaderBase] [localhost-startStop-2] []
The web application [ivy] appears to have started a thread named [Atmosphere-Scheduler-1] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:1134)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:809)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
14:09:54.779 WARN [org.apache.catalina.loader.WebappClassLoaderBase] [localhost-startStop-2] []
The web application [ivy] appears to have started a thread named [Atmosphere-Scheduler-11] but has failed to stop it. This is very likely to create a memory leak. Stack trace of thread:
sun.misc.Unsafe.park(Native Method)
java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:1129)
java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.poll(ScheduledThreadPoolExecutor.java:809)
java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1066)
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
java.lang.Thread.run(Thread.java:745)
14:10:30.830 WARN [] [Worker-0] [executionContext=SYSTEM]
the logger can't be the child of org.eclipse.birt
Here's what I added to the web.xml:
<servlet>
<servlet-name>Push Servlet</servlet-name>
<servlet-class>org.primefaces.push.PushServlet</servlet-class>
<async-supported>true</async-supported>
<init-param>
<param-name>org.atmosphere.useWebSocketAndServlet3</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>org.atmosphere.websocket.suppressJSR356</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>Push Servlet</servlet-name>
<url-pattern>/primepush/*</url-pattern>
</servlet-mapping>
And what I added to the webapps/ivy/WEB-INF/lib directory:
atmosphere-runtime-native-2.4.14.jar
atmosphere-compat-tomcat-2.0.1.jar
atmosphere-compat-jbossweb-2.0.1.jar
atmosphere-compat-tomcat7-2.0.1.jar
I saw that you implemented a websocket for the chat feature in the Portal (XIVY-519) so it should still work. But in the Portal project, the atmosphere jar is directly in the project so the old way in the question linked above probably doesn't work anymore...
TLDR; Could you give me a hint how I can create my own PrimeFaces Push WebSocket endpoints in ivy 6.x?
[1]: https://answers.axonivy.com/questions/10/can-i-use-primepush-in-xpert-ivy