commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ken Tanaka <Ken.Tan...@noaa.gov>
Subject Re: [digester] xml attribute values containing "]" character get scrambled
Date Fri, 16 May 2008 17:18:17 GMT


>> Can you post your ConfigData class?
>>
>> You could also try enabling debug logging for category
>>    org.apache.commons.digester
>> which will give a lot of info about which methods are called when.
>>
>> Regards, Simon
>>
>>     
> Thanks for the suggestion. I'll try adding logging to the simplified
> example. Logging on my working application looked as if the wrong
> information was in my XML input, although there was a lot of output to
> wade through. Logging on the example code should be much easier to analyze.
I should clarify, it just looked like the wrong information was in the 
XML even though it was correct. Some additional examples:

This digester_conf.xml
  <toplevel>
      <stringset
      attr1="1]"
      attr2="2]"
      attr3="3]"
      attr4="4]"
      attr5="5]"
      attr6="6]"
      attr7="7]seven"
      attr8="8]!"
      attr9="9]"
      attr10="ten"
      />
  </toplevel>

results in output (attr7 has attr8 overlaid):
  String set:
    attr1 =1]
    attr2 =2]
    attr3 =3]
    attr4 =4]
    attr5 =5]
    attr6 =6]
    attr7 =8]!even
    attr8 =8]!
    attr9 =9]
    attr10=ten

and this digester_conf.xml (same as before, but attr10 changed)
  <toplevel>
      <stringset
      attr1="1]"
      attr2="2]"
      attr3="3]"
      attr4="4]"
      attr5="5]"
      attr6="6]"
      attr7="7]seven"
      attr8="8]!"
      attr9="9]"
      attr10="ten]"
      />
  </toplevel>

results in output (attr7 has attr8 overlaid, attr9 has attr10 overlaid):
  String set:
    attr1 =1]
    attr2 =2]
    attr3 =3]
    attr4 =4]
    attr5 =5]
    attr6 =6]
    attr7 =8]!even
    attr8 =8]!
    attr9 =te
    attr10=ten]

Here is the logging output (log4j) for the first digester_conf.xml file. 
I'm not sure what to make of this.

-Ken

main INFO  tryDigesterConfigLimit.TryDigester - Beginning TryDigester 
session -------------
main DEBUG Digester.sax - 
setDocumentLocator(com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser$LocatorProxy@7854a328)
main DEBUG Digester.sax - startDocument()
main DEBUG Digester.sax - startElement(,,toplevel)
main DEBUG digester.Digester -   Pushing body text ''
main DEBUG digester.Digester -   New match='toplevel'
main DEBUG digester.Digester -   No rules found matching 'toplevel'.
main DEBUG Digester.sax - characters(

    )
main DEBUG Digester.sax - characters(
    )
main DEBUG Digester.sax - characters(
    )
main DEBUG Digester.sax - startElement(,,stringset)
main DEBUG digester.Digester -   Pushing body text '



    '
