0

I have the following code in webflow:

<action-state id="blah">
   <evaluate result="flowScope.payPageProxyUrl" expression="payPageProxyUrl"/>

where payPageProxyUrl in the expression is defined as a spring bean:

<bean id="payPageProxyUrl" class="java.lang.String">
    <constructor-arg value="payPage/Request"/>
</bean>

it appears that most of the time through the flow flowScope.payPageProxyUrl is correctly set to "payPage/Request" however in some cases (other JVMs in a weblogic cluster) I get the exception below suggesting that the SpEL expression "payPageProxyUrl" is null. I suspect SpEL is not consistently accessing the bean but what are your thoughts and how can I protect against this without changing bean / flow scope names?

Here's the exception:

org.springframework.webflow.execution.ActionExecutionException: Exception thrown executing [AnnotatedAction@21634dc0 targetAction = [EvaluateAction@7e85895f expression = payPageProxyUrl, resultExpression = flowScope.payPageProxyUrl], attributes = map[[empty]]] in state 'blah' of flow 'blah-payment' -- action execution attributes were 'map[[empty]]'
    at org.springframework.webflow.execution.ActionExecutor.execute(ActionExecutor.java:60) ~[spring-webflow-2.3.1.RELEASE.jar:2.3.1.RELEASE]

...

Caused by: java.lang.NullPointerException: null
    at org.springframework.expression.spel.ast.PropertyOrFieldReference.getValueInternal(PropertyOrFieldReference.java:88) ~[spring-expression-3.2.6.RELEASE.jar:3.2.6.RELEASE]
gipinani
  • 14,038
  • 12
  • 56
  • 85

1 Answers1

0

Why do you want to go through the hassle of spring bean for String, evaluate, string constructor etc.,; you can just use set as:

    <action-state id="blah">
        <set name="flowScope.payPageProxyUrl" value="'payPage/Request'"/>
        ...
    </action-state> 
Prasad
  • 3,785
  • 2
  • 14
  • 23
  • Hi Prasad, I'd like to know why I get an inconsistent failure with my code and how to avoid it. Recoding may make the problem go away but I don't understand the problem at the moment. – user3738284 Jun 16 '14 at 08:26