You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jackrabbit.apache.org by Cory Prowse <co...@prowse.com> on 2010/10/12 09:34:26 UTC

Dev request: ResourceException not chaining cause correctly

Hi,

Just a minor request to chain the ResourceException's that are thrown from JCAManagedConnectionFactory.

The cause exceptions are being swallowed silently making it rather confusing sometimes why things are failing.
As an example, if you have misconfigured the persistence manager the ConfigurationException is not chained so you have no idea what the exact problem is, as all you get is "unable to instantiate persistence manager" instead of "persistence manager has no property 'blah'.

In JCAManagedConnectionFactory, methods openSession and createRepository both throw ResourceException without passing the cause exception in the constructor.

 -- Cory

Re: Dev request: ResourceException not chaining cause correctly

Posted by Cory Prowse <co...@prowse.com>.
It took me awhile bit I eventually lodged this feature request:
  https://issues.apache.org/jira/browse/JCR-2798

 -- Cory

On 12/10/2010, at 7:15 PM, Cory Prowse wrote:

> No worries, will post the feature request in the next day or so.
> 
> -- cory
> 
> On 12/10/2010, at 6:50 PM, Jukka Zitting wrote:
> 
>> Hi,
>> 
>> On Tue, Oct 12, 2010 at 9:34 AM, Cory Prowse <co...@prowse.com> wrote:
>>> In JCAManagedConnectionFactory, methods openSession and createRepository
>>> both throw ResourceException without passing the cause exception in the constructor.
>> 
>> This constructor is not available in J2EE version 1.3, so for now
>> we've been using the ResourceException.setLinkedException() method for
>> this (see JCR-761). To address your need we could either upgrade the
>> platform requirement to J2EE 1.4 or start using the J2SE method
>> Exception.initCause() instead of setLinkedException(). Can you file an
>> improvement issue in Jira about this?
>> 
>> BR,
>> 
>> Jukka Zitting
> 


Re: Dev request: ResourceException not chaining cause correctly

Posted by Cory Prowse <co...@prowse.com>.
No worries, will post the feature request in the next day or so.

 -- cory

On 12/10/2010, at 6:50 PM, Jukka Zitting wrote:

> Hi,
> 
> On Tue, Oct 12, 2010 at 9:34 AM, Cory Prowse <co...@prowse.com> wrote:
>> In JCAManagedConnectionFactory, methods openSession and createRepository
>> both throw ResourceException without passing the cause exception in the constructor.
> 
> This constructor is not available in J2EE version 1.3, so for now
> we've been using the ResourceException.setLinkedException() method for
> this (see JCR-761). To address your need we could either upgrade the
> platform requirement to J2EE 1.4 or start using the J2SE method
> Exception.initCause() instead of setLinkedException(). Can you file an
> improvement issue in Jira about this?
> 
> BR,
> 
> Jukka Zitting


Re: Dev request: ResourceException not chaining cause correctly

Posted by Jukka Zitting <ju...@gmail.com>.
Hi,

On Tue, Oct 12, 2010 at 9:34 AM, Cory Prowse <co...@prowse.com> wrote:
> In JCAManagedConnectionFactory, methods openSession and createRepository
> both throw ResourceException without passing the cause exception in the constructor.

This constructor is not available in J2EE version 1.3, so for now
we've been using the ResourceException.setLinkedException() method for
this (see JCR-761). To address your need we could either upgrade the
platform requirement to J2EE 1.4 or start using the J2SE method
Exception.initCause() instead of setLinkedException(). Can you file an
improvement issue in Jira about this?

BR,

Jukka Zitting