main DEBUG digester.Digester -   New match='toplevel/stringset'
main DEBUG digester.Digester -   Fire begin() for 
ObjectCreateRule[className=gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet, 
attributeName=null]
main DEBUG digester.Digester - [ObjectCreateRule]{toplevel/stringset}New 
gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet
main DEBUG digester.Digester -   Fire begin() for SetPropertiesRule[]
main DEBUG digester.Digester - [SetPropertiesRule]{toplevel/stringset} 
Setting property 'attr1' to '1]'
main DEBUG digester.Digester - [SetPropertiesRule]{toplevel/stringset} 
Setting property 'attr2' to '2]'
main DEBUG digester.Digester - [SetPropertiesRule]{toplevel/stringset} 
Setting property 'attr3' to '3]'
main DEBUG digester.Digester - [SetPropertiesRule]{toplevel/stringset} 
Setting property 'attr4' to '4]'
main DEBUG digester.Digester - [SetPropertiesRule]{toplevel/stringset} 
Setting property 'attr5' to '5]'
main DEBUG digester.Digester - [SetPropertiesRule]{toplevel/stringset} 
Setting property 'attr6' to '6]'
main DEBUG digester.Digester - [SetPropertiesRule]{toplevel/stringset} 
Setting property 'attr7' to '8]!even'
main DEBUG digester.Digester - [SetPropertiesRule]{toplevel/stringset} 
Setting property 'attr8' to '8]!'
main DEBUG digester.Digester - [SetPropertiesRule]{toplevel/stringset} 
Setting property 'attr9' to '9]'
main DEBUG digester.Digester - [SetPropertiesRule]{toplevel/stringset} 
Setting property 'attr10' to 'ten'
main DEBUG digester.Digester - [SetPropertiesRule]{toplevel/stringset} 
Set gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet properties
main DEBUG beanutils.BeanUtils - 
BeanUtils.populate(gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet@692a3722, 
{attr9=9], attr10=ten, attr2=2], attr1=1], attr4=4], attr3=3], attr6=6], 
attr5=5], attr8=8]!, attr7=8]!even})
main DEBUG beanutils.BeanUtils -   
setProperty(gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet@692a3722, 
attr9, 9])
main DEBUG beanutils.ConvertUtils - Convert string '9]' to class 
'java.lang.String'
main DEBUG beanutils.ConvertUtils -   Using converter 
org.apache.commons.beanutils.converters.StringConverter@6262937c
main DEBUG beanutils.PropertyUtils - setSimpleProperty: Invoking method 
public void 
gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet.setAttr9(java.lang.String) 
with value 9] (class java.lang.String)
main DEBUG beanutils.BeanUtils -   
setProperty(gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet@692a3722, 
attr10, ten)
main DEBUG beanutils.ConvertUtils - Convert string 'ten' to class 
'java.lang.String'
main DEBUG beanutils.ConvertUtils -   Using converter 
org.apache.commons.beanutils.converters.StringConverter@6262937c
main DEBUG beanutils.PropertyUtils - setSimpleProperty: Invoking method 
public void 
gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet.setAttr10(java.lang.String) 
with value ten (class java.lang.String)
main DEBUG beanutils.BeanUtils -   
setProperty(gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet@692a3722, 
attr2, 2])
main DEBUG beanutils.ConvertUtils - Convert string '2]' to class 
'java.lang.String'
main DEBUG beanutils.ConvertUtils -   Using converter 
org.apache.commons.beanutils.converters.StringConverter@6262937c
main DEBUG beanutils.PropertyUtils - setSimpleProperty: Invoking method 
public void 
gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet.setAttr2(java.lang.String) 
with value 2] (class java.lang.String)
main DEBUG beanutils.BeanUtils -   
setProperty(gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet@692a3722, 
attr1, 1])
main DEBUG beanutils.ConvertUtils - Convert string '1]' to class 
'java.lang.String'
main DEBUG beanutils.ConvertUtils -   Using converter 
org.apache.commons.beanutils.converters.StringConverter@6262937c
main DEBUG beanutils.PropertyUtils - setSimpleProperty: Invoking method 
public void 
gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet.setAttr1(java.lang.String) 
with value 1] (class java.lang.String)
main DEBUG beanutils.BeanUtils -   
setProperty(gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet@692a3722, 
attr4, 4])
main DEBUG beanutils.ConvertUtils - Convert string '4]' to class 
'java.lang.String'
main DEBUG beanutils.ConvertUtils -   Using converter 
org.apache.commons.beanutils.converters.StringConverter@6262937c
main DEBUG beanutils.PropertyUtils - setSimpleProperty: Invoking method 
public void 
gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet.setAttr4(java.lang.String) 
with value 4] (class java.lang.String)
main DEBUG beanutils.BeanUtils -   
setProperty(gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet@692a3722, 
attr3, 3])
main DEBUG beanutils.ConvertUtils - Convert string '3]' to class 
'java.lang.String'
main DEBUG beanutils.ConvertUtils -   Using converter 
org.apache.commons.beanutils.converters.StringConverter@6262937c
main DEBUG beanutils.PropertyUtils - setSimpleProperty: Invoking method 
public void 
gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet.setAttr3(java.lang.String) 
with value 3] (class java.lang.String)
main DEBUG beanutils.BeanUtils -   
setProperty(gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet@692a3722, 
attr6, 6])
main DEBUG beanutils.ConvertUtils - Convert string '6]' to class 
'java.lang.String'
main DEBUG beanutils.ConvertUtils -   Using converter 
org.apache.commons.beanutils.converters.StringConverter@6262937c
main DEBUG beanutils.PropertyUtils - setSimpleProperty: Invoking method 
public void 
gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet.setAttr6(java.lang.String) 
with value 6] (class java.lang.String)
main DEBUG beanutils.BeanUtils -   
setProperty(gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet@692a3722, 
attr5, 5])
main DEBUG beanutils.ConvertUtils - Convert string '5]' to class 
'java.lang.String'
main DEBUG beanutils.ConvertUtils -   Using converter 
org.apache.commons.beanutils.converters.StringConverter@6262937c
main DEBUG beanutils.PropertyUtils - setSimpleProperty: Invoking method 
public void 
gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet.setAttr5(java.lang.String) 
with value 5] (class java.lang.String)
main DEBUG beanutils.BeanUtils -   
setProperty(gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet@692a3722, 
attr8, 8]!)
main DEBUG beanutils.ConvertUtils - Convert string '8]!' to class 
'java.lang.String'
main DEBUG beanutils.ConvertUtils -   Using converter 
org.apache.commons.beanutils.converters.StringConverter@6262937c
main DEBUG beanutils.PropertyUtils - setSimpleProperty: Invoking method 
public void 
gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet.setAttr8(java.lang.String) 
with value 8]! (class java.lang.String)
main DEBUG beanutils.BeanUtils -   
setProperty(gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet@692a3722, 
attr7, 8]!even)
main DEBUG beanutils.ConvertUtils - Convert string '8]!even' to class 
'java.lang.String'
main DEBUG beanutils.ConvertUtils -   Using converter 
org.apache.commons.beanutils.converters.StringConverter@6262937c
main DEBUG beanutils.PropertyUtils - setSimpleProperty: Invoking method 
public void 
gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet.setAttr7(java.lang.String) 
with value 8]!even (class java.lang.String)
main DEBUG digester.Digester -   Fire begin() for 
SetNextRule[methodName=addStringset, paramType=null]
main DEBUG Digester.sax - endElement(,,stringset)
main DEBUG digester.Digester -   match='toplevel/stringset'
main DEBUG digester.Digester -   bodyText=''
main DEBUG digester.Digester -   Fire body() for 
ObjectCreateRule[className=gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet, 
attributeName=null]
main DEBUG digester.Digester -   Fire body() for SetPropertiesRule[]
main DEBUG digester.Digester -   Fire body() for 
SetNextRule[methodName=addStringset, paramType=null]
main DEBUG digester.Digester -   Popping body text '



    '
