Worked great. Just created the following bogus service method. Log
message showed up, also caused an IllegalState in
PerThreadComponentHandler. Thanks a lot.

    public void service (ServiceManager manager) throws ServiceException
{
        super.service(manager);
        
        getLogger().debug("Hey it's service");
        
        throw new ServiceException (" I don't like being serviced.");
    }

Corey


On Wed, 2002-09-11 at 02:13, Marcus Crafter wrote:
> Hi Corey,
> 
> On Tue, Sep 10, 2002 at 10:40:53PM -0700, Corey Jewett wrote:
> > Okay, I finally figured out what I was doing, and would like to change
> > the issue to one on logging.
> > 
> > My SocketManager.service() method was execing code that should have been
> > in initialize. I was using a variable that is set in configure().
> > 
> > The reason it took me so long to find is that I was throwing a
> > ServiceException, but it was not being logged. Code follows:
> > 
> > 
> >     public void service (ServiceManager manager) throws ServiceException
> > {
> > ...
> >         if (!m_manager.hasService(m_handler)) {
> >             throw new ServiceException ("Handler, " + m_handler 
> >                     + ", is not valid.");
> >         }
> > ...
> >     }
> > 
> > I expected my exception to cause some kind of log event, but there isn't
> > any. I inserted a logging line just before the throw and then from there
> > it all made sense. Mostly this is my fault for being an Avalon novice,
> > but I'm at a loss for why ServiceException disappears into the framework
> > ether.
> 
>       I had a look at the PerThread handler class, and saw that if the
>       instance cannot be created for whatever reason, a null is returned
>       and any exception dropped.
> 
>       I've applied a patch which should log any exceptions thrown inside
>       this part of the handler. Can you test it out in your environment
>       for me and send in the results ?
>       
>       Cheers,
>       
>       Marcus
>       
> -- 
>         .....
>      ,,$$$$$$$$$,      Marcus Crafter
>     ;$'      '$$$$:    Computer Systems Engineer
>     $:         $$$$:   ManageSoft GmbH
>      $       o_)$$$:   82-84 Mainzer Landstrasse
>      ;$,    _/\ &&:'   60327 Frankfurt Germany
>        '     /( &&&
>            \_&&&&'
>           &&&&.
>     &&&&&&&:
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to