glassfish
  1. glassfish
  2. GLASSFISH-17842

Deployment of not spec conform EJB succeeds / @PostConstruct

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.1
    • Fix Version/s: 4.0_b81
    • Component/s: deployment
    • Labels:
      None
    • Environment:

      Win 7, JDK 7

      Description

      According to Java EE 6 spec an EJB method with @PostConstruct MUST NOT throw a checked Exception.
      http://docs.oracle.com/javaee/6/api/javax/annotation/PostConstruct.html

      Deployment validation seems not to check this, as it is possible to deploy such an EJB without any warnings.
      See example below.

        Activity

        Hide
        marina vatkina added a comment -

        This is a generic annotation

        Show
        marina vatkina added a comment - This is a generic annotation
        Hide
        Hong Zhang added a comment -

        ok, we will see what we can do from the deployment side in the next release.

        Show
        Hong Zhang added a comment - ok, we will see what we can do from the deployment side in the next release.
        Hide
        Jeremy_Lv added a comment - - edited

        I'll look into this issue and try to check the validation about it.

        Show
        Jeremy_Lv added a comment - - edited I'll look into this issue and try to check the validation about it.
        Hide
        Jeremy_Lv added a comment -

        Hong:
        I think the deployment validation about @PostConstruct and @PostDestroy haven't checked the specification documented by community.
        We'd better add a validation method about checking it from the deployment side as the specification documented.

        Show
        Jeremy_Lv added a comment - Hong: I think the deployment validation about @PostConstruct and @PostDestroy haven't checked the specification documented by community. We'd better add a validation method about checking it from the deployment side as the specification documented.
        Hide
        Hong Zhang added a comment -

        Ok, you can look into where would be the best place to add this and how to add this. If this is a EJB specific check, probably the check should go into main/appserver/ejb/ejb-container/src/main/java/org/glassfish/ejb/deployment/util/EjbBundleValidator.java, if it's a validation applied to multiple areas, probably the check should be added to the base class validator main/appserver/deployment/dol/src/main/java/com/sun/enterprise/deployment/util/ComponentValidator.java

        Show
        Hong Zhang added a comment - Ok, you can look into where would be the best place to add this and how to add this. If this is a EJB specific check, probably the check should go into main/appserver/ejb/ejb-container/src/main/java/org/glassfish/ejb/deployment/util/EjbBundleValidator.java, if it's a validation applied to multiple areas, probably the check should be added to the base class validator main/appserver/deployment/dol/src/main/java/com/sun/enterprise/deployment/util/ComponentValidator.java
        Hide
        Hong Zhang added a comment -

        Added validation logic to validate lifecycle methods annotated with @PostConstruct and @PreDestroy to conform to the EE spec.

        Show
        Hong Zhang added a comment - Added validation logic to validate lifecycle methods annotated with @PostConstruct and @PreDestroy to conform to the EE spec.

          People

          • Assignee:
            Hong Zhang
            Reporter:
            myfear
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: