Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-20063

[GSS](7.3.z) Deployment is not failing as expected and according to the specification if a @Singleton @Startup @PostConstruct initialization failed

    Details

    • Target Release:
    • Steps to Reproduce:
      Hide

      Deploy a jar with a singleton in one ejb-module and anoither application like second ejb or war.
      Let the Singleton postconstruct fail with a RuntimeException.
      Check the ear.failed deployment marker file
      invoke the second application

      git@github.com:wfink/jboss-eap7.1-playground.git branch: 71SingletonStartupDeployError
      server/ear/target to deploy
      test class: path clients/InitialContext SimpleClient.class

      Show
      Deploy a jar with a singleton in one ejb-module and anoither application like second ejb or war. Let the Singleton postconstruct fail with a RuntimeException. Check the ear.failed deployment marker file invoke the second application git@github.com:wfink/jboss-eap7.1-playground.git branch: 71SingletonStartupDeployError server/ear/target to deploy test class: path clients/InitialContext SimpleClient.class
    • Affects:
      User Experience
    • Affects Testing:
      Regression
    • QE Test Coverage:
      +

      Description

      According to the spec (see below excerpt of ejb3.2 specification) the application should not avaialble if a Singleton initialization has failed.

      The current behaviour with two ejb.jar's in one ear, or other combinations is
      that the failure is logged, the deployment seems removed (there is a APP.ear.failed marker file) but another EJB of a second jar inside the ear is accesible, also web applications war deployemts are started.

      from the Spec 3.2

      4.8.1 Singleton Session Bean Initialization
      By default, the container is responsible for deciding when to initialize a singleton session bean instance.
      However, the Bean Provider can optionally configure the singleton session bean for eager initialization.
      If the Startup annotation appears on the singleton session bean class or if the singleton session bean
      has been designated via the deployment descriptor as requiring eager initialization, the container must
      initialize the singleton session bean instance during the application startup sequence.

              • The container must initialize all such startup-time singleton session beans before any external client requests (that is,
                client requests originating outside of the application) are delivered to any enterprise bean components in
                the application. ******

      4.8.4 Singleton SB error handling
      Errors occurring during singleton session bean initialization are considered fatal and must result in the
      discarding of the singleton session bean instance. ...
      If a singleton session bean fails to initialize, attempted invocations on the singleton session bean result in the
      javax.ejb.NoSuchEJBException exception as defined by Section 3.4.3 and Section 3.4.4 .

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  spyrkob Bartosz Spyrko-Smietanko
                  Reporter:
                  wdfink Wolf-Dieter Fink
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: