> From: Corey Jewett [mailto:[EMAIL PROTECTED]] 
> 
> 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.

Understandable.

Keep in mind also that the better version of the ServiceException
that allows you to keep track of the role without doing string
concatenations is this:

throw new ServiceException( m_handler, "No handler available" );

The ServiceException toString() and printStackTrace() code takes
care of the getMessage() + " [Role]: " + getRole() stuff.

I will look at why it is not being reported.


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

Reply via email to