I changed the initialization of m_newInstance and m_dispose to be in the 
constructor.

java.lang.reflect.InvocationTargetException: java.lang.NullPointerException
        at 
org.apache.excalibur.fortress.handler.ComponentFactory.getInstrumentableName(ComponentFactory.java:212)
        at 
org.apache.excalibur.fortress.handler.ComponentFactory.<init>(ComponentFactory.java:93)
        at 
org.apache.excalibur.fortress.handler.ThreadSafeComponentHandler.<init>(ThreadSafeComponentHandler.java:54)

I also fixed ContextManager to build a RoleManager from config or URI. Please 
double-check that.
-pete


-- 
peter royal -> [EMAIL PROTECTED]
Index: src/java/org/apache/excalibur/fortress/handler/ComponentFactory.java
===================================================================
RCS file: /home/cvspublic/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/handler/ComponentFactory.java,v
retrieving revision 1.9
diff -u -r1.9 ComponentFactory.java
--- src/java/org/apache/excalibur/fortress/handler/ComponentFactory.java	13 Apr 2002 01:39:56 -0000	1.9
+++ src/java/org/apache/excalibur/fortress/handler/ComponentFactory.java	18 Apr 2002 03:35:34 -0000
@@ -39,12 +39,8 @@
 public class ComponentFactory
     implements ObjectFactory, ThreadSafe, Instrumentable
 {
-    private CounterInstrument m_newInstance = new CounterInstrument(
-        "Create " + getInstrumentableName()
-    );
-    private CounterInstrument m_dispose = new CounterInstrument(
-        "Destroy " + getInstrumentableName()
-    );
+    private CounterInstrument m_newInstance;
+    private CounterInstrument m_dispose;
 
     /** The class which this <code>ComponentFactory</code>
      * should create.
@@ -98,6 +94,9 @@
         m_roles = roles;
         m_logManager = logkit;
         m_logger = m_logManager.getLoggerForCategory( "system.factory" );
+
+        m_newInstance = new CounterInstrument( "Create " + getInstrumentableName() );
+        m_dispose = new CounterInstrument( "Destroy " + getInstrumentableName() );
     }
 
     public Object newInstance()
Index: src/java/org/apache/excalibur/fortress/util/ContextManager.java
===================================================================
RCS file: /home/cvspublic/jakarta-avalon-excalibur/fortress/src/java/org/apache/excalibur/fortress/util/ContextManager.java,v
retrieving revision 1.15
diff -u -r1.15 ContextManager.java
--- src/java/org/apache/excalibur/fortress/util/ContextManager.java	13 Apr 2002 01:39:57 -0000	1.15
+++ src/java/org/apache/excalibur/fortress/util/ContextManager.java	18 Apr 2002 03:35:35 -0000
@@ -345,29 +345,35 @@
         {
         }
 
-        // Attempt to load config...
-        //if (config == null)
-        //{
+        Configuration config = getConfiguration(ROLE_MANAGER_CONFIGURATION, ROLE_MANAGER_CONFIGURATION_URI);
 
-        // See if we can inherit from the parent...
-        try
+        if (config == null)
         {
-            childContext.get( ROLE_MANAGER );
+            // See if we can inherit from the parent...
+            try
+            {
+                childContext.get( ROLE_MANAGER );
 
-            // OK, done.
-            return;
-        }
-        catch( ContextException ce )
-        {
-            // No RoleManager available anywhere. (Set one up.)
+                // OK, done.
+                return;
+            }
+            catch( ContextException ce )
+            {
+                // No RoleManager available anywhere. (Set one up.)
+
+                RoleManager rm = new ExcaliburRoleManager();
+
+                assumeOwnership( rm );
+                childContext.put( ROLE_MANAGER, rm );
+
+                return;
+            }
         }
-        //}
 
-        //
-        // TODO: Load configuration from ROLE_MANAGER_CONFIGURATION or ROLE_MANAGER_CONFIGURATION_URI
-        //       and create a proper RM from those (ERM?). /LS
-        //
-        RoleManager rm = new ExcaliburRoleManager();
+        ConfigurableRoleManager rm = new ConfigurableRoleManager(new ExcaliburRoleManager());
+
+        rm.configure(config);
+
         assumeOwnership( rm );
         childContext.put( ROLE_MANAGER, rm );
     }
--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to