myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dora Rajappan (JIRA)" <...@myfaces.apache.org>
Subject [jira] [Commented] (MYFACES-4127) Unexpected exception thrown when FlowMap is injected on a RequestScoped bean
Date Mon, 31 Jul 2017 13:09:00 GMT

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

Dora Rajappan commented on MYFACES-4127:
----------------------------------------

Myfaces CDI integration to route the call via DefaultContextualInstanceStrategy.getIfExists
rather than via DefaultContextualInstanceStrategy.get to show the ContextNotActiveException.
Throwing ContextNotActiveException from FlowHandlerImpl (public Flow getCurrentFlow(FacesContext
context)) when window is null fails lifecycle execute testcase. Hence not an option.

> Unexpected exception thrown when FlowMap is injected on a RequestScoped bean
> ----------------------------------------------------------------------------
>
>                 Key: MYFACES-4127
>                 URL: https://issues.apache.org/jira/browse/MYFACES-4127
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.3.0-beta
>            Reporter: Eduardo Breijo
>            Priority: Minor
>         Attachments: ConfigItems.java
>
>
> When @FlowMap is injected on a RequestScoped bean, and you try to use that object (which
should be null since we are not inside of a flow), an unexpected exception is thrown. This
was noted after JIRA issue: https://issues.apache.org/jira/browse/MYFACES-4126
> Caused by: org.jboss.weld.exceptions.IllegalProductException: WELD-000052: Cannot return
null from a non-dependent producer method: Producer for Producer Method [Map<Object, Object>]
with qualifiers [@FlowMap @Any] declared as [[UnbackedAnnotatedMethod] @Produces @FlowMap
@ApplicationScoped public org.apache.myfaces.cdi.faces.ApplicationScopeObjectProducer.getFlowMap()]
declared on Managed Bean [class org.apache.myfaces.cdi.faces.ApplicationScopeObjectProducer]
with qualifiers [@Any @Default]
> 	at org.apache.myfaces.cdi.faces.ApplicationScopeObjectProducer.getFlowMap(ApplicationScopeObjectProducer.java:73)
>   StackTrace:
> 	at org.jboss.weld.bean.AbstractProducerBean.checkReturnValue(AbstractProducerBean.java:136)
> 	at [internal classes]
> 	at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:96)
> 	at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(ContextualInstanceStrategy.java:100)
> 	at [internal classes]
> 	at java.lang.String.valueOf(String.java:2994)
> 	at java.lang.StringBuilder.append(StringBuilder.java:131)
> 	at com.ibm.ws.jsf23.fat.beans.ELImplicitObjectBean.execute(ELImplicitObjectBean.java:163)
> On Mojarra 2.3, we get a different exception which looks more appropriate.
> org.jboss.weld.contexts.ContextNotActiveException: WELD-001303: No active contexts for
scope type javax.faces.flow.FlowScoped
> 	org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:623)
> 	org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.getIfExists(ContextualInstanceStrategy.java:89)
> 	org.jboss.weld.bean.ContextualInstance.getIfExists(ContextualInstance.java:63)
> 	org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:87)
> 	org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(ProxyMethodHandler.java:125)
> 	org.jboss.weld.util.Map$1302817811$Proxy$_$$_WeldClientProxy.toString(Unknown Source)
> 	java.lang.String.valueOf(String.java:2994)
> 	java.lang.StringBuilder.append(StringBuilder.java:131)
> 	com.ibm.ws.jsf23.fat.beans.ELImplicitObjectBean.execute(ELImplicitObjectBean.java:163)



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message