main DEBUG digester.Digester -   Fire end() for 
SetNextRule[methodName=addStringset, paramType=null]
main DEBUG digester.Digester - [SetNextRule]{toplevel/stringset} Call 
gov.noaa.eds.byExample.tryDigesterConfigLimit.ConfigData.addStringset(gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet@692a3722)
main DEBUG beanutils.MethodUtils - Matching name=addStringset on class 
gov.noaa.eds.byExample.tryDigesterConfigLimit.ConfigData
main DEBUG beanutils.MethodUtils - Found straight match: public void 
gov.noaa.eds.byExample.tryDigesterConfigLimit.ConfigData.addStringset(gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet)
main DEBUG beanutils.MethodUtils - isPublic:true
main DEBUG digester.Digester -   Fire end() for SetPropertiesRule[]
main DEBUG digester.Digester -   Fire end() for 
ObjectCreateRule[className=gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet, 
attributeName=null]
main DEBUG digester.Digester - [ObjectCreateRule]{toplevel/stringset} 
Pop gov.noaa.eds.byExample.tryDigesterConfigLimit.StringSet
main DEBUG Digester.sax - characters(

)
main DEBUG Digester.sax - endElement(,,toplevel)
main DEBUG digester.Digester -   match='toplevel'
main DEBUG digester.Digester -   bodyText='





'
main DEBUG digester.Digester -   No rules found matching 'toplevel'.
main DEBUG digester.Digester -   Popping body text ''
main DEBUG Digester.sax - endDocument()


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Mime
View raw message