URLHandlersBundleStreamHandler.openConnection(URL) fails when extending Felix
-----------------------------------------------------------------------------

                 Key: FELIX-800
                 URL: https://issues.apache.org/jira/browse/FELIX-800
             Project: Felix
          Issue Type: Bug
          Components: Felix Commons
            Reporter: Ali Naddaf


I am seeing an exception in the 
URLHandlersBundleStreamHandler.openConnection(URL) method. Here is the part I 
am referring to:

if (framework != null)
       {
           // TODO: optimize this to not use reflection if not needed
           try
           {
               Class targetClass = 
framework.getClass().getClassLoader().loadClass(
                   URLHandlersBundleURLConnection.class.getName());
                             return (URLConnection) 
m_action.invoke(m_action.getConstructor(targetClass,
                   new Class[]{URL.class, framework.getClass()}),
                   new Object[]{url, framework});
           }
           catch (Exception ex)
           {
               throw new IOException(ex.getMessage());
           }
       }
       throw new IOException("No framework context found");

The problem happens when reflection fails to find the appropriate constructor 
and throws a NoSuchMethodException; here the targetClass resolves to 
"org.apache.felix.framework.URLHandlersBundleURLConnection" and
the exception is:

java.lang.NoSuchMethodException: 
org.apache.felix.framework.URLHandlersBundleURLConnection.<init>(java.net.URL, 
org.simplecenter.application.SimpleCenterApplication)

Note that SimpleCenterApplicaion extends Felix and  
URLHandlersBundleURLConnection has the constructor 
URLHandlersBundleURLConnection(URL, Felix). 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to