commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin van den Bemt <mll...@mvdb.net>
Subject Re: [Betwixt] Betwixt and Log4j
Date Sun, 23 Nov 2003 21:22:10 GMT
Sorry for the verrry late answer... 
Got swamped with personal problems and a huge workload at the office..
sorry.. Finally got my betwixt evening though :) 
I've been trying to reproduce your problem, with debug level turned on. 
It turns out that you must be using betwixt 1.0 ALPHA 1.. The bug was
fixed a month after the release (even by myself). If you use cvs head
you should be without any problems. (the code snippet you pasted also
got me doubting it was the correct code for your version, since an npe
is actually prevented in the descriptor!=null line..

Hope this helps and is not too late :(

Mvgr,
Martin

On Sun, 2003-11-09 at 15:54, David Chancogne wrote:
> 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
-- 
Martin van den Bemt <mllist@mvdb.net>
mvdb.com


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