openwebbeans-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mark Struberg (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (OWB-563) producers of passivating beans fail when the declared return type is not serializable but the actual return type is
Date Sun, 10 Apr 2011 09:47:05 GMT

    [ https://issues.apache.org/jira/browse/OWB-563?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13018061#comment-13018061
] 

Mark Struberg commented on OWB-563:
-----------------------------------

Hi!

I fear the spec defines exactly what we are doing atm:

6.6.4. Validation of passivation capable beans and dependencies
If a producer method declares a passivating scope and:
• the container is able to determine that it is not passivation capable by inspecting its
return type, or
• has a parameter that does not resolve to a passivation capable dependency,
then the container automatically detects the problem and treats it as a deployment problem.

Even if the producer would return a Serializable field at runtime - we would not be able to
detect this at deployment time (which the spec requires imo).
This especially unhandy for types which are not defined as Serializable in their specs, like
e.g. the javax.persistence.EntityManager.


> producers of passivating beans fail when the declared return type is not serializable
but the actual return type is
> -------------------------------------------------------------------------------------------------------------------
>
>                 Key: OWB-563
>                 URL: https://issues.apache.org/jira/browse/OWB-563
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Context and Scopes
>    Affects Versions: 1.1.0
>            Reporter: George Sapountzis
>            Assignee: Gurkan Erdogdu
>
> The following case fails at runtime with "produce return type must be Serializable":
> public class MBean implements MInterface, Serializable {
> }
> public class MBeanProducer {
>   @Produces @ConversationScoped
>   public MInterface produce() { 
>     return new MBean();
>   }
> }
> I don't know what the spec says but maybe owb should check the actual return type and
allow this case.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message