Announcement Announcement Module
No announcement yet.
Bug in sellitem webapp in PR3? Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Bug in sellitem webapp in PR3?

    I'm getting the following error when trying the sellitem app in PR3:

    500 Servlet Exception
    org.springframework.beans.NotReadablePropertyException: Invalid property
    '' of bean class [org.springframework.web.flow.execution.impl.StateContextImpl]:
    Bean property '' is not readable or has an invalid getter
    method: Does the return type of the getter match the parameter type of
    the setter?
    	at org.springframework.beans.BeanWrapperImpl.getPropertyValue(
    	at org.springframework.beans.BeanWrapperImpl.getNestedBeanWrapper(
    	at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(
    	at org.springframework.beans.BeanWrapperImpl.getBeanWrapperForPropertyPath(
    	at org.springframework.beans.BeanWrapperImpl.getPropertyValue(
    	at org.springframework.web.flow.config.TextToTransitionCriteria$ExpressionTransitionCriteria.test(
    	at org.springframework.web.flow.Transition.matches(
    	at org.springframework.web.flow.TransitionableState.getTransition(
    	at org.springframework.web.flow.TransitionableState.getRequiredTransition(
    	at org.springframework.web.flow.DecisionState.doEnter(
    	at org.springframework.web.flow.State.enter(
    	at org.springframework.web.flow.Transition.execute(
    	at org.springframework.web.flow.TransitionableState.onEvent(
    	at org.springframework.web.flow.execution.impl.FlowExecutionImpl.signalEvent(
    Is this a known problem, or is it my configuration? I'm using Spring 1.2

  • #2
    The problem is that you don't have the ognl.jar in the WEB-INF/lib of the sellitem.war. As a result the ExpressionParserUtils will use the BeanWrapperExpressionParser instead of the OgnlExpressionParser and ${} is obviously an OGNL expression and not a bean property path.

    Just putting ognl.jar ( in WEB-INF/lib should fix the problem. How did you build the sellitem.war?



    • #3
      Thanks, I'm bulding using build.bat. I fixed the locations for the jar files in the file and it included the jars in the built war, tested and it worked.

      thanks for explaining the problem


      • #4
        It is the same in TSS article:

        <subflow-state id="enterPassengerInformation" flow="passenger">

        <input value="${}" as="passengerId"/>
        <transition on="finish" to="displayReservationVerification"/>

        This wouldn't work in environment without OGNL.

        Although Scope implements Map, Spring's BeanWrapperImpl doesn't know where to get passanger property. It looks for a getter/setter and not into the map.

        Map map = new HashMap();
        map.put("passanger", "Ales");
        try {
        Object value = null;
        //value = Ognl.getValue("passanger", new HashMap(), map);
        value = new BeanWrapperImpl(map).getPropertyValue("passanger") ;
        System.out.println("value = " + value);
        } catch (Exception e) {

        org.springframework.beans.NotReadablePropertyExcep tion: Invalid property 'passanger' of bean class [java.util.HashMap]: Bean property 'passanger' is not readable or has an invalid getter method: Does the return type of the getter match the parameter type of the setter?
        at org.springframework.beans.BeanWrapperImpl.getPrope rtyValue(
        at org.springframework.beans.BeanWrapperImpl.getPrope rtyValue(
        at Test.main(

        So it is necessary to point out that you need OGNL in order this to work. Since BeanWrapper's ExpressionEvaluator implementation is insufficient here - and this should be mentioned.

        But it would be good if this wouldn't totaly depend on ONGL. With Spring already very powerful, it's probably not a big deal to put something similar (treating Map similar as JavaBean) in it.

        Rgds, Ales


        • #5
          You are correct in saying that you need OGNL for that to work, we should get that clarified in the article.

          Regarding making BeanWrapper more powerfull so that it can handle things like a map, I suggest you post a request for enhancement on the Spring JIRA issue tracker.