commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Simone Tripodi (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (DIGESTER-142) Apache digester addSetProperty method is unclear and probably wrong.
Date Wed, 06 Jul 2011 11:53:18 GMT

     [ https://issues.apache.org/jira/browse/DIGESTER-142?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Simone Tripodi closed DIGESTER-142.
-----------------------------------


included in Apache Commons Digester 3.0 release

> Apache digester addSetProperty method is unclear and probably wrong.
> --------------------------------------------------------------------
>
>                 Key: DIGESTER-142
>                 URL: https://issues.apache.org/jira/browse/DIGESTER-142
>             Project: Commons Digester
>          Issue Type: Bug
>    Affects Versions: 2.1
>         Environment: linux, 64 bits
>            Reporter: i30817
>            Assignee: Simone Tripodi
>            Priority: Minor
>             Fix For: 3.0
>
>
> The addSetProperty method call:
>             Digester d = new Digester();
>             d.push(this);
>             d.addObjectCreate("rdf:RDF/pgterms:etext", Book.class);
>             d.addSetProperty("rdf:RDF/pgterms:etext", "rdf:ID", "setId");
>  OR
>             d.addSetProperty("rdf:RDF/pgterms:etext", "rdf:ID", "id");
> on a class Book with the method public void setId(String)
> running on this xml (simplified and not tested the simplification):
> <rdf:RDF>
> <pgterms:etext rdf:ID="etext10452">
>   <dc:publisher>&pg;</dc:publisher>
>   <dc:title rdf:parseType="Literal">Peter's Mother</dc:title>
>   <dc:creator rdf:parseType="Literal">De La Pasture, Henry, Mrs., 1866-1945</dc:creator>
>   <pgterms:friendlytitle rdf:parseType="Literal">Peter's Mother by Mrs. Henry De
La Pasture</pgterms:friendlytitle>
>   <dc:language><dcterms:ISO639-2><rdf:value>en</rdf:value></dcterms:ISO639-2></dc:language>
>   <dc:created><dcterms:W3CDTF><rdf:value>2003-12-01</rdf:value></dcterms:W3CDTF></dc:created>
>   <dc:rights rdf:resource="&lic;" />
> </pgterms:etext>
> </rdf:RDF>
> gives this exception:
> Nov 8, 2010 2:42:12 PM org.apache.commons.digester.Digester startElement
> SEVERE: Begin event threw exception
> java.lang.NoSuchMethodException: Bean has no property named etext10452
>         at org.apache.commons.digester.SetPropertyRule.begin(SetPropertyRule.java:154)
>         at org.apache.commons.digester.Rule.begin(Rule.java:177)
>         at org.apache.commons.digester.Digester.startElement(Digester.java:1583)
>         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:504)
>         at com.sun.org.apache.xerces.internal.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:770)
>         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1340)
>         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2732)
>         at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:625)
>         at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
>         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:812)
>         at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:741)
>         at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:123)
>         at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1208)
>         at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:525)
>         at org.apache.commons.digester.Digester.parse(Digester.java:1916)
> ...(my code the rest).
> To work around it use instead:
> d.addSetProperties("rdf:RDF/pgterms:etext", "rdf:ID", "id");
> Doesn't make much sense to me. Also the confusion between a javadoc bean property and
a xml one is very, very misleading on the javadoc.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message