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

David Blevins commented on OPENEJB-2083:
----------------------------------------

The @Singleton @Lock(READ) @TransactionAttribute(SUPPORTS) suggestion could be 
a very clever compromise.  So +1 on that.

This would be for JAX-RS usage specifically.  Who knows how else GF is using 
@ManagedBean -- there was talk about putting it on JSF components instead of 
JSF's "@ManagedBean"

There are tests for it in the EJB section of the TCK and they basically require 
behavior which is nearly identical to @Stateful, hence we made that choice as 
the default way to handle @ManagedBean, but I can see value in choosing 
different defaults (@Singleton, @Lock(READ), @TransactionAttribute(SUPPORTS)) 
if we detect the use might mean something else.






> Jax-RS Resource annotated with @ManagedBean
> -------------------------------------------
>
>                 Key: OPENEJB-2083
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-2083
>             Project: OpenEJB
>          Issue Type: Bug
>          Components: tomee
>         Environment: Windows 7.  TomEE JAXRS 1.6.0
>            Reporter: Lou Aloia
>
> JAX-RS resource annotated with @ManagedBean throws the following exception 
> when attempting to invoke a method on the resource:
> Caused by: org.apache.openejb.SystemException: 
> java.lang.NullPointerException: Cannot obtain an instance of the stateful 
> session bean with a null session id: Cannot obtain an instance of the 
> stateful session bean with a null session id
>       at 
> org.apache.openejb.core.managed.ManagedContainer.obtainInstance(ManagedContainer.java:630)
>       at 
> org.apache.openejb.core.managed.ManagedContainer.businessMethod(ManagedContainer.java:586)
>       ... 40 more
> The resource only has stateless session beans that are injected into it; no 
> stateful session beans.
> The application works fine on TomEE JAX-RS 1.5.2.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to