You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Mack Paul <mp...@yahoo.com> on 2006/03/26 10:09:05 UTC

Could not set property 'reporta' for dominio.Empleado

Hello mail Listers:
   
  i have a little problem with the xml file ordenSqlMap.
  For example, in the resultMap of id "result", if the property empleado.reporta is in the first place:
/*******
 <resultMap class="dominio.Orden" id="result">
  <result property="empleado.reporta" column="EReportsTo" jdbcType="INTEGER" javaType="int" />
  <result property="id" column="OOrderID" />
    <!--
  <result property="empleado" resultMap="empleadoSqlMap.result" />
  -->
    <result property="empleado.id" column="EEmployeeID" />
  ....
********/
This dont generate problems,
But, if the property empleado.reporta is in or below of property empleado.id, this generate an error:
/**********
  <result property="id" column="OOrderID" />
    <!--
  <result property="empleado" resultMap="empleadoSqlMap.result" />
  -->
    <result property="empleado.id" column="EEmployeeID" />
  <result property="empleado.reporta" column="EReportsTo" jdbcType="INTEGER" javaType="int" />
  ....
  **********/
......E..
Time: 0,531
There was 1 error:
1) testGetOrdenSearch(test.dos)com.ibatis.dao.client.DaoException: Failed to queryForList - id [ordenSqlMap.getOrdenList], parameterObject [{cliente_id=BLONP}].  Cause: com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in persistencia/sql/ordenSqlMap.xml.  
--- The error occurred while applying a result map.  
--- Check the ordenSqlMap.result.  
--- The error happened while setting a property on the result object.  
--- Cause: com.ibatis.common.beans.ProbeException: Could not set property 'reporta' for dominio.Empleado.  Cause: java.lang.IllegalArgumentException
Caused by: java.lang.IllegalArgumentException
Caused by: com.ibatis.common.beans.ProbeException: Could not set property 'reporta' for dominio.Empleado.  Cause: java.lang.IllegalArgumentException
Caused by: java.lang.IllegalArgumentException
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in persistencia/sql/ordenSqlMap.xml.  
--- The error occurred while applying a result map.  
--- Check the ordenSqlMap.result.  
--- The error happened while setting a property on the result object.  
--- Cause: com.ibatis.common.beans.ProbeException: Could not set property 'reporta' for dominio.Empleado.  Cause: java.lang.IllegalArgumentException
Caused by: java.lang.IllegalArgumentException
Caused by: com.ibatis.common.beans.ProbeException: Could not set property 'reporta' for dominio.Empleado.  Cause: java.lang.IllegalArgumentException
Caused by: java.lang.IllegalArgumentException
 at com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForList(SqlMapDaoTemplate.java:205)
 at persistencia.imp.OrdenImpDao.getOrdenSearch(OrdenImpDao.java:47)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at com.ibatis.dao.engine.impl.DaoProxy.invoke(DaoProxy.java:72)
 at $Proxy1.getOrdenSearch(Unknown Source)
 at test.dos.testGetOrdenSearch(dos.java:70)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
 at test.dos.main(dos.java:17)
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException:   
--- The error occurred in persistencia/sql/ordenSqlMap.xml.  
--- The error occurred while applying a result map.  
--- Check the ordenSqlMap.result.  
--- The error happened while setting a property on the result object.  
--- Cause: com.ibatis.common.beans.ProbeException: Could not set property 'reporta' for dominio.Empleado.  Cause: java.lang.IllegalArgumentException
Caused by: java.lang.IllegalArgumentException
Caused by: com.ibatis.common.beans.ProbeException: Could not set property 'reporta' for dominio.Empleado.  Cause: java.lang.IllegalArgumentException
Caused by: java.lang.IllegalArgumentException
 at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:188)
 at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryForList(GeneralStatement.java:123)
 at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:610)
 at com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:584)
 at com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:101)
 at com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:78)
 at com.ibatis.dao.client.template.SqlMapDaoTemplate.queryForList(SqlMapDaoTemplate.java:203)
 ... 25 more
  *************/
  Too i am attach the log of ibatis:
The first case is successful, but the second case is an error.
  DEBUG - Created connection 26171428.
DEBUG - {conn-100000} Connection
DEBUG - {pstm-100001} PreparedStatement:    SELECT     O.OrderID as OOrderID,     O.OrderDate as OOrderDate,     O.RequiredDate as ORequiredDate,     O.ShippedDate as OShippedDate,     O.Freight as OFreight,     O.ShipName as OShipName,     O.ShipAddress as OShipAddress,     O.ShipCity as OShipCity,     O.ShipRegion as OShipRegion,     O.ShipPostalCode as OShipPostalCode,     O.ShipCountry as OShipCountry,         C.CustomerID as CCustomerID,     C.CompanyName as CCompanyName,     C.ContactName as CContactName,     C.ContactTitle as CContactTitle,     C.Address as CAddress,     C.City as CCity,     C.Region as CRegion,     C.PostalCode as CPostalCode,     C.Country as CCountry,     C.Phone as CPhone,     C.Fax as CFax,      E.EmployeeID as EEmployeeID,     E.LastName as ELastName,     E.FirstName as EFirstName,     E.Title as ETitle,     E.TitleOfCourtesy as ETitleOfCourtesy,     E.BirthDate as EBirthDate,     E.HireDate as EHireDate,     E.Address as EAddress,     E.City as 
 ECity,  
   E.Region as ERegion,     E.PostalCode as EPostalCode,     E.Country as ECountry,     E.HomePhone as EHomePhone,     E.Extension as EExtension,     E.Photo as EPhoto,     E.Notes as ENotes,     E.ReportsTo as EReportsTo,          S.ShipperID as SShipperID,     S.CompanyName as SCompanyName,     S.Phone as SPhone    FROM     Orders O, Customers C, Employees E, Shippers S    WHERE     O.CustomerID=C.CustomerID AND     O.EmployeeID=E.EmployeeID AND     O.ShipVia=S.ShipperID      AND    C.CustomerID=?     
