felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Miguel Ángel Pastor Olivar (JIRA) <j...@apache.org>
Subject [jira] [Updated] (FELIX-3696) Extension Bundle system adds loader to the classloader which can make other libraries to fail
Date Tue, 02 Oct 2012 09:27:08 GMT

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

Miguel Ángel Pastor Olivar updated FELIX-3696:
----------------------------------------------

    Description: 
I am embedding Apache Felix (and Equinox because I would like to switch depending on the application
server I am running on).

* The xalan ExtensionHandler executes something like this: ObjectFactory.findProviderClass(className,
ObjectFactory.findClassLoader(), true)

* The className has the format "java:org.portletbridge.portlet.BridgeFunctions" ( I am embedding
the OSGI container into Liferay portal :) )

* The extension manager have already added the extension loader to the classloader

{code}
  Felix.m_secureAction.addURLToURLClassLoader(Felix.m_secureAction.createURL(Felix.m_secureAction.createURL(null,
"http:", extensionManager),"http://felix.extensions:9/", extensionManager),Felix.class.getClassLoader());
{code}

* When the classloader try to resolve the "java:org.portletbridge.portlet.BridgeFunctions"
the previous loader added by the ExtensionManager cause an unhandled error.

In sun.misc.URL

{code}
    public Resource getResource(String name, boolean check) {
        if (DEBUG) {
            System.err.println("URLClassPath.getResource(\"" + name + "\")");
        }

        Loader loader;
        for (int i = 0; (loader = getLoader(i)) != null; i++) {
            Resource res = loader.getResource(name, check);
            if (res != null) {
                return res;
            }
        }
        return null;
    }
{code}

In the previous code, the loader injected by the framework is causing an IllegalArgumentException
here:

Resource res = loader.getResource(name, check); (instead of returning null)

Let me know if you need some more details.

  was:
I am embedding Apache Felix (and Equinox because I would like to switch depending on the application
server I am running on).

* The xalan ExtensionHandler executes something like this: ObjectFactory.findProviderClass(className,
ObjectFactory.findClassLoader(), true)

* The className has the format "java:org.portletbridge.portlet.BridgeFunctions" ( I am embedding
the OSGI container into Liferay portal :) )

* The extension manager have already added the extension loader to the classloader

{code}
  Felix.m_secureAction.addURLToURLClassLoader(Felix.m_secureAction.createURL(Felix.m_secureAction.createURL(null,
"http:", extensionManager),"http://felix.extensions:9/", extensionManager),Felix.class.getClassLoader());
{code}

* When the classloader try to resolve the "java:org.portletbridge.portlet.BridgeFunctions"
the previous loader added by the ExtensionManager cause an unhandled error.

In sun.misc.URL

{code}
    public Resource getResource(String name, boolean check) {
        if (DEBUG) {
            System.err.println("URLClassPath.getResource(\"" + name + "\")");
        }

        Loader loader;
        for (int i = 0; (loader = getLoader(i)) != null; i++) {
            Resource res = loader.getResource(name, check);
            if (res != null) {
                return res;
            }
        }
        return null;
    }
{code}

In the previous code, the loader injected by the framework is causing an IllegalArgumentException,
so instead of returning a null value.

Let me know if you need some more details.

    
> Extension Bundle system adds loader to the classloader which can make other libraries
to fail
> ---------------------------------------------------------------------------------------------
>
>                 Key: FELIX-3696
>                 URL: https://issues.apache.org/jira/browse/FELIX-3696
>             Project: Felix
>          Issue Type: Bug
>    Affects Versions: framework-4.0.2
>            Reporter: Miguel Ángel Pastor Olivar
>
> I am embedding Apache Felix (and Equinox because I would like to switch depending on
the application server I am running on).
> * The xalan ExtensionHandler executes something like this: ObjectFactory.findProviderClass(className,
ObjectFactory.findClassLoader(), true)
> * The className has the format "java:org.portletbridge.portlet.BridgeFunctions" ( I am
embedding the OSGI container into Liferay portal :) )
> * The extension manager have already added the extension loader to the classloader
> {code}
>   Felix.m_secureAction.addURLToURLClassLoader(Felix.m_secureAction.createURL(Felix.m_secureAction.createURL(null,
"http:", extensionManager),"http://felix.extensions:9/", extensionManager),Felix.class.getClassLoader());
> {code}
> * When the classloader try to resolve the "java:org.portletbridge.portlet.BridgeFunctions"
the previous loader added by the ExtensionManager cause an unhandled error.
> In sun.misc.URL
> {code}
>     public Resource getResource(String name, boolean check) {
>         if (DEBUG) {
>             System.err.println("URLClassPath.getResource(\"" + name + "\")");
>         }
>         Loader loader;
>         for (int i = 0; (loader = getLoader(i)) != null; i++) {
>             Resource res = loader.getResource(name, check);
>             if (res != null) {
>                 return res;
>             }
>         }
>         return null;
>     }
> {code}
> In the previous code, the loader injected by the framework is causing an IllegalArgumentException
here:
> Resource res = loader.getResource(name, check); (instead of returning null)
> Let me know if you need some more details.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message