You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Balazs Zsoldos (JIRA)" <ji...@apache.org> on 2011/07/06 15:51:16 UTC

[jira] [Updated] (ARIES-704) BundleToClassLoaderAdapter does not implement loadClass(String, boolean)

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

Balazs Zsoldos updated ARIES-704:
---------------------------------

    Attachment: BundleToClassLoaderAdapter fix.patch

The patch I created simply implements the loadClass(String, boolean) in a way that if the parameter resolved is true it throws an unsupported exception otherwise the original behavior will be done.

> BundleToClassLoaderAdapter does not implement loadClass(String, boolean)
> ------------------------------------------------------------------------
>
>                 Key: ARIES-704
>                 URL: https://issues.apache.org/jira/browse/ARIES-704
>             Project: Aries
>          Issue Type: Bug
>          Components: Util
>         Environment: Glassfish 3.1, aries-eclipselink-adapter, JDK 1.6.0_26
>            Reporter: Balazs Zsoldos
>         Attachments: BundleToClassLoaderAdapter fix.patch
>
>
> When there is a loadClass(String) to a classloader it simply calls loadClass(String, boolean). The second function checks if a class is available in the parent classloader by checking loadClass(String, boolean). If BundleToClassLoader adapter is used for a ClassLoader as the parent, the loadClass(String) will never be called.
> Here is a sample stacktrace ( line numbers from JDK 1.6.0_26):
> at org.apache.felix.framework.ModuleImpl.findClassOrResourceByDelegation(ModuleImpl.java:787)
> 	at org.apache.felix.framework.ModuleImpl.access$400(ModuleImpl.java:71)
> 	at org.apache.felix.framework.ModuleImpl$ModuleClassLoader.loadClass(ModuleImpl.java:1768)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> 	at org.apache.aries.jpa.eclipselink.adapter.Activator$PersistenceUnitProxyWithTargetServer$1.findClass(Activator.java:102)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
> 	at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
> 	at java.lang.Class.forName0(Native Method)
> 	at java.lang.Class.forName(Class.java:247)
> 	at org.eclipse.persistence.internal.security.PrivilegedAccessHelper.getClassForName(PrivilegedAccessHelper.java:93)
> 	at org.eclipse.persistence.descriptors.ClassDescriptor.convertClassNamesToClasses(ClassDescriptor.java:1258)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira