You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "George Sapountzis (JIRA)" <ji...@apache.org> on 2011/04/10 10:06:05 UTC
[jira] [Created] (OWB-563) producers of passivating beans fail
validation when the declared return type is not serializable but the actual
return type is
producers of passivating beans fail validation 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 during deployment:
public interface MSerializableInterface extends MInterface, Serializable {
}
public class MBean implements MSerializableInterface {
}
public class MBeanProducer {
@Produces @ConversationScoped
public MInterface produce() {
return new MBean();
}
}
I don't know what the spec says and whether such a case can be identified statically but maybe it should be allowed.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (OWB-563) producers of passivating beans fail when
the declared return type is not serializable but the actual return type is
Posted by "George Sapountzis (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
George Sapountzis updated OWB-563:
----------------------------------
Description:
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.
was:
The following case fails during deployment:
public interface MSerializableInterface extends MInterface, Serializable {
}
public class MBean implements MSerializableInterface {
}
public class MBeanProducer {
@Produces @ConversationScoped
public MInterface produce() {
return new MBean();
}
}
I don't know what the spec says and whether such a case can be identified statically but maybe it should be allowed.
Summary: producers of passivating beans fail when the declared return type is not serializable but the actual return type is (was: producers of passivating beans fail validation when the declared return type is not serializable but the actual return type is)
> 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
[jira] [Resolved] (OWB-563) producers of passivating beans fail
when the declared return type is not serializable but the actual return
type is
Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OWB-563?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mark Struberg resolved OWB-563.
-------------------------------
Resolution: Not A Problem
Fix Version/s: 1.1.1
Assignee: Mark Struberg (was: Gurkan Erdogdu)
It's certainly not a perfect situation, but this is not a bug according to the CDI-1.0 spec.
> 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: Mark Struberg
> Fix For: 1.1.1
>
>
> 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
[jira] [Commented] (OWB-563) producers of passivating beans fail
when the declared return type is not serializable but the actual return
type is
Posted by "Mark Struberg (JIRA)" <ji...@apache.org>.
[ 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