Uploaded image for project: 'CDI Specification Issues'
  1. CDI Specification Issues
  2. CDI-140

improve passivation capable bean validation for @Dependent scoped beans in 6.6.4

    Details

    • Type: Clarification
    • Status: Resolved (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 1.0
    • Fix Version/s: 1.1.EDR
    • Component/s: Resolution
    • Labels:
      None
    • Estimated Difficulty:
      Medium

      Description

      Currently section 6.6.4 defines that @Dependent scoped beans which get injected into a bean of a passivating scope must be Serializable.

      "If a producer method or field of scope @Dependent returns an unserializable object for injection into an injection point that requires a passivation capable dependency, the container must throw an Illegal- ProductException"

      The question is how to interpret "that requires a passivation capable dependency".

      It would e.g. be perfectly fine if the @Dependent bean is not Serializable if the injectionpoint will be serialized via a writeObject or Externalizable#writeExternal.

      Proposal: to explicitly add a check for Modifier.TRANSIENT and writeObject(ObjectOutputStream) and Externalizable#writeExternal(ObjectOutput)

      This is very important for @Dependent scoped producers of legacy classes because there is otherwise no way to inject such classes at all.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            pmuir Pete Muir added a comment -

            Mark, do you want to create a patch to the spec for this?

            Show
            pmuir Pete Muir added a comment - Mark, do you want to create a patch to the spec for this?
            Hide
            struberg Mark Struberg added a comment -

            yup, will finally start working on it

            Show
            struberg Mark Struberg added a comment - yup, will finally start working on it
            Show
            struberg Mark Struberg added a comment - https://github.com/jboss/cdi/pull/47
            Hide
            struberg Mark Struberg added a comment -

            CDI-153 touches the same paragraphs.

            Show
            struberg Mark Struberg added a comment - CDI-153 touches the same paragraphs.

              People

              • Assignee:
                struberg Mark Struberg
                Reporter:
                struberg Mark Struberg
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Development