PF Push/Atmosphere issue with modular deployment

UI Components for JSF
Post Reply
Houdre
Posts: 12
Joined: 29 Apr 2013, 12:22

08 Oct 2014, 10:18

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

smartleopard
Posts: 3
Joined: 08 Mar 2014, 09:30

10 Jun 2016, 06:57

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

Miguel Cubells
Posts: 99
Joined: 25 Feb 2015, 11:02

24 Jun 2016, 03:36

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 ...
PrimeFaces 6.1 / PF Extensions 6.1.1 / Atmosphere 2.4.3
Apache Mojarra 2.2.13+
WildFly 10.1.0.Final

rradko
Posts: 1
Joined: 14 Jul 2016, 12:07

26 Jul 2016, 23:57

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.

Miguel Cubells
Posts: 99
Joined: 25 Feb 2015, 11:02

30 Aug 2016, 07:11

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 )
PrimeFaces 6.1 / PF Extensions 6.1.1 / Atmosphere 2.4.3
Apache Mojarra 2.2.13+
WildFly 10.1.0.Final

tptptp007
Posts: 1
Joined: 12 Sep 2017, 05:41

23 Sep 2017, 06:17

Hello everyone.
I have the same problem, please introduce me.



sbobet mobile

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 24 guests