commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Kaiser" <Carsten.Kai...@valtech.de>
Subject AW: Re: Réf. : AW: [digester] interface and setter
Date Fri, 29 Aug 2003 12:42:34 GMT
Maybe it's a classloader issue...
Does your digester use the same classloader??? Maybe you have somewhere another version of
your interface, which
your digester is using while parsing???
If you use the classname rather than the class itself, the CallMethodRule is supposed to load
the class with
the digester's classloader... Maybe this will help you to investigate the problem further!

Regards,
CK



-----Ursprüngliche Nachricht-----
Von: Nicolas.CHALUMEAU@arsoe-trelaze.com
[mailto:Nicolas.CHALUMEAU@arsoe-trelaze.com]
Gesendet: Freitag, 29. August 2003 14:14
An: Jakarta Commons Users List
Betreff: Re: Re: Réf. : AW: [digester] interface and setter


Isn't what i do when i declare the Class [] params = {com.arso.trelaze.socle.persistance.Reader.class};
before calling addCallMethod ?
And when i check my log i see that the factory create the  RWClass which implemente Reader
so they can't be a class cast problem.
Maybe i should create a beaninfo in my sub class to be sure introspection 
match the corect class

Is some had this kind of problem ? 

Nicolas





robert burrell donkin <robertburrelldonkin@blueyonder.co.uk>
28/08/2003 21:18
Veuillez répondre à "Jakarta Commons Users List"

 
        Pour :  "Jakarta Commons Users List" <commons-user@jakarta.apache.org>
        cc : 
        Objet : Re: Réf. : AW: [digester] interface and setter


i suggest that you check that the parameter type matches exactly the 
method call signature: the CallMethodRule is very particular about the 
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 = {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" <Carsten.Kaiser@valtech.de>
> 28/08/2003 11:34
> Veuillez répondre à "Jakarta Commons Users List"
>
>
>         Pour :  "Jakarta Commons Users List" 
<commons-user@jakarta.apache.
> 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üngliche 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 :
>
>                  <acces name="SuivitServices">
>                        <reader
> classe="com.arso.trelaze.socle.persistance.RWClass"/>
>                        <writer
> classe="com.arso.trelaze.socle.persistance.RWClass"/>
>                  </acces>
>
>                  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$FragmentContentDispatcher.
> 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.chargerConfiguration(
> 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
>


---------------------------------------------------------------------
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


Mime
View raw message