Uploaded image for project: 'Thorntail'
  1. Thorntail
  2. THORN-915

Java EE 7 samples: security (jacc/jaspic): cascading failure, too much Swarm automagic

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2017.1.1
    • Component/s: None
    • Labels:
      None

      Description

      When running Java EE 7 Samples with Swarm, all the security related samples (modules jacc and jaspic) fail due to a cascading failure:

      1. first, the tests obviously fail because default security subsystem in Swarm doesn't match default security subsystem in WildFly
      2. once that is fixed, the tests fail because JAX-RS is autodetected (because of some dependency), but there's no JAX-RS Application class, so Swarm creates the default one, which maps to /, which takes precedence over servlets
      3. once that is worked around (I don't have a fix), the tests fail because the ShrinkWrap archive from Java EE 7 Samples contains custom jboss-web.xml, which nullifies the changes done by JBossWebContainer.setDefaultContextRoot, but Swarm doesn't know that this setting is gone and still assumes that the application is available at /, and this is what the Swarm Arquillian container injects into the test as the @ArquillianResource URL

      Once all that is fixed / worked around, the tests pass just fine [1]. I'll be creating JIRAs for all 3 items above, but I only have a fix for the 1st problem.

      To see the issue(s) in action, follow these steps:

      # install Swarm with Arquillian fraction autodetection support
      git clone -b arquillian-fraction-autodetection https://github.com/Ladicek/wildfly-swarm.git
      cd wildfly-swarm
      mvn clean install -DskipTests
      
      # set up the Java EE 7 Samples project
      git clone -b wildfly-swarm https://github.com/Ladicek/javaee7-samples.git
      cd javaee7-samples
      mvn clean install -DskipTests
      
      # tests using Bean Validation expect English error messages
      export LC_ALL=c
      
      # run individual tests, in this case in the "jacc" module
      cd jacc
      mvn clean test -fae -Pwildfly-managed-arquillian   # with WildFly
      mvn clean test -fae -Pwildfly-swarm-arquillian     # with Swarm
      

      My key takeaway from this is that Swarm is full of automagic, which seems to work fine in 99 % of cases, but when it backfires, it burns really hard and is impossible to figure out without diving deep into Swarm internals.

      [1] Except of two tests in jaspic/dispatching-jsf-cdi that are also failing with WildFly proper.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  bob.mcwhirter Bob McWhirter
                  Reporter:
                  lthon Ladislav Thon
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: