1 Reply Latest reply on Nov 24, 2011 5:11 AM by aogier

    NumberFormatException on EL #{bean.list.size()}?

    kwutzke

      I'm doing the exact same as described here

       

      http://community.jboss.org/thread/164602

       

      and here

       

      http://community.jboss.org/thread/164670

       

      Did I miss the correct answer there? I'm experiencing the very same, but why is this happening on all versions of JBoss AS 7, that is 7.0.0, 7.0.1, and 7.0.2???

       

      Karsten

       

      PS: I know I could use JSTL or an extra bean method...

        • 1. Re: NumberFormatException on EL #{bean.list.size()}?
          aogier

          Hi !


          I've got the exact same strange error...

          {noformat}

          10:59:59,607 GRAVE [javax.enterprise.resource.webcontainer.jsf.application] (http--127.0.0.1-8080-5) Error Rendering View[/pages/administration/userSearch.xhtml]: java.lang.NumberFormatException: For input string: "size"

                    at java.lang.NumberFormatException.forInputString(NumberFormatException.java:48) [:1.6.0_26]

                    at java.lang.Integer.parseInt(Integer.java:449) [:1.6.0_26]

                    at java.lang.Integer.parseInt(Integer.java:499) [:1.6.0_26]

                    at javax.el.ListELResolver.toInteger(ListELResolver.java:407) [jboss-el-api_2.2_spec-1.0.0.Final.jar:1.0.0.Final]

                    at javax.el.ListELResolver.getValue(ListELResolver.java:199) [jboss-el-api_2.2_spec-1.0.0.Final.jar:1.0.0.Final]

                    at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175) [jboss-el-api_2.2_spec-1.0.0.Final.jar:1.0.0.Final]

                    at org.apache.el.parser.AstValue.getValue(AstValue.java:134) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                    at org.apache.el.parser.AstDeferredExpression.getValue(AstDeferredExpression.java:42) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                    at org.apache.el.parser.AstCompositeExpression.getValue(AstCompositeExpression.java:48) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                    at org.apache.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:187) [jbossweb-7.0.1.Final.jar:7.0.2.Final]

                    at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:55) [weld-core-1.1.2.Final.jar:2011-07-26 15:02]

                    at org.jboss.solder.el.Expressions.evaluateValueExpression(Expressions.java:134) [solder-impl-3.1.0.Beta3.jar:]

                    at org.jboss.solder.el.Expressions.evaluateValueExpression(Expressions.java:171) [solder-impl-3.1.0.Beta3.jar:]

          {noformat}

          Here is the code which throws this error :

          {code}@Inject Expressions expressions

          List<String> list = new ArrayList<String>();

          {

               list.add("item 1");

          }

          public String getValue() {

               return expressions.evaluateValueExpression("Size of list : #{list.size()}");

          }

          @Produces @Named("list")

          public List<String> getList() {

               return list;

          }{code}