Greetings!
We have run in some problems when using PrimePush with a modular deployment of a JSF application. We are building our application in a way that is described here by BalusC: LINK. I got a requirement to implement a push solution and since we're already using PF5 i chose PrimePush (Atmosphere).
The problem was that a push functionality in a specific module (JAR) wasn't working. After a couple of grueling days we found that the socket component somehow doesn't find the endpoint (class annotated with @PushEndpoint). I have attached a proof of concept showing this "bug". I took the counter example from the showcase page and packaged it in two different ways. First is a normal WAR layout and the second is the JAR layout which i added to the WEB-INF/lib folder manually. WAR was deployed on Tomcat 7.0.54. You can see the library versions and web.xml settings in the POC application. If you deploy the application, you will see that the example on /test url is working as intended but the same example on /test/notworking doesn't. I don't know if this is an issue with PrimePush or Atmosphere library.
POC LINK
Regards!
P.S. Since we're using vanilla Tomcat with no EE libraries, i had to add javax.inject-1.jar as a dependency because i was getting a java.lang.NoClassDefFoundError: javax/inject/Inject
PF Push/Atmosphere issue with modular deployment
-
- Posts: 3
- Joined: 08 Mar 2014, 09:30
Hi,
It's a common problem and no answer for this yet. There is no clue if the issue is with PrimePush or Atmosphere library
It's a common problem and no answer for this yet. There is no clue if the issue is with PrimePush or Atmosphere library
-
- Posts: 99
- Joined: 25 Feb 2015, 11:02
Yes this is a known problem of Atmosphere framework, not specific to PrimeFaces.
So far, the only solution is to place all the endpoint classes ( @PushEndpoint ) directly in a WAR module.
If using Maven, it is possible to use skinny WARs, so during the build, all the Endpoint classes of the skinny WAR modules will be copied to the final WAR/classes folder.
It may also work using modules with web fragments ...
So far, the only solution is to place all the endpoint classes ( @PushEndpoint ) directly in a WAR module.
If using Maven, it is possible to use skinny WARs, so during the build, all the Endpoint classes of the skinny WAR modules will be copied to the final WAR/classes folder.
It may also work using modules with web fragments ...
PrimeFaces 6.1 / PF Extensions 6.1.1 / Atmosphere 2.4.3
Apache Mojarra 2.2.13+
WildFly 10.1.0.Final
Apache Mojarra 2.2.13+
WildFly 10.1.0.Final
Miguel Cubells wrote:Yes this is a known problem of Atmosphere framework, not specific to PrimeFaces.
So far, the only solution is to place all the endpoint classes ( @PushEndpoint ) directly in a WAR module.
If using Maven, it is possible to use skinny WARs, so during the build, all the Endpoint classes of the skinny WAR modules will be copied to the final WAR/classes folder.
It may also work using modules with web fragments ...
Can you please give an example how this can be done. I stumbled upon the same problem, and i've been trying for 2 days now to resolve it. The solution that you gave is the only option left to try, but i couldn't really understand how these skinny WARs, are being created. I followed that http://maven.apache.org/plugins/maven-w ... -wars.html as an example, but i'm new to maven so i didn't really get it.
-
- Posts: 99
- Joined: 25 Feb 2015, 11:02
Probably you can forget about "skinny" wars, and just think a way to perform the following in Maven, Ant, or even in Gradle:
- The build of any JAR containing @PushEndpoint classes, should exclude them from the packaged JAR
- Instead, these excluded @PushEnpoint classes, should be copied directly under the /WEB-INF/classes folder of your WAR module, before packaging it.
So, at the end,
- Your packaged WAR should contain a WEB-INF/classes folder with all your @PushEndpoint classes, -taken from all your JAR modules-
- WEB-INF/lib/*.jar files should NOT contain any @PushEndpoint class inside.
This is the main idea. Skinny wars is just a way to accomplish it, but I cannot post a specific example ... ( we no longer use skinny wars, and I don't have any old example at hand )
- The build of any JAR containing @PushEndpoint classes, should exclude them from the packaged JAR
- Instead, these excluded @PushEnpoint classes, should be copied directly under the /WEB-INF/classes folder of your WAR module, before packaging it.
So, at the end,
- Your packaged WAR should contain a WEB-INF/classes folder with all your @PushEndpoint classes, -taken from all your JAR modules-
- WEB-INF/lib/*.jar files should NOT contain any @PushEndpoint class inside.
This is the main idea. Skinny wars is just a way to accomplish it, but I cannot post a specific example ... ( we no longer use skinny wars, and I don't have any old example at hand )
PrimeFaces 6.1 / PF Extensions 6.1.1 / Atmosphere 2.4.3
Apache Mojarra 2.2.13+
WildFly 10.1.0.Final
Apache Mojarra 2.2.13+
WildFly 10.1.0.Final
-
- Information
-
Who is online
Users browsing this forum: No registered users and 51 guests