Uploaded image for project: 'Pax Web'
  1. Pax Web
  2. PAXWEB-341

Custom <error-page> in web.xml not working for WAB bundles

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.0.8
    • Fix Version/s: 1.1.3, 2.0.0
    • Component/s: None
    • Labels:
      None

      Description

      I'm using Karaf 2.2.2/PAX WEB 1.0.4 and Karaf 2.2.4/PAX WEB 1.0.8 to deploy some WAB bundles.

      For the most part everything is working as expected. The one thing I can't seem to get working is custom error pages in my web.xml:

      <error-page>
      <error-code>404</error-code>
      <location>/error.jsp</location>
      </error-page>

      <error-page>
      <exception-type>java.lang.Exception</exception-type>
      <location>/error.jsp</location>
      </error-page>

      When using the <error-code>404</error-code> I always get the default Jetty error message. I can access my "/error.jsp" page directly without issue.

      When using the <exception-type>java.lang.Exception</exception-type> it works for the first WAB bundle I install, but if I install other bundles it does not work.

      For the example files I'm deploying by dropping in Karaf's deploy folder. I've also tried installing using Karaf osgi:install command and via Karaf features.

        Gliffy Diagrams

          Attachments

            Activity

            jeremy Jeremy created issue -
            achim_nierbeck Achim Nierbeck made changes -
            Field Original Value New Value
            Affects Version/s 1.0.8 [ 11188 ]
            achim_nierbeck Achim Nierbeck made changes -
            Fix Version/s 2.0.1 [ 11386 ]
            achim_nierbeck Achim Nierbeck made changes -
            Assignee Achim Nierbeck [ achim_nierbeck ]
            Fix Version/s 2.0.0 [ 10443 ]
            Fix Version/s 2.0.1 [ 11386 ]
            achim_nierbeck Achim Nierbeck made changes -
            Status Open [ 1 ] In Progress [ 3 ]
            achim_nierbeck Achim Nierbeck made changes -
            Fix Version/s 1.1.3 [ 11387 ]
            Hide
            achim_nierbeck Achim Nierbeck added a comment -

            1.1.3:
            Branch: refs/heads/pax-web-1.1.x
            Home: https://github.com/ops4j/org.ops4j.pax.web
            Commit: ffa49e131142a0140705b444c4718a715561ffa8
            https://github.com/ops4j/org.ops4j.pax.web/commit/ffa49e131142a0140705b444c4718a715561ffa8
            Date: 2012-04-18 (Wed, 18 Apr 2012)

            Changed paths:
            M pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/JettyServerImpl.java

            2.0.0

            Branch: refs/heads/master
            Home: https://github.com/ops4j/org.ops4j.pax.web
            Commit: 3fac4820af8354ab44e28207203c87318b58d37e
            https://github.com/ops4j/org.ops4j.pax.web/commit/3fac4820af8354ab44e28207203c87318b58d37e
            Date: 2012-04-18 (Wed, 18 Apr 2012)

            Changed paths:
            M itest/src/test/java/org/ops4j/pax/web/itest/JettyConfigurationIntegrationTest.java
            M itest/src/test/java/org/ops4j/pax/web/itest/WarIntegrationTest.java
            M pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/JettyServerImpl.java
            M samples/war/src/main/webapp/WEB-INF/web.xml
            A samples/war/src/main/webapp/error.jsp
            A samples/war/src/main/webapp/exception.jsp
            A samples/war/src/main/webapp/simple.jsp

            Show
            achim_nierbeck Achim Nierbeck added a comment - 1.1.3: Branch: refs/heads/pax-web-1.1.x Home: https://github.com/ops4j/org.ops4j.pax.web Commit: ffa49e131142a0140705b444c4718a715561ffa8 https://github.com/ops4j/org.ops4j.pax.web/commit/ffa49e131142a0140705b444c4718a715561ffa8 Date: 2012-04-18 (Wed, 18 Apr 2012) Changed paths: M pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/JettyServerImpl.java 2.0.0 Branch: refs/heads/master Home: https://github.com/ops4j/org.ops4j.pax.web Commit: 3fac4820af8354ab44e28207203c87318b58d37e https://github.com/ops4j/org.ops4j.pax.web/commit/3fac4820af8354ab44e28207203c87318b58d37e Date: 2012-04-18 (Wed, 18 Apr 2012) Changed paths: M itest/src/test/java/org/ops4j/pax/web/itest/JettyConfigurationIntegrationTest.java M itest/src/test/java/org/ops4j/pax/web/itest/WarIntegrationTest.java M pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/JettyServerImpl.java M samples/war/src/main/webapp/WEB-INF/web.xml A samples/war/src/main/webapp/error.jsp A samples/war/src/main/webapp/exception.jsp A samples/war/src/main/webapp/simple.jsp
            achim_nierbeck Achim Nierbeck made changes -
            Status In Progress [ 3 ] Resolved [ 5 ]
            Resolution Fixed [ 1 ]
            achim_nierbeck Achim Nierbeck made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              • Assignee:
                achim_nierbeck Achim Nierbeck
                Reporter:
                jeremy Jeremy
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development