[ https://issues.apache.org/jira/browse/OWB-1123?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15436375#comment-15436375 ]
Romain Manni-Bucau edited comment on OWB-1123 at 8/25/16 7:04 AM: ------------------------------------------------------------------ Ok, the cause is there https://github.com/apache/openwebbeans/blob/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java#L1278 (not the extension.toString()). Fix can be in both OWB and myfaces. On MyFaces side the extension could implement a stable toString() (workaround) but should set the annotated type id manually (recommanded way). On OWB we can evaluate the fact to not rely on toString there but we need to pass TCKs first (issue being how to distinguish 2 extensions of the same type in an ear for instance). edit: running tck ATM (and off to breakfast), will come back there soon to give a status on that was (Author: romain.manni-bucau): Ok, the cause is there https://github.com/apache/openwebbeans/blob/trunk/webbeans-impl/src/main/java/org/apache/webbeans/container/BeanManagerImpl.java#L1278 (not the extension.toString()). Fix can be in both OWB and myfaces. On MyFaces side the extension could implement a stable toString() (workaround) but should set the annotated type id manually (recommanded way). On OWB we can evaluate the fact to not rely on toString there but we need to pass TCKs first (issue being how to distinguish 2 extensions of the same type in an ear for instance). > 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)