Return-Path: Mailing-List: contact commons-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list commons-user@jakarta.apache.org Received: (qmail 68330 invoked from network); 28 Aug 2003 19:19:16 -0000 Received: from unknown (HELO smtp-out3.blueyonder.co.uk) (195.188.213.6) by daedalus.apache.org with SMTP; 28 Aug 2003 19:19:16 -0000 Received: from localhost ([82.38.66.131]) by smtp-out3.blueyonder.co.uk with Microsoft SMTPSVC(5.0.2195.5600); Thu, 28 Aug 2003 20:16:33 +0100 Date: Thu, 28 Aug 2003 20:18:33 +0100 Subject: =?ISO-8859-1?Q?Re:_R=E9f._:_AW:_[digester]_interface_and_setter?= Content-Type: text/plain; charset=ISO-8859-1; format=flowed Mime-Version: 1.0 (Apple Message framework v482) From: robert burrell donkin To: "Jakarta Commons Users List" Content-Transfer-Encoding: quoted-printable In-Reply-To: Message-Id: <6AA1FD9D-D98C-11D7-BB2B-003065DC754C@blueyonder.co.uk> X-Mailer: Apple Mail (2.482) X-OriginalArrivalTime: 28 Aug 2003 19:16:33.0570 (UTC) FILETIME=[E4AFF820:01C36D98] X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N i suggest that you check that the parameter type matches exactly the=20 method call signature: the CallMethodRule is very particular about the=20= type parameter. - robert On Thursday, August 28, 2003, at 11:16 AM, = Nicolas.CHALUMEAU@arsoe-trelaze. com wrote: > I try your solution but I still have the same error > "java.lang.NoSuchMethodException: No such accessible method:..." > With : > Class [] params =3D {com.arso.trelaze.socle.persistance.Reader.class}; > digester.addCallMethod( "acces/reader", "setReader", 1, params ); > digester.addCallParam( "acces/reader", 0, true ); > > The error occurs even if I specify our not the params kind. > > At the moment I found an alternative which work. I use > digester.addSetNext( "acces/reader", "setReader" ); rather than an > addCallMethod . It is a fonctionnal solution but not really elegant. > > So if some one have a better way ... > > Nicolas > > > > > > "Carsten Kaiser" > 28/08/2003 11:34 > Veuillez r=E9pondre =E0 "Jakarta Commons Users List" > > > Pour : "Jakarta Commons Users List" = org> > cc : > Objet : AW: [digester] interface and setter > > > So I think the problem is, that the CallMethod rule does not expect = any > parameters > since you have specified: > 1. no parameters > 2. there is no body text to retrieve the parameter value = from > > I guess it will help, if you specify > > 1. digester.addCallMethod("access/reader", "setReader", 1); > 2. digester.addCallParam("access/reader", 0, true); > > so that your RWClass instance will be taken from the stack to tell the > call method rule to invoke setReader(RWClass) respectively > setReader(Object) > later on. > > Hope this solves your problem!!! > > Regards, > CK > > > > -----Urspr=FCngliche Nachricht----- > Von: Nicolas.CHALUMEAU@arsoe-trelaze.com > [mailto:Nicolas.CHALUMEAU@arsoe-trelaze.com] > Gesendet: Do 28.08.2003 10:46 > An: Jakarta Commons Users List > Cc: > Betreff: [digester] interface and setter > > > > I have a class that have 2 private attributes Reader = and > Writer who define > getter and setter methodes > > I use an factory to instanciate attributes class. I > define it like this : > > > classe=3D"com.arso.trelaze.socle.persistance.RWClass"/> > classe=3D"com.arso.trelaze.socle.persistance.RWClass"/> > > > I call factories for the reader and writer to = instanciate > the good class : > > digester.addFactoryCreate( "acces/reader", > "com.arso.trelaze.socle.persistance.ReaderFactory" ); > > It works perfect I get an RWClass who implement both = the > reader interface > and the writer interface. > But when I try to call the setter void = setReader(Reader > reader) with the > rule : > digester.addCallMethod( "acces/reader", "setReader", = 0 ) > ; > I had the following error : > > java.lang.NoSuchMethodException: No such accessible > method: setReader() on > object: com.arso.trelaze.socle.persistance.RWClass > at > > = org.apache.commons.digester.Digester.createSAXException(Digester.java:2383= ) > at > > = org.apache.commons.digester.Digester.createSAXException(Digester.java:2409= ) > at > org.apache.commons.digester.Digester.endElement(Digester.java:1067) > at > org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown > Source) > at > = org.apache.xerces.parsers.AbstractXMLDocumentParser.emptyElement(Unknown > Source) > at > > org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement > (Unknown > Source) > at > > = org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispa= tcher. > dispatch(Unknown > Source) > at > > = org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown= > Source) > at > org.apache.xerces.parsers.DTDConfiguration.parse(Unknown > Source) > at > org.apache.xerces.parsers.DTDConfiguration.parse(Unknown > Source) > at > org.apache.xerces.parsers.XMLParser.parse(Unknown Source) > at > org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown > Source) > at > org.apache.commons.digester.Digester.parse(Digester.java:1600) > at > > = com.arso.trelaze.socle.persistance.ConfigurationLoader.chargerConfiguratio= n( > ConfigurationLoader.java:90) > > I think it was an introspection error : it try to = find a > void > setReader(RWClass reader) and don't find it but how = could > I do to make > digester calling the good setter ? > I try to define it has void setReader(Object reader) = but > I had the same > error. > > I am new to digester so sorry if it is an evidence = for > you. > > thanks > Nicolas > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: > commons-user-help@jakarta.apache.org > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: commons-user-help@jakarta.apache.org >