You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Sylvain Wallez <sy...@apache.org> on 2005/09/23 16:08:17 UTC

SAXException weirdness (was Re: [2.1.8-dev] Real exception is not logged anymore)

Sylvain Wallez wrote:

> Carsten Ziegeler wrote:
>
>> Bart Molenkamp wrote:
>>
>>> Ok, I just did an SVN update, and the behaviour changed... First, there
>>> was a change in the web interface. Previously, I just saw the cocoon
>>> stacktrace, reporting that the sitemap could not be built because of 
>>> the
>>> 'xslt2' that is unknown. Now, the portal page gets rendered, and I just
>>> see "The coplet Gallery-Petstore is currently not available.". Has this
>>> something to do with it?
>>>
>>> Also, the exception is not logged in cocoon.log anymore, but something
>>> is logged in portal.log. Not the original exception, but just a
>>> processing exception:
>>>
>>>   
>>
>> Ok, now you have the same behaviour as Jorg and I :)
>>
>> Sylvain, did you test again?
>
>
> Yup, got it now. For some unknown reason, I had not the latest updates 
> in the portal block and now I can reproduce the error, both on MacOS 
> and Windows.
>
> Currently debugging...


Ok, I hopefully fixed it.

The problems was because of SAXException's buggy exception chaining (or 
at least not JDK 1.4 compatible) :
- it can wrap a parent exception but doesn't define a getCause() method 
that's used by JDK 1.4 to find parent exceptions
- it doesn't call its parent's printStacktrace() although it calls its 
parent's getMessage().

What happened is that when a SAXException was logged, the parent's 
stacktrace wasn't logged, and with the new location handling stuff, the 
useful information is there.

I fixed this by ensuring in CocoonLogFormatter that the full exception 
list is properly chained and this solves the problem.

Now I don't understand how we were able to print parent stack traces 
before...

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Re: SAXException weirdness (was Re: [2.1.8-dev] Real exception is not logged anymore)

Posted by Sylvain Wallez <sy...@apache.org>.
Carsten Ziegeler wrote:

>Sylvain Wallez wrote:
>  
>
>>Ok, I hopefully fixed it.
>>
>>The problems was because of SAXException's buggy exception chaining (or 
>>at least not JDK 1.4 compatible) :
>>- it can wrap a parent exception but doesn't define a getCause() method 
>>that's used by JDK 1.4 to find parent exceptions
>>- it doesn't call its parent's printStacktrace() although it calls its 
>>parent's getMessage().
>>
>>What happened is that when a SAXException was logged, the parent's 
>>stacktrace wasn't logged, and with the new location handling stuff, the 
>>useful information is there.
>>
>>I fixed this by ensuring in CocoonLogFormatter that the full exception 
>>list is properly chained and this solves the problem.
>>
>>Now I don't understand how we were able to print parent stack traces 
>>before...
>>
>>    
>>
>Thanks Sylvain for fixing this - now it works for me as well.
>But, is it correct that it now only works if I'm using LogKit for
>logging with the CocoonLogFormatter? What happens if I'm using log4j or
>something else? We should really make it work for all logging systems.
>  
>

Yup, I agree. I will check how this behaved in 2.1.7, i.e. before I 
changed the exception handling.

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://people.apache.org/~sylvain     http://www.anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Re: SAXException weirdness (was Re: [2.1.8-dev] Real exception is not logged anymore)

Posted by Carsten Ziegeler <cz...@apache.org>.
Sylvain Wallez wrote:
> 
> Ok, I hopefully fixed it.
> 
> The problems was because of SAXException's buggy exception chaining (or 
> at least not JDK 1.4 compatible) :
> - it can wrap a parent exception but doesn't define a getCause() method 
> that's used by JDK 1.4 to find parent exceptions
> - it doesn't call its parent's printStacktrace() although it calls its 
> parent's getMessage().
> 
> What happened is that when a SAXException was logged, the parent's 
> stacktrace wasn't logged, and with the new location handling stuff, the 
> useful information is there.
> 
> I fixed this by ensuring in CocoonLogFormatter that the full exception 
> list is properly chained and this solves the problem.
> 
> Now I don't understand how we were able to print parent stack traces 
> before...
> 
Thanks Sylvain for fixing this - now it works for me as well.
But, is it correct that it now only works if I'm using LogKit for
logging with the CocoonLogFormatter? What happens if I'm using log4j or
something else? We should really make it work for all logging systems.

Carsten
-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/