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

Leonardo Uribe commented on OWB-1123:
-------------------------------------

I have checked the example reported in MyFaces side and the problem is related 
to some changes in OWB. In TomEE 1.7.4 (OWB 1.2.7) it works well but in TomEE 
7.0.1 (OWB 1.6.3) it throws the exception.

It is clear rely on BeanManager serialization is not a good idea, so I fixed 
the code to avoid the serialization step and get the BeanManager using 
FacesContext, but that doesn't fix the exception at restart (it fix the one at 
shutdown). So I guess it should be something wrong in OWB 1.6.2 and upper 
versions. I can't see anything different on the stack trace.

> NPE at NormalScopeProxyFactory.createNormalScopeProxy during deserialization
> ----------------------------------------------------------------------------
>
>                 Key: OWB-1123
>                 URL: https://issues.apache.org/jira/browse/OWB-1123
>             Project: OpenWebBeans
>          Issue Type: Bug
>    Affects Versions: 1.6.2
>         Environment: TomEE 7.0.0.M2
>            Reporter: Bauke Scholtz
>            Assignee: Mark Struberg
>
> Imagine a session scoped bean which has an application scoped bean injected 
> as property and it's being referenced in {{readObject()}}.
> {code}
> @SessionScoped
> public class SessionScopedBean {
>     @Inject
>     private ApplicationScopedBean appBean;
>     private void readObject(ObjectInputStream input) throws IOException, 
> ClassNotFoundException {
>         appBean.doSomething();
>     }
> }
> {code}
> OWB 1.6.2 as used in TomEE 7.0.0.M2 throws below exception when TomEE is 
> restarted with session persistence (and above bean is created during that 
> session):
> {code}
> java.lang.NullPointerException
>     at 
> org.apache.webbeans.proxy.NormalScopeProxyFactory.createNormalScopeProxy(NormalScopeProxyFactory.java:121)
>     at 
> org.apache.webbeans.intercept.NormalScopedBeanInterceptorHandler.readResolve(NormalScopedBeanInterceptorHandler.java:125)
> {code}
> It works fine in all Weld 2.x versions I tested so far (WF8/9/10, PY4 and 
> "plain" Tomcat8+Weld 2.3.0).
> Work around would be to use a static method on application scoped bean, but 
> this is not nice.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to