[ 
https://issues.apache.org/jira/browse/FELIX-800?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Karl Pauls updated FELIX-800:
-----------------------------

          Component/s:     (was: Felix Commons)
                       Framework
             Priority: Minor  (was: Major)
    Affects Version/s: felix-1.0.4
                       felix-1.2.0
                       
felix-1.2.1

                       felix-1.2.2
        Fix Version/s: felix-1.4.0
             Assignee: Karl Pauls

The issue is that we didn't assume somebody could extend the 
org.apache.felix.framework.Felix class. The fix is to use 
framework.getClass().getClassloader().loadClass(Felix.class.getName()) instead 
of framework.getClass(). This needs to be changed in more then one place and 
should make it into 1.4.0.

> 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: Framework
>    Affects Versions: felix-1.0.4, felix-1.2.0, felix-1.2.1
, felix-1.2.2
>            Reporter: Ali Naddaf
>            Assignee: Karl Pauls
>            Priority: Minor
>             Fix For: felix-1.4.0
>
>
> 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