myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dora Rajappan (JIRA)" <>
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


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:
>             Project: MyFaces Core
>          Issue Type: Bug
>    Affects Versions: 2.3.0-beta
>            Reporter: Eduardo Breijo
>            Priority: Minor
>         Attachments:
> 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:
> 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(
>   StackTrace:
> 	at org.jboss.weld.bean.AbstractProducerBean.checkReturnValue(
> 	at [internal classes]
> 	at org.jboss.weld.context.AbstractContext.get(
> 	at org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.get(
> 	at [internal classes]
> 	at java.lang.String.valueOf(
> 	at java.lang.StringBuilder.append(
> 	at
> 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(
> 	org.jboss.weld.bean.ContextualInstanceStrategy$DefaultContextualInstanceStrategy.getIfExists(
> 	org.jboss.weld.bean.ContextualInstance.getIfExists(
> 	org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(
> 	org.jboss.weld.bean.proxy.ProxyMethodHandler.getInstance(
> 	org.jboss.weld.util.Map$1302817811$Proxy$_$$_WeldClientProxy.toString(Unknown Source)
> 	java.lang.String.valueOf(
> 	java.lang.StringBuilder.append(

This message was sent by Atlassian JIRA

View raw message