[JBoss JIRA] (CDI-362) No-interface view EJB proxying rules are less strict than CDI, leading to odd error reporting
by Mark Struberg (JIRA)
[ https://issues.jboss.org/browse/CDI-362?page=com.atlassian.jira.plugin.sy... ]
Mark Struberg commented on CDI-362:
-----------------------------------
> Still would need to tackle the @Stateful @SomeCdiScope case
~pmuir yes I can elaborate: think about a
{code}
@Stateful
@SessionScoped
public class MyBackingBean {...
{code}
It gets the lifecycle from CDI. It's Contextual Instances will get stored in the SessionContext from CDI. But still it's an EJB. Which proxy will it get? I assume it will get stored in the SessionContext _with_ the 1:1 EJB proxy already applied, right? And we will _outside_ in BeanManager#getReference() return a CDI NormalScoping proxy?
So we have proxies from both CDI and EJB involved - thus what rules shall apply?
> No-interface view EJB proxying rules are less strict than CDI, leading to odd error reporting
> ---------------------------------------------------------------------------------------------
>
> Key: CDI-362
> URL: https://issues.jboss.org/browse/CDI-362
> Project: CDI Specification Issues
> Issue Type: Bug
> Reporter: Pete Muir
> Fix For: 1.1.FD
>
>
> E.g.
> // allowed by EJB
> // disallowed by CDI
> @Stateful @RequestScoped
> public class MyBean {
> final void m() { };
> }
> public class Other {
> @EJB MyBean field; // PASS
> @Inject MyBean field; // FAIL - unproxyable
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 8 months
[JBoss JIRA] (CDI-362) No-interface view EJB proxying rules are less strict than CDI, leading to odd error reporting
by Pete Muir (JIRA)
[ https://issues.jboss.org/browse/CDI-362?page=com.atlassian.jira.plugin.sy... ]
Pete Muir commented on CDI-362:
-------------------------------
CDI descries what can't be proxied:
{quote}
The container uses proxies to provide certain functionality. Certain legal bean types cannot be proxied by the container:
* classes which don’t have a non-private constructor with no parameters,
* classes which are declared final,
* classes which have non-static, final methods with public, protected or default visibility,
* primitive types,
* and array types.
{quote}
and then goes on to say when and how these rules are applied:
{quote}
A bean type must be proxyable if an injection point resolves to a bean:
* that requires a client proxy, or
* that has an associated decorator, or
* that has a bound interceptor.
Otherwise, the container automatically detects the problem, and treats it as a deployment problem.
{quote}
To answer your specific questions:
1) Yes - CDI never looks at private methods when considering whether a type is proxyable.
2) non-private methods cannot be declared final in order to be proxied
> No-interface view EJB proxying rules are less strict than CDI, leading to odd error reporting
> ---------------------------------------------------------------------------------------------
>
> Key: CDI-362
> URL: https://issues.jboss.org/browse/CDI-362
> Project: CDI Specification Issues
> Issue Type: Bug
> Reporter: Pete Muir
> Fix For: 1.1.FD
>
>
> E.g.
> // allowed by EJB
> // disallowed by CDI
> @Stateful @RequestScoped
> public class MyBean {
> final void m() { };
> }
> public class Other {
> @EJB MyBean field; // PASS
> @Inject MyBean field; // FAIL - unproxyable
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 8 months
[JBoss JIRA] (CDI-362) No-interface view EJB proxying rules are less strict than CDI, leading to odd error reporting
by Marina Vatkina (JIRA)
[ https://issues.jboss.org/browse/CDI-362?page=com.atlassian.jira.plugin.sy... ]
Marina Vatkina commented on CDI-362:
------------------------------------
Pete, can we list all the rules and identify any inconsistencies?
1. final rule - does CDI allow private methods to be final if it is a no-interface view?
2. non-public methods - I know at least one EJB container that followed the CDI spec and not so much the EJB spec and proxied protected methods.
I need to check if RI actually follows the EJB spec rule about the EJBException.
> No-interface view EJB proxying rules are less strict than CDI, leading to odd error reporting
> ---------------------------------------------------------------------------------------------
>
> Key: CDI-362
> URL: https://issues.jboss.org/browse/CDI-362
> Project: CDI Specification Issues
> Issue Type: Bug
> Reporter: Pete Muir
> Fix For: 1.1.FD
>
>
> E.g.
> // allowed by EJB
> // disallowed by CDI
> @Stateful @RequestScoped
> public class MyBean {
> final void m() { };
> }
> public class Other {
> @EJB MyBean field; // PASS
> @Inject MyBean field; // FAIL - unproxyable
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 8 months
FD submission
by Pete Muir
Hi all,
As you've probably noticed, we haven't submitted the final draft yet. Due to a number of late issues, and some integration issues (e.g. see the recent emails about lifecycle interceptor problems), we've had to slip the date slightly.
We are planning to submit on April 12th, with the ballot following. This will be around the same date that Java EE and EJB submit.
Pete
11 years, 8 months
[JBoss JIRA] (CDI-362) No-interface view EJB proxying rules are less strict than CDI, leading to odd error reporting
by Marina Vatkina (JIRA)
[ https://issues.jboss.org/browse/CDI-362?page=com.atlassian.jira.plugin.sy... ]
Marina Vatkina commented on CDI-362:
------------------------------------
EJB 3.1 said "All methods of the bean class and any superclasses must not be declared final". We tried to relax this restriction, and it is definitely too harsh for private methods - you can't access them through proxy anyway. We can relax less, but there is no good reason to prevent final private methods.
> No-interface view EJB proxying rules are less strict than CDI, leading to odd error reporting
> ---------------------------------------------------------------------------------------------
>
> Key: CDI-362
> URL: https://issues.jboss.org/browse/CDI-362
> Project: CDI Specification Issues
> Issue Type: Bug
> Reporter: Pete Muir
> Fix For: 1.1.FD
>
>
> E.g.
> // allowed by EJB
> // disallowed by CDI
> @Stateful @RequestScoped
> public class MyBean {
> final void m() { };
> }
> public class Other {
> @EJB MyBean field; // PASS
> @Inject MyBean field; // FAIL - unproxyable
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
11 years, 8 months