The lookup-method consults the parent ServiceManager if the Service was not
found, while the hasService doesn't. 

I also encountered a Race Condition with the disposing of the
TPCThreadManager in ContextManager which results in:

Unexpected condition while releasing worker: Thread[TPCThreadManager Worker 
#0,5,TPCThreadManager]
java.lang.NullPointerException
        at 
org.apache.excalibur.event.command.EventThreadPool.releaseWorker(EventThreadPool.java:141)
        at 
org.apache.excalibur.thread.impl.WorkerThread.recycleThread(WorkerThread.java:134)
        at org.apache.excalibur.thread.impl.WorkerThread.run(WorkerThread.java:123)

I get the Exception most times but not every time.

First thoughts:

The EventThreadPool gets disposed while the WorkerThreads are still
running (the EventPipeline is still active).

I'll try to inspect this issue further.

Index: src/java/org/apache/excalibur/fortress/lookup/FortressServiceManager.java
===================================================================
RCS file: 
/home/cvspublic/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/lookup/FortressServiceManager.java,v
retrieving revision 1.25
diff -u -r1.25 FortressServiceManager.java
--- src/java/org/apache/excalibur/fortress/lookup/FortressServiceManager.java   9 Nov 
2002 23:38:39 -0000       1.25
+++ src/java/org/apache/excalibur/fortress/lookup/FortressServiceManager.java   21 Nov 
+2002 16:18:11 -0000
@@ -141,7 +141,15 @@
 
     public boolean hasService( final String key )
     {
-        return m_container.has( key, null );
+       boolean hasService = m_container.has( key, null );
+        if ( ( !hasService ) && ( m_parent != null ) )
+       {
+           return m_parent.hasService( key );
+       } 
+        else 
+       {
+           return hasService;
+       }
     }
 
     public void release( final Object component )

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

Reply via email to