You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Peter Royal <pr...@managingpartners.com> on 2001/05/07 23:08:24 UTC

[C2] Exception trickling in component creation

I had some bugs in my own code that were throwing exceptions inside of the 
initialize block of my Avalon components. I wasn't seeing the specific 
exception in C2's error page, only the generic "Could not access the 
Component for role" message. The throw statement that throws that exception 
is including the nested exception, but its apparently being lost in 
transit. Anybody else experience this?
-pete

-- 
peter royal -> proyal@managingpartners.com
managing partners, inc. -> http://www.managingpartners.com


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: [C2] Exception trickling in component creation

Posted by Berin Loritsch <bl...@apache.org>.
Berin Loritsch wrote:
> 
> Peter Royal wrote:
> >
> > At 08:38 AM 5/8/2001 -0400, you wrote:
> > >I have experienced it as well.  The biggest thing is to make sure your
> > >component
> > >implements the org.apache.avalon.framework.component.Component interface--
> > >otherwise you will get a class cast exception.  When Avalon goes Beta on
> > >Friday
> > >(provided nothing major comes up), I will make sure that the Framework jar is
> > >compiled with debug information on.  That should help a bit.
> >
> > Oh it was entirely my code. I have an Avalon component that establishes a
> > connection to my RMI server and naturally that can throw an exception. The
> > component is tagged with the avalon Initializable interface, and with the
> > initialize method was called, if an exception occurred in there, i wasn't
> > seeing it bubble up.
> > -pete
> 
> let me see if I can fix this for you.  It should be considered a bug....
> The ComponentFactory goes through the lifecycle, but I need to make sure
> the exception is at least logged....

I looked at the Avalon code, and it isn't an issue in there.  The Exception
thrown by the lifecycle stage (i.e. initialize(), etc.) is passed right on
up the chain.

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: [C2] Exception trickling in component creation

Posted by Berin Loritsch <bl...@apache.org>.
Peter Royal wrote:
> 
> At 08:38 AM 5/8/2001 -0400, you wrote:
> >I have experienced it as well.  The biggest thing is to make sure your
> >component
> >implements the org.apache.avalon.framework.component.Component interface--
> >otherwise you will get a class cast exception.  When Avalon goes Beta on
> >Friday
> >(provided nothing major comes up), I will make sure that the Framework jar is
> >compiled with debug information on.  That should help a bit.
> 
> Oh it was entirely my code. I have an Avalon component that establishes a
> connection to my RMI server and naturally that can throw an exception. The
> component is tagged with the avalon Initializable interface, and with the
> initialize method was called, if an exception occurred in there, i wasn't
> seeing it bubble up.
> -pete

let me see if I can fix this for you.  It should be considered a bug....
The ComponentFactory goes through the lifecycle, but I need to make sure
the exception is at least logged....

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: [C2] Exception trickling in component creation

Posted by Peter Royal <pr...@managingpartners.com>.
At 08:38 AM 5/8/2001 -0400, you wrote:
>I have experienced it as well.  The biggest thing is to make sure your 
>component
>implements the org.apache.avalon.framework.component.Component interface--
>otherwise you will get a class cast exception.  When Avalon goes Beta on 
>Friday
>(provided nothing major comes up), I will make sure that the Framework jar is
>compiled with debug information on.  That should help a bit.

Oh it was entirely my code. I have an Avalon component that establishes a 
connection to my RMI server and naturally that can throw an exception. The 
component is tagged with the avalon Initializable interface, and with the 
initialize method was called, if an exception occurred in there, i wasn't 
seeing it bubble up.
-pete

-- 
peter royal -> proyal@managingpartners.com
managing partners, inc. -> http://www.managingpartners.com


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: [C2] Exception trickling in component creation

Posted by Berin Loritsch <bl...@apache.org>.
Peter Royal wrote:
> 
> I had some bugs in my own code that were throwing exceptions inside of the
> initialize block of my Avalon components. I wasn't seeing the specific
> exception in C2's error page, only the generic "Could not access the
> Component for role" message. The throw statement that throws that exception
> is including the nested exception, but its apparently being lost in
> transit. Anybody else experience this?
> -pete

I have experienced it as well.  The biggest thing is to make sure your component
implements the org.apache.avalon.framework.component.Component interface--
otherwise you will get a class cast exception.  When Avalon goes Beta on Friday
(provided nothing major comes up), I will make sure that the Framework jar is
compiled with debug information on.  That should help a bit.

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>