[
https://issues.apache.org/jira/browse/OWB-589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13056749#comment-13056749
]
Joe Bergmark commented on OWB-589:
----------------------------------
I agree that we shouldn't be checking that parameters injected into a producer
method are serializable just because the producer method happens to return a
serializable object. The producer method doesn't even appear to have a
passivating scope in this case.
It is possible that this code is trying to protect against these dependent
objects getting stored in the creational context of a passivating scope if they
aren't serializable. For example
SessionScopedBean has @Inject @MyOwnQualifier String which in turn injects a
NonserializableDependency. In this case we would try to store the
NonserializableDependency in the creational context of the SessionScopedBean
even though it might not be serializable. This is assuming that both the
producer method and NonserializableDependency are dependent scoped.
The spec does say we should check the parameters of the ProducerMethod itself
declares a passivating scope 6.6.4.
> " ... requires a passivation capable dependency ..." for producer method with
> return type String and non serializable injected dependency
> -----------------------------------------------------------------------------------------------------------------------------------------
>
> Key: OWB-589
> URL: https://issues.apache.org/jira/browse/OWB-589
> Project: OpenWebBeans
> Issue Type: Bug
> Components: Injection and Lookup
> Affects Versions: 1.1.0
> Environment: OWB 1.1.1-SNAPSHOT
> Reporter: Martin Kočí
> Assignee: Gurkan Erdogdu
> Priority: Minor
>
> For @Produces method like:
> @Produces
> @MyOwnQualifier
> public String getSomeString(NonserializableDependency dependency) {
> return dependency.getSomeString();
> }
> I've got exception:
> "If a producer method or field of scope @Dependent returns an serializable
> object for injection into an injection point Method Injection Point, method
> name : getSomeString, Bean Owner : [String, Name:null, WebBeans
> Type:PRODUCERMETHOD, API
> Types:[java.lang.Object,java.lang.Comparable,java.io.Serializable,java.lang.CharSequence,java.lang.String],
> Qualifiers:[javax.enterprise.inject.Any,MyOwnQualifier]] that requires a
> passivation capable dependency"
> I don't understand much what does it say :), but with some help from
> debugger OWB validates for Serializable the injected parameter in producer
> method - NonserializableDependency dependency in this case.
> I checked the same with WELD 1.1.1 and it works without exception.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira