(FELIX-1834)

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@831398 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/framework/src/main/java/org/apache/felix/framework/URLHandlers.java b/framework/src/main/java/org/apache/felix/framework/URLHandlers.java
index f67b048..ecbda1d 100644
--- a/framework/src/main/java/org/apache/felix/framework/URLHandlers.java
+++ b/framework/src/main/java/org/apache/felix/framework/URLHandlers.java
@@ -602,12 +602,15 @@
         Class targetClass = null;
         for (int i = 0; i < stack.length; i++)
         {
-            if ((stack[i].getClassLoader() != null) && 
-                "org.apache.felix.framework.searchpolicy.ModuleImpl$ModuleClassLoader".equals(
-                stack[i].getClassLoader().getClass().getName()))
+            if (stack[i].getClassLoader() != null) 
             {
-                targetClass = stack[i];
-                break;
+                String name = stack[i].getClassLoader().getClass().getName();
+                if ("org.apache.felix.framework.ModuleImpl$ModuleClassLoader".equals(name) 
+                    || "org.apache.felix.framework.searchpolicy.ContentClassLoader".equals(name))
+                {
+                    targetClass = stack[i];
+                    break;
+                }
             }
         }
         
diff --git a/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleStreamHandler.java b/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleStreamHandler.java
index 8d06590..bcfd010 100644
--- a/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleStreamHandler.java
+++ b/framework/src/main/java/org/apache/felix/framework/URLHandlersBundleStreamHandler.java
@@ -19,6 +19,7 @@
 package org.apache.felix.framework;
 
 import java.io.IOException;
+import java.lang.reflect.Constructor;
 import java.net.*;
 
 import org.apache.felix.framework.util.SecureAction;
@@ -60,9 +61,11 @@
                 Class targetClass = framework.getClass().getClassLoader().loadClass(
                     URLHandlersBundleURLConnection.class.getName());
                 
-                return (URLConnection) m_action.invoke(m_action.getConstructor(targetClass, 
-                    new Class[]{URL.class, framework.getClass().getClassLoader().loadClass(
-                    Felix.class.getName())}), new Object[]{url, framework});
+                Constructor constructor = m_action.getConstructor(targetClass, 
+                        new Class[]{URL.class, framework.getClass().getClassLoader().loadClass(
+                                Felix.class.getName())});
+                m_action.setAccesssible(constructor);
+                return (URLConnection) m_action.invoke(constructor, new Object[]{url, framework});
             }
             catch (Exception ex)
             {