Uploaded image for project: 'Commons BeanUtils'
  1. Commons BeanUtils
  2. BEANUTILS-23

Misleading error message in ConvertingWrapDynaBean

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.7.0
    • 1.8.0
    • None
    • None
    • Operating System: other
      Platform: All

    • 18811

    Description

      ConvertingWrapDynaBean.set(String,Object) swallows any throwable and rethrows a
      (sometimes) misleading IllegalArgumentException without revealing the initial
      cause.

      There should be more catch clauses in the method, possibly catching some
      reflection exceptions. Anyway, the initial cause should be printStackTrace()d
      or included in the IllegalArgumentException.

      I discovered this when I tried to set a property in a bean with jelly, and my
      set method throws an exception:

      java.lang.IllegalArgumentException: Property 'expr' has no write method
      at org.apache.commons.beanutils.ConvertingWrapDynaBean.set
      (ConvertingWrapDynaBean.java:116)
      at org.apache.commons.jelly.impl.TagScript.run(TagScript.java:275)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)
      at org.apache.commons.jelly.impl.DynamicTag.doTag(DynamicTag.java:113)
      at org.apache.commons.jelly.impl.StaticTagScript.run
      (StaticTagScript.java:151)
      at org.apache.commons.jelly.impl.ScriptBlock.run(ScriptBlock.java:135)

      (The setExpr(String) method is there allright, but it throws an exception if
      the input is bad.)

      Attachments

        Activity

          People

            Unassigned Unassigned
            aslak.hellesoy@netcom.no Aslak Helles√ły
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: