commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Heger <>
Subject Re: Mutable BasicDynaBean Map
Date Mon, 22 Jun 2015 20:29:02 GMT

Am 22.06.2015 um 21:56 schrieb Ercan Canlıer:
> Hello,
> As i mentioned at the mail subject, i am having problem with not mutable
> map inside BasicDynaBean.
> As far as i know, it is the default behaviour of this map.
> What i would like to do is, simply retrieve the resultset from db which
> will create a list including DynaBeans.
> For viewing the database table, everything works fine, the problem occurs
> when i try to edit it and i get the following exception:
> Caused by: javax.el.PropertyNotWritableException
>     at javax.el.MapELResolver.setValue(
>     at
> com.sun.faces.el.DemuxCompositeELResolver._setValue(
>     at
> com.sun.faces.el.DemuxCompositeELResolver.setValue(
>     at com.sun.el.parser.AstValue.setValue(
>     at com.sun.el.ValueExpressionImpl.setValue(
>     at
> com.sun.faces.facelets.el.TagValueExpression.setValue(
>     ... 50 more

This stack trace does not contain a reference to Commons BeanUtils.
Also, the exception thrown is from the Java expression language (EL),
not from BeanUtils. It seems to me that there is already a problem in
your path expression before the DynaBean is actually hit.

I don't know EL well enough, but could it be the case that it simply
cannot handle dyna beans?


> I assume, this is because of the map inside dyna bean is not mutable.
> I think one option is to change the default behaviour of the map by editing
> the source code of BeanUtils library.
> On the other hand, i think the implementors of this library must have
> thought this functionality somehow...
> Below is the code snippet that i use for retrieving the result set as
> DynaBeans.
>         String query = "SELECT * FROM test.a";
>         Statement stmt = (Statement) con.createStatement();
>         ResultSet rs = stmt.executeQuery(query);
>         RowSetDynaClass rsdc = new RowSetDynaClass(rs);
>         rs.close();
>         stmt.close();
>         dynaObjectList= rsdc.getRows();
> I tried to use LazyDynaMap as well, editing the table worked fine but the
> Map didnt allow me to put multiple data since the key is not unique for
> other datasets.
> Because the key is the property name.
> I would be really appreciated if you suggest me hints.
> Thanks in advance.
> I am really looking forward to see the answers if possible.
> Best regards.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message