[
https://issues.apache.org/jira/browse/MYFACES-4299?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16893420#comment-16893420
]
Thomas Andraschko commented on MYFACES-4299:
--------------------------------------------
[~volosied] how can i test it?
I added:
{code:java}
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<version>9.4.15.v20190215</version>
<configuration>
<webAppConfig>
<contextPath>/test</contextPath>
</webAppConfig>
<scanIntervalSeconds>5</scanIntervalSeconds>
</configuration>
</plugin>
{code}
and start it via: mvn clean package jetty:run-exploded
and it works fine after opening
http://localhost:8080/test/faces/websocket_once.xhtml
> ManagedProperty & Websocket: NullPointerException
> --------------------------------------------------
>
> Key: MYFACES-4299
> URL: https://issues.apache.org/jira/browse/MYFACES-4299
> Project: MyFaces Core
> Issue Type: Bug
> Components: JSR-372
> Affects Versions: 2.3.0, 2.3.1, 2.3.2, 2.3.3, 2.3.4
> Environment: Tomcat
> Reporter: Volodymyr Siedlecki
> Priority: Minor
> Attachments: MYFACES-4299-app.zip
>
>
> Hello,
>
> I have a sample JSF 2.3.3 application that uses @ManagedProperty with a web
> socket observer class. This application throws a null pointer exception.
> In the createManagedProperty of the ManagedPropertyProducer class,
> FacesContext.getCurrentInstance() returns null.
> In the createManagedProperty method, if you catch the error and create a new
> facesContext via BeanProvider.getContextualReference, the example still won’t
> work. Is there any way around this error?
> Or can anyone confirm that this example is not a valid use of
> ManagedProperty? It doesn’t seem like it since the communication is going
> through web sockets and therefore isn’t hitting the Faces Servlet.
>
> Also, this application doesn't work with the mojarra 2.3 code either.
>
> I’ve provided the sample application.
> Here is the stack trace:
> java.lang.NullPointerException
> at
> org.apache.myfaces.cdi.managedproperty.ManagedPropertyProducer.createManagedProperty(ManagedPropertyProducer.java:83)
> at
> org.apache.myfaces.cdi.managedproperty.ManagedPropertyProducer.lambda$new$0(ManagedPropertyProducer.java:77)
> at
> org.apache.myfaces.cdi.util.AbstractDynamicProducer.create(AbstractDynamicProducer.java:97)
> at
> org.apache.webbeans.component.third.ThirdpartyBeanImpl.create(ThirdpartyBeanImpl.java:97)
> at
> org.apache.webbeans.context.DependentContext.getInstance(DependentContext.java:68)
> at
> org.apache.webbeans.context.AbstractContext.get(AbstractContext.java:125)
> at
> org.apache.webbeans.container.BeanManagerImpl.getReference(BeanManagerImpl.java:813)
> at
> org.apache.webbeans.container.BeanManagerImpl.getInjectableReference(BeanManagerImpl.java:673)
>
> Thank you
--
This message was sent by Atlassian JIRA
(v7.6.14#76016)