You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Alasdair Nottingham (JIRA)" <ji...@apache.org> on 2010/12/23 22:41:45 UTC
[jira] Created: (ARIES-526) NPE from ServiceRecipe when proxying
JDK classes
NPE from ServiceRecipe when proxying JDK classes
------------------------------------------------
Key: ARIES-526
URL: https://issues.apache.org/jira/browse/ARIES-526
Project: Aries
Issue Type: Bug
Components: Blueprint
Affects Versions: 0.3
Reporter: Alasdair Nottingham
Assignee: Alasdair Nottingham
Fix For: 0.3
The ProxyManager expects to be given a non-null Bundle when generating the proxy. Currently in some scenarios Blueprint can pass in null. Causing the following:
[12/23/10 13:52:26:537 GMT] 00000017 ServiceRecipe I org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory getService A problem occurred trying to create a proxy object. Returning the original object instead.
java.lang.NullPointerException
at org.apache.aries.proxy.impl.AbstractProxyManager.getClassLoader(AbstractProxyManager.java:83)
at org.apache.aries.proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:84)
at org.apache.aries.proxy.impl.AbstractProxyManager.createProxy(AbstractProxyManager.java:50)
at org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:463)
at org.eclipse.osgi.internal.serviceregistry.ServiceUse$1.run(ServiceUse.java:120)
at java.security.AccessController.doPrivileged(AccessController.java:203)
This is caused because in TriggerServiceFactory it calls FrameworkUtil.getBundle() this returns null if the class isn't loaded from a bundle, e.g. is from the JDK, so proxying doesn't work. In this scenario we should use the blueprint bundle instead to generate the proxy.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (ARIES-526) NPE from ServiceRecipe when proxying
JDK classes
Posted by "Alasdair Nottingham (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/ARIES-526?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alasdair Nottingham resolved ARIES-526.
---------------------------------------
Resolution: Fixed
> NPE from ServiceRecipe when proxying JDK classes
> ------------------------------------------------
>
> Key: ARIES-526
> URL: https://issues.apache.org/jira/browse/ARIES-526
> Project: Aries
> Issue Type: Bug
> Components: Blueprint
> Affects Versions: 0.3
> Reporter: Alasdair Nottingham
> Assignee: Alasdair Nottingham
> Fix For: 0.3
>
>
> The ProxyManager expects to be given a non-null Bundle when generating the proxy. Currently in some scenarios Blueprint can pass in null. Causing the following:
> [12/23/10 13:52:26:537 GMT] 00000017 ServiceRecipe I org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory getService A problem occurred trying to create a proxy object. Returning the original object instead.
> java.lang.NullPointerException
> at org.apache.aries.proxy.impl.AbstractProxyManager.getClassLoader(AbstractProxyManager.java:83)
> at org.apache.aries.proxy.impl.AsmProxyManager.createNewProxy(AsmProxyManager.java:84)
> at org.apache.aries.proxy.impl.AbstractProxyManager.createProxy(AbstractProxyManager.java:50)
> at org.apache.aries.blueprint.container.ServiceRecipe$TriggerServiceFactory.getService(ServiceRecipe.java:463)
> at org.eclipse.osgi.internal.serviceregistry.ServiceUse$1.run(ServiceUse.java:120)
> at java.security.AccessController.doPrivileged(AccessController.java:203)
> This is caused because in TriggerServiceFactory it calls FrameworkUtil.getBundle() this returns null if the class isn't loaded from a bundle, e.g. is from the JDK, so proxying doesn't work. In this scenario we should use the blueprint bundle instead to generate the proxy.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.