[
https://issues.apache.org/jira/browse/OWB-574?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13040263#comment-13040263
]
Joe Bergmark commented on OWB-574:
----------------------------------
Unfortunately I think EJBs do have to have a version with @New as well.
Section 3.12 says "For each managed bean, and for each session bean, a second
bean exists which" etc.
In order to let the EJB plugin handle this in a way that the common
webbeans-impl code can understand, I'm thinking of the following:
1) Remove the creation of current NewBean impl from EJBUtility. Let the plugin
do this in defineSessionBean as it understands its EJBBean code better than we
can in common code.
2) Make NewBean an interface, so that anyone can implement that interface, and
we can just check for the interface to know we should be ignoring
Specialization, etc.
3) Rename the current NewBean implementation class to something like
NewManagedBean, and have it implement the NewBean interface.
All the places where we construct NewBean's will need to be changed to use #3
(which is only 2 utility method I believe), and all of the checks for NewBean
can remain as they are now.
Another alternative would just be to check for the @New qualifier rather than
"instanceof NewBean", but the spec doesn't really forbid that annotation from
being used elsewhere.
> NewBean doesn't support EJBs
> ----------------------------
>
> Key: OWB-574
> URL: https://issues.apache.org/jira/browse/OWB-574
> Project: OpenWebBeans
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.0
> Reporter: Joe Bergmark
> Assignee: Joe Bergmark
>
> I need to do some more investigation, but I believe OWB has a problem with
> @New is used with an EJB. It attempts to use a NewBean, which extends
> ManagedBean, but never sets a constructor (which it shouldn't, given its an
> EJB). I believe the lack of constructor leads to an NPE when
> super.createInstance is called.
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira