Return-Path: Delivered-To: apmail-jakarta-commons-user-archive@www.apache.org Received: (qmail 32562 invoked from network); 14 Jul 2006 22:20:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Jul 2006 22:20:03 -0000 Received: (qmail 69529 invoked by uid 500); 14 Jul 2006 22:19:59 -0000 Delivered-To: apmail-jakarta-commons-user-archive@jakarta.apache.org Received: (qmail 69461 invoked by uid 500); 14 Jul 2006 22:19:59 -0000 Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Jakarta Commons Users List" Reply-To: "Jakarta Commons Users List" Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 69450 invoked by uid 99); 14 Jul 2006 22:19:59 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jul 2006 15:19:59 -0700 X-ASF-Spam-Status: No, hits=1.0 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [162.115.227.109] (HELO mercury.verizonwireless.com) (162.115.227.109) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jul 2006 15:19:58 -0700 DomainKey-Signature: s=privmail; d=verizonwireless.com; c=nofws; q=dns; b=2BA2rvr4sk/uMPwkVfrdYyBLaWTvDyEAhHPmRrVilQopzUSHjErglaapYaRuJ9ppSjICWhC3N/Dx/zUwJTkCZizp5sQtU5m/z6w5+2DI8mMiE8srdLuItGtIdJmQ5uKs; Received: from nyobgcexsmtp20.uswin.ad.vzwcorp.com ([10.170.160.40]) by mercury.verizonwireless.com with ESMTP; 14 Jul 2006 18:19:37 -0400 From: Tripurari.Sharma@VerizonWireless.com X-Host: redstone.odc.vzwcorp.com Received: from NYOBGCEXMB21.uswin.ad.vzwcorp.com ([10.170.26.82]) by nyobgcexsmtp20.uswin.ad.vzwcorp.com with Microsoft SMTPSVC(6.0.3790.1830); Fri, 14 Jul 2006 18:19:37 -0400 X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C6A793.97649E5F" Subject: BeanUtils problem Date: Fri, 14 Jul 2006 18:19:36 -0400 X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: BeanUtils problem Thread-Index: Acank5dvV5QO6TcxQhm5por0OYTlNw== To: X-OriginalArrivalTime: 14 Jul 2006 22:19:37.0182 (UTC) FILETIME=[979567E0:01C6A793] X-Virus-Checked: Checked by ClamAV on apache.org Message-Id: <20060714221958.7CDC410FB001@asf.osuosl.org> X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------_=_NextPart_001_01C6A793.97649E5F Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable i have two beans: 1:=20 class Zoo { =09 private String firstName =3D "Zoo1"; public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName =3D firstName; } } 2:=20 class Pojo { =09 private String firstName =3D "Pojo1"; public String getFirstName() { return firstName; } public void setFirstName(String firstName) { this.firstName =3D firstName; } } and engine class is: import org.apache.commons.beanutils.BeanUtils; public class ZipcodeLookup { =09 public static void main(String[] args){ =09 Pojo p =3D new Pojo(); Zoo z =3D new Zoo(); try { BeanUtils.copyProperties(z, p); String ss =3D new String("ssss"); BeanUtils.setProperty(z, "firstName", ss); } catch (Exception e) { System.out.println("ex... "+e.toString()); } System.out.println("Zip: "+z.getFirstName()); System.out.println("Pojo: "+p.getFirstName()); } =09 } when it executes this line: BeanUtils.copyProperties(z, p); it does noting, its not copying the properties to z, and when it executes this line String ss =3D new String("ssss"); BeanUtils.setProperty(z, "firstName", ss); it dies by saying java.lang.reflect.InvocationTargetException: Cannot set f= irstName see log:=20 [20060714 17:46:23] DEBUG BeanUtils : BeanUtils.copyProperties(Zoo@116ab4e,= Pojo@148aa23) [20060714 17:46:23] DEBUG BeanUtils : setProperty(Zoo@116ab4e, firstName,= ssss) [20060714 17:46:23] DEBUG ConvertUtils : Convert string 'ssss' to class 'ja= va.lang.String' [20060714 17:46:23] DEBUG ConvertUtils : Using converter org.apache.commo= ns.beanutils.converters.StringConverter@bb7465 ex... java.lang.reflect.InvocationTargetException: Cannot set firstName Zip: Zoo1 Pojo: Pojo1 what is the problem, i try injecting data using reflection that works, why = its not? The information contained in this message and any attachment may be proprietary, confidential, and privileged or subject to the work product doctrine and thus protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify me immediately by replying to this message and deleting it and all copies and backups thereof. Thank you. ------_=_NextPart_001_01C6A793.97649E5F--