glassfish
  1. glassfish
  2. GLASSFISH-20354

EJBException thrown in JAXRS resource that's also an EJB bean is sometimes consumed by CDI

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 4.0_b85
    • Fix Version/s: 4.0_b86_RC2
    • Component/s: jax-rs
    • Labels:
      None

      Description

      In a resource

      @Stateless
      @Path("/ssb")
      public class StatelessRootResource {
      	@Path("exception")
      	@GET
      	public String throwException() {
      		throw new EJBException(new WebApplicationException(Status.CREATED));
      	}
      }
      

      the EJBException should be unwrapped and the exception processed by JAXRS according to JAXRS Spec. However, this only happens in about 50% of deployments (tested 15times in a row). It seems that status 201 is returned only when JAXRS container is dealing with it. Sometimes, Status 500 returned and the exception is logged to server log. However, when

      asadmin set configs.config.server-config.cdi-service.enable-implicit-cdi=false

      ,
      Status 201 has been returned 10x in a row, no 500.

        Issue Links

          Activity

          Hide
          Jakub Podlesak added a comment -

          As discussed offline with Jan, we need to make sure Jersey's EJB component provider takes precedence over the CDI one.

          Show
          Jakub Podlesak added a comment - As discussed offline with Jan, we need to make sure Jersey's EJB component provider takes precedence over the CDI one.
          Hide
          Jakub Podlesak added a comment -

          set fixByVersion to b86. The fix should be delivered as part of Jersey 2.0-rc2

          Show
          Jakub Podlesak added a comment - set fixByVersion to b86. The fix should be delivered as part of Jersey 2.0-rc2
          Hide
          Jakub Podlesak added a comment -

          This has already been fixed in Jersey 2.0-rc2, where EJB component provider takes precedence over the CDI one, so that also appropriated Exception mapper is configured all right.

          Show
          Jakub Podlesak added a comment - This has already been fixed in Jersey 2.0-rc2, where EJB component provider takes precedence over the CDI one, so that also appropriated Exception mapper is configured all right.
          Hide
          Jakub Podlesak added a comment -

          Added 4_0-review tag, required info for the review follow:

          • What is the impact on the customer of the bug?
          • If this was not fixed, customer would likely face a nasty non-deterministic behaviour (this bug shows up in 6 out of 10 cases)
            -This is clearly a regression
          • What is the cost/risk of fixing the bug?
          • The risk is quite low, and the bug was already fixed in Jersey 2.0-rc2
          • Is there an impact on documentation or message strings?
          • There is no such impact.
          • Which tests should QA (re)run to verify the fix did not destabilize GlassFish?
          • JAX-RS/EJB integration tests
          • Which is the targeted build of 4.0 for this fix?
          • b86
          Show
          Jakub Podlesak added a comment - Added 4_0-review tag, required info for the review follow: What is the impact on the customer of the bug? If this was not fixed, customer would likely face a nasty non-deterministic behaviour (this bug shows up in 6 out of 10 cases) -This is clearly a regression What is the cost/risk of fixing the bug? The risk is quite low, and the bug was already fixed in Jersey 2.0-rc2 Is there an impact on documentation or message strings? There is no such impact. Which tests should QA (re)run to verify the fix did not destabilize GlassFish? JAX-RS/EJB integration tests Which is the targeted build of 4.0 for this fix? b86
          Hide
          Jakub Podlesak added a comment -

          Fixed with Jersey 2.0-rc2 integration (https://java.net/jira/browse/GLASSFISH-20385)

          Show
          Jakub Podlesak added a comment - Fixed with Jersey 2.0-rc2 integration ( https://java.net/jira/browse/GLASSFISH-20385 )

            People

            • Assignee:
              Jakub Podlesak
              Reporter:
              jan.supol
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: