commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Graham <grahamdavid1...@yahoo.com>
Subject Re: [dbutils] ResultSetHandler difficulties
Date Fri, 05 Dec 2003 15:22:32 GMT
DbUtils can only create objects from classes with a default/no-arg
constructor.  LabelValueBean in Struts 1.1 does not have a default
constructor so you're seeing this error.  This has been fixed in the
Struts 1.2 development code for some time.

David

--- Joseph Prosser <jprosser@nocmanage.net> wrote:
> Hi,
> I'm trying to use the dbutils, in particular I'd like to populate 
> LabelValueBeans.  I'm using the example from the website, but I get the 
> following exception:
> Cannot create org.apache.struts.util.LabelValueBean: 
> org.apache.struts.util.LabelValueBean
> 
> I've tried individual LabelValueBeans and ArrayLists of them.
> 
> I've included the code and log snippets.  There is so little code here, 
> that I just can't imagine what the problem is.
> 
> Thanks!
> -Joe
> 
> 
>         QueryRunner run = new QueryRunner(ds);
> 
>          //ResultSetHandler rsh = new 
> BeanListHandler(LabelValueBean.class); 
> 
>          ResultSetHandler rsh = new BeanHandler(LabelValueBean.class);
> 
>          try {
> 
>              //list = (ArrayList) 
> run.query(sql,crit,rsh); 
> 
>              LabelValueBean lvb = (LabelValueBean)
> run.query(sql,crit,rsh);
> 
>              } catch (SQLException e) {
>                  log.error( "LV - resultset error with query: " + sql +
> " 
> with msg: " +  e.getMessage());
>                  e.printStackTrace();
>              } catch (Exception e) {
>                  log.error( "LV - resultset error with query: " + sql +
> " 
> with msg: " +  e.getMessage());
>                  e.printStackTrace();
>              }
>              if(loginfo==1){log.info("PV  leaving getLVList");}
>              return list;
> 
> 
> 
> [ERROR] NMISBean - -LV - resultset error with query: SELECT system_pk 
> value,name label from ts3_systems_t  WHERE office_fk=? and de
> leted<>'True' with msg: Cannot create 
> org.apache.struts.util.LabelValueBean: 
> org.apache.struts.util.LabelValueBean Query: SELECT sy
> stem_pk value,name label from ts3_systems_t  WHERE office_fk=? and 
> deleted<>'True' Parameters: [201223]
> java.sql.SQLException: Cannot create
> org.apache.struts.util.LabelValueBean: 
> org.apache.struts.util.LabelValueBean Query: SELECT sys
> tem_pk value,name label from ts3_systems_t  WHERE office_fk=? and 
> deleted<>'True' Parameters: [201223]
>          at 
> org.apache.commons.dbutils.QueryRunner.rethrow(QueryRunner.java:330)
>          at
> org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:213)
>          at
> org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:279)
>          at
> org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:255)
>          at 
> net.nocmanage.coreserver.beans.NMISBean.getLVList(NMISBean.java:3056)
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 


__________________________________
Do you Yahoo!?
Free Pop-Up Blocker - Get it now
http://companion.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message