The cache only gets populated if the context is
authorrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 11 Sep 2011 13:14:23 +0000 (13:14 +0000)
committerrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Sun, 11 Sep 2011 13:14:23 +0000 (13:14 +0000)
not null.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1169447 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/core/DefaultInstanceManager.java

index b354fc2..9fc69ff 100644 (file)
@@ -166,6 +166,11 @@ public class DefaultInstanceManager implements InstanceManager {
      */
     protected void postConstruct(Object instance, final Class<?> clazz)
             throws IllegalAccessException, InvocationTargetException {
+        if (context == null) {
+            // No resource injection
+            return;
+        }
+
         Class<?> superClass = clazz.getSuperclass();
         if (superClass != Object.class) {
             postConstruct(instance, superClass);