DEBUG - {pstm-100001} Parameters: [BLONP]
DEBUG - {pstm-100001} Types: [java.lang.String]
DEBUG - {rset-100002} ResultSet
DEBUG - {rset-100002} Header: [EReportsTo, OOrderID, EEmployeeID, EFirstName, ELastName, ETitle, ETitleOfCourtesy, EBirthDate, EHireDate, EAddress, ECity, ERegion, EPostalCode, ECountry, EHomePhone, EExtension, EPhoto, ENotes, CCustomerID, CCompanyName, CContactName, CContactTitle, CAddress, CCity, CRegion, CPostalCode, CCountry, CPhone, CFax, OOrderDate, ORequiredDate, OShippedDate, SShipperID, SCompanyName, SPhone, OFreight, OShipName, OShipAddress, OShipCity, OShipRegion, OShipPostalCode, OShipCountry]
DEBUG - {rset-100002} Result: [0, 10265, 2, Andrew, Fuller, Vice President, Sales, Dr., 1952-02-19 00:00:00.0, 1992-08-14 00:00:00.0, 908 W. Capital Way, Tacoma, WA, 98401, USA, (206) 555-9482, 3457, [B@1fe1feb, Andrew received his BTS commercial in 1974 and a Ph.D. in international marketing from the University of Dallas in 1981.  He is fluent in French and Italian and reads German.  He joined the company as a sales representative, was promoted to sales manager in January 1992 and to vice president of sales in March 1993.  Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association., BLONP, Blondel père et fils, Frédérique Citeaux, Marketing Manager, 24, place Kléber, Strasbourg, null, 67000, France, 88.60.15.31, 88.60.15.32, 1994-08-25 00:00:00.0, 1994-09-22 00:00:00.0, 1994-09-12 00:00:00.0, 1, Speedy Express, (503) 555-9831, 55.28, Blondel père et fils, 24, place Kléber, Strasbourg, null, 67000, France]
DEBUG - {rset-100002} Result: [2, 10297, 5, Steven, Buchanan, Sales Manager, Mr., 1955-03-04 00:00:00.0, 1993-10-17 00:00:00.0, 14 Garrett Hill, London, null, SW1 8JR, UK, (71) 555-4848, 3453, [B@f8f7db, Steven Buchanan graduated from St. Andrews University, Scotland, with a BSC degree in 1976.  Upon joining the company as a sales representative in 1992, he spent 6 months in an orientation program at the Seattle office and then returned to his permanent post in London.  He was promoted to sales manager in March 1993.  Mr. Buchanan has completed the courses "Successful Telemarketing" and "International Sales Management."  He is fluent in French., BLONP, Blondel père et fils, Frédérique Citeaux, Marketing Manager, 24, place Kléber, Strasbourg, null, 67000, France, 88.60.15.31, 88.60.15.32, 1994-10-05 00:00:00.0, 1994-11-16 00:00:00.0, 1994-10-11 00:00:00.0, 2, United Package, (503) 555-3199, 5.74, Blondel père et fils, 24, place Kléber, Strasbourg, null, 67000, France]
DEBUG - {rset-100002} Result: [2, 10360, 4, Margaret, Peacock, Sales Representative, Mrs., 1937-09-19 00:00:00.0, 1993-05-03 00:00:00.0, 4110 Old Redmond Rd., Redmond, WA, 98052, USA, (206) 555-8122, 5176, [B@15856a5, Margaret holds a BA in English literature from Concordia College (1958) and an MA from the American Institute of Culinary Arts (1966).  She was assigned to the London office temporarily from July through November 1992., BLONP, Blondel père et fils, Frédérique Citeaux, Marketing Manager, 24, place Kléber, Strasbourg, null, 67000, France, 88.60.15.31, 88.60.15.32, 1994-12-23 00:00:00.0, 1995-01-20 00:00:00.0, 1995-01-02 00:00:00.0, 3, Federal Shipping, (503) 555-9931, 131.7, Blondel père et fils, 24, place Kléber, Strasbourg, null, 67000, France]
DEBUG - {rset-100002} Result: [2, 10436, 3, Janet, Leverling, Sales Representative, Ms., 1963-08-30 00:00:00.0, 1992-04-01 00:00:00.0, 722 Moss Bay Blvd., Kirkland, WA, 98033, USA, (206) 555-3412, 3355, [B@1bbd23f, Janet has a BS degree in chemistry from Boston College (1984).  She has also completed a certificate program in food retailing management.  Janet was hired as a sales associate in 1991 and promoted to sales representative in February 1992., BLONP, Blondel père et fils, Frédérique Citeaux, Marketing Manager, 24, place Kléber, Strasbourg, null, 67000, France, 88.60.15.31, 88.60.15.32, 1995-03-08 00:00:00.0, 1995-04-05 00:00:00.0, 1995-03-14 00:00:00.0, 2, United Package, (503) 555-3199, 156.66, Blondel père et fils, 24, place Kléber, Strasbourg, null, 67000, France]
DEBUG - {rset-100002} Result: [2, 10449, 3, Janet, Leverling, Sales Representative, Ms., 1963-08-30 00:00:00.0, 1992-04-01 00:00:00.0, 722 Moss Bay Blvd., Kirkland, WA, 98033, USA, (206) 555-3412, 3355, [B@1e845c2, Janet has a BS degree in chemistry from Boston College (1984).  She has also completed a certificate program in food retailing management.  Janet was hired as a sales associate in 1991 and promoted to sales representative in February 1992., BLONP, Blondel père et fils, Frédérique Citeaux, Marketing Manager, 24, place Kléber, Strasbourg, null, 67000, France, 88.60.15.31, 88.60.15.32, 1995-03-21 00:00:00.0, 1995-04-18 00:00:00.0, 1995-03-30 00:00:00.0, 2, United Package, (503) 555-3199, 53.3, Blondel père et fils, 24, place Kléber, Strasbourg, null, 67000, France]
DEBUG - {rset-100002} Result: [5, 10559, 6, Michael, Suyama, Sales Representative, Mr., 1963-07-02 00:00:00.0, 1993-10-17 00:00:00.0, Coventry House
Miner Rd., London, null, EC2 7JR, UK, (71) 555-7773, 428, [B@186df0f, Michael is a graduate of Sussex University (MA, economics, 1983) and the University of California at Los Angeles (MBA, marketing, 1986).  He has also taken the courses "Multi-Cultural Selling" and "Time Management for the Sales Professional."  He is fluent in Japanese and can read and write French, Portuguese, and Spanish., BLONP, Blondel père et fils, Frédérique Citeaux, Marketing Manager, 24, place Kléber, Strasbourg, null, 67000, France, 88.60.15.31, 88.60.15.32, 1995-07-06 00:00:00.0, 1995-08-03 00:00:00.0, 1995-07-14 00:00:00.0, 1, Speedy Express, (503) 555-9831, 8.05, Blondel père et fils, 24, place Kléber, Strasbourg, null, 67000, France]
DEBUG - {rset-100002} Result: [5, 10566, 9, Anne, Dodsworth, Sales Representative, Ms., 1966-01-27 00:00:00.0, 1994-11-15 00:00:00.0, 7 Houndstooth Rd., London, null, WG2 7LT, UK, (71) 555-4444, 452, [B@c44b88, Anne has a BA degree in English from St. Lawrence College.  She is fluent in French and German., BLONP, Blondel père et fils, Frédérique Citeaux, Marketing Manager, 24, place Kléber, Strasbourg, null, 67000, France, 88.60.15.31, 88.60.15.32, 1995-07-13 00:00:00.0, 1995-08-10 00:00:00.0, 1995-07-19 00:00:00.0, 1, Speedy Express, (503) 555-9831, 88.4, Blondel père et fils, 24, place Kléber, Strasbourg, null, 67000, France]
DEBUG - {rset-100002} Result: [2, 10584, 4, Margaret, Peacock, Sales Representative, Mrs., 1937-09-19 00:00:00.0, 1993-05-03 00:00:00.0, 4110 Old Redmond Rd., Redmond, WA, 98052, USA, (206) 555-8122, 5176, [B@13ad33d, Margaret holds a BA in English literature from Concordia College (1958) and an MA from the American Institute of Culinary Arts (1966).  She was assigned to the London office temporarily from July through November 1992., BLONP, Blondel père et fils, Frédérique Citeaux, Marketing Manager, 24, place Kléber, Strasbourg, null, 67000, France, 88.60.15.31, 88.60.15.32, 1995-07-31 00:00:00.0, 1995-08-28 00:00:00.0, 1995-08-04 00:00:00.0, 1, Speedy Express, (503) 555-9831, 59.14, Blondel père et fils, 24, place Kléber, Strasbourg, null, 67000, France]
DEBUG - {rset-100002} Result: [2, 10628, 4, Margaret, Peacock, Sales Representative, Mrs., 1937-09-19 00:00:00.0, 1993-05-03 00:00:00.0, 4110 Old Redmond Rd., Redmond, WA, 98052, USA, (206) 555-8122, 5176, [B@102799c, Margaret holds a BA in English literature from Concordia College (1958) and an MA from the American Institute of Culinary Arts (1966).  She was assigned to the London office temporarily from July through November 1992., BLONP, Blondel père et fils, Frédérique Citeaux, Marketing Manager, 24, place Kléber, Strasbourg, null, 67000, France, 88.60.15.31, 88.60.15.32, 1995-09-12 00:00:00.0, 1995-10-10 00:00:00.0, 1995-09-20 00:00:00.0, 3, Federal Shipping, (503) 555-9931, 30.36, Blondel père et fils, 24, place Kléber, Strasbourg, null, 67000, France]
DEBUG - {rset-100002} Result: [2, 10679, 8, Laura, Callahan, Inside Sales Coordinator, Ms., 1958-01-09 00:00:00.0, 1994-03-05 00:00:00.0, 4726 - 11th Ave. N.E., Seattle, WA, 98105, USA, (206) 555-1189, 2344, [B@7109c4, Laura received a BA in psychology from the University of Washington.  She has also completed a course in business French.  She reads and writes French., BLONP, Blondel père et fils, Frédérique Citeaux, Marketing Manager, 24, place Kléber, Strasbourg, null, 67000, France, 88.60.15.31, 88.60.15.32, 1995-10-24 00:00:00.0, 1995-11-21 00:00:00.0, 1995-10-31 00:00:00.0, 3, Federal Shipping, (503) 555-9931, 27.94, Blondel père et fils, 24, place Kléber, Strasbourg, null, 67000, France]
DEBUG - {rset-100002} Result: [5, 10826, 6, Michael, Suyama, Sales Representative, Mr., 1963-07-02 00:00:00.0, 1993-10-17 00:00:00.0, Coventry House
Miner Rd., London, null, EC2 7JR, UK, (71) 555-7773, 428, [B@1385660, Michael is a graduate of Sussex University (MA, economics, 1983) and the University of California at Los Angeles (MBA, marketing, 1986).  He has also taken the courses "Multi-Cultural Selling" and "Time Management for the Sales Professional."  He is fluent in Japanese and can read and write French, Portuguese, and Spanish., BLONP, Blondel père et fils, Frédérique Citeaux, Marketing Manager, 24, place Kléber, Strasbourg, null, 67000, France, 88.60.15.31, 88.60.15.32, 1996-02-12 00:00:00.0, 1996-03-11 00:00:00.0, 1996-03-08 00:00:00.0, 1, Speedy Express, (503) 555-9831, 7.09, Blondel père et fils, 24, place Kléber, Strasbourg, null, 67000, France]
DEBUG - Returned connection 26171428 to pool.
DEBUG - Created connection 26171428.
DEBUG - {conn-100000} Connection
DEBUG - {pstm-100001} PreparedStatement:    SELECT     O.OrderID as OOrderID,     O.OrderDate as OOrderDate,     O.RequiredDate as ORequiredDate,     O.ShippedDate as OShippedDate,     O.Freight as OFreight,     O.ShipName as OShipName,     O.ShipAddress as OShipAddress,     O.ShipCity as OShipCity,     O.ShipRegion as OShipRegion,     O.ShipPostalCode as OShipPostalCode,     O.ShipCountry as OShipCountry,         C.CustomerID as CCustomerID,     C.CompanyName as CCompanyName,     C.ContactName as CContactName,     C.ContactTitle as CContactTitle,     C.Address as CAddress,     C.City as CCity,     C.Region as CRegion,     C.PostalCode as CPostalCode,     C.Country as CCountry,     C.Phone as CPhone,     C.Fax as CFax,      E.EmployeeID as EEmployeeID,     E.LastName as ELastName,     E.FirstName as EFirstName,     E.Title as ETitle,     E.TitleOfCourtesy as ETitleOfCourtesy,     E.BirthDate as EBirthDate,     E.HireDate as EHireDate,     E.Address as EAddress,     E.City as 
 ECity,  
   E.Region as ERegion,     E.PostalCode as EPostalCode,     E.Country as ECountry,     E.HomePhone as EHomePhone,     E.Extension as EExtension,     E.Photo as EPhoto,     E.Notes as ENotes,     E.ReportsTo as EReportsTo,          S.ShipperID as SShipperID,     S.CompanyName as SCompanyName,     S.Phone as SPhone    FROM     Orders O, Customers C, Employees E, Shippers S    WHERE     O.CustomerID=C.CustomerID AND     O.EmployeeID=E.EmployeeID AND     O.ShipVia=S.ShipperID      AND    C.CustomerID=?     
DEBUG - {pstm-100001} Parameters: [BLONP]
DEBUG - {pstm-100001} Types: [java.lang.String]
DEBUG - {rset-100002} ResultSet
DEBUG - {rset-100002} Header: [OOrderID, EEmployeeID, EReportsTo, EFirstName, ELastName, ETitle, ETitleOfCourtesy, EBirthDate, EHireDate, EAddress, ECity, ERegion, EPostalCode, ECountry, EHomePhone, EExtension, EPhoto, ENotes, CCustomerID, CCompanyName, CContactName, CContactTitle, CAddress, CCity, CRegion, CPostalCode, CCountry, CPhone, CFax, OOrderDate, ORequiredDate, OShippedDate, SShipperID, SCompanyName, SPhone, OFreight, OShipName, OShipAddress, OShipCity, OShipRegion, OShipPostalCode, OShipCountry]
DEBUG - {rset-100002} Result: [10265, 2, 0, Andrew, Fuller, Vice President, Sales, Dr., 1952-02-19 00:00:00.0, 1992-08-14 00:00:00.0, 908 W. Capital Way, Tacoma, WA, 98401, USA, (206) 555-9482, 3457, [B@16f0be8, Andrew received his BTS commercial in 1974 and a Ph.D. in international marketing from the University of Dallas in 1981.  He is fluent in French and Italian and reads German.  He joined the company as a sales representative, was promoted to sales manager in January 1992 and to vice president of sales in March 1993.  Andrew is a member of the Sales Management Roundtable, the Seattle Chamber of Commerce, and the Pacific Rim Importers Association., BLONP, Blondel père et fils, Frédérique Citeaux, Marketing Manager, 24, place Kléber, Strasbourg, null, 67000, France, 88.60.15.31, 88.60.15.32, 1994-08-25 00:00:00.0, 1994-09-22 00:00:00.0, 1994-09-12 00:00:00.0, 1, Speedy Express, (503) 555-9831, 55.28, Blondel père et fils, 24, place Kléber, Strasbourg, null, 67000, France]
DEBUG - Returned connection 26171428 to pool.
  
*********************/
  My app is very light, and use a ms access database with odbc conecction.
  I am attaching my app too.
  the release of the ibatis is   2.1.6 - Nov 5, 2005

   
  Greetings. i am sorry for my poor english.

		
---------------------------------

LLama Gratis a cualquier PC del Mundo.
Llamadas a fijos y móviles desde 1 céntimo por minuto.
http://es.voice.yahoo.com

acess Resultset meta data in RowHandler handleRow() method?

Posted by sadasiva lingala <sa...@yahoo.com>.
Hi
    Is there a way to access JDBC Resultset metadata within RowHandler handleRow() method?
   
  Thanks