commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Chancogne <da...@o-ms.com>
Subject Re: [Betwixt] Betwixt and Log4j
Date Sun, 09 Nov 2003 14:54:23 GMT

Hello,

I originally sent this on Friday but it seems it did not
make it to the list.

---------8<-------------CUT HERE ----------------8<----------

Subject: Re: [Betwixt] Betwixt and Log4j
From: David Chancogne <david@o-ms.com>
Date: Fri, 07 Nov 2003 21:59:34 -0500
To: Jakarta Commons Users List <commons-user@jakarta.apache.org>


David Chancogne wrote:
 > Hello,
 >
 > My setup:
 >    Java: Sun SDK, java version "1.4.2-beta"
 >    Betwixt: 1.0 apha1
 >    Digester: 1.5
 >    Log4j: 1.2.8
 >
 >
 > The code attached reproduces the problem.
 >
 > Running the attached code produce the expected result, i.e.
 > the outside tag is renamed to 'product' and the 'archives'
 > field is ignore:
 >
 > <product>
 >   <id>1</id>
 >   <name>Productname</name>
 > </product>
 >
 >
 > Turning debugging on to 'DEBUG' level in log4j.properties
 > generates the following output (as well has the
 > stack exception thrown by XMLIntrospectorHelper):
 >
 > <ProductXMLTest>
 >   <archives>
 >     <archive>
 >       <id>2</id>
 >       <name>ArchiveName</name>
 >     </archive>
 >   </archives>
 >   <id>1</id>
 >   <name>Productname</name>
 > </ProductXMLTest>
 >
 >
 > Obviously this is not the right output (e.g. 'archives'
 > should be hidden). This is probably due to the exception
 > thrown by Betwixt. Am I missing something?


To answer my own question, I believe the error comes
from XMLIntrospectorHelper.java, around line 488 (latest
from CVS):

    ...
    ElementDescriptor descriptor =
       findGetCollectionDescriptor(
                                   introspector,
                                   rootDescriptor,
                                   propertyName );

    if ( log.isDebugEnabled() ) {
       log.debug( "!! " + propertyName + " -> " + descriptor );
       log.debug( "!! " + name + " -> "
       + (descriptor!=null?descriptor.getPropertyName():"") );
    }
    if ( descriptor != null ) {
    ...


If 'descriptor' is null and debugging turned on, a NullPointer
Exception will be raised. The debug message should go in the
following if block.

/David


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