Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-10879

Deployment is not failing as expected and according to the specification if a @Singleton @Startup @PostConstruct initialization failed

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 21.0.0.Beta1, 21.0.0.Final
    • None
    • EJB
    • None
    • 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
    • User Experience
    • Regression

    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 .

      Attachments

        Issue Links

          Activity

            People

              spyrkob Bartosz Spyrko-Smietanko
              rhn-support-wfink Wolf Fink
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: