aries-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guillaume Nodet (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (ARIES-894) Unable to access public methods overriden/implemented in a protected class
Date Wed, 01 Aug 2012 07:48:36 GMT

    [ https://issues.apache.org/jira/browse/ARIES-894?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13426364#comment-13426364
] 

Guillaume Nodet commented on ARIES-894:
---------------------------------------

Improve perfs with http://svn.apache.org/viewvc?rev=1367686&view=rev
                
> Unable to access public methods overriden/implemented in a protected class
> --------------------------------------------------------------------------
>
>                 Key: ARIES-894
>                 URL: https://issues.apache.org/jira/browse/ARIES-894
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>    Affects Versions: blueprint-0.3.1
>            Reporter: Johan Huylebroeck
>            Assignee: Guillaume Nodet
>              Labels: patch
>             Fix For: blueprint-core-1.0.1
>
>         Attachments: aries-894.patch.gz, aries-894.patch.gz
>
>
> I’m using apache aries 0.3.2 and I was trying to lookup a script in the bundle like
this: 
> <bean id="script" factory-ref="blueprintBundle" factory-method="getEntry">
>        <argument value="scripts/myScript"/>
> </bean>
> But it fails with this exception:
> java.lang.IllegalAccessException: Class org.apache.aries.blueprint.utils.ReflectionUtils
can not access a member of class org.apache.felix.framework.BundleImpl with modifiers "public"
>                 at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)[:1.6.0_32]
>                 at java.lang.reflect.Method.invoke(Method.java:588)[:1.6.0_32]
>                 at org.apache.aries.blueprint.utils.ReflectionUtils.invoke(ReflectionUtils.java:225)[10:org.apache.aries.blueprint:0.3.2]
>                 at org.apache.aries.blueprint.container.BeanRecipe.invoke(BeanRecipe.java:838)[10:org.apache.aries.blueprint:0.3.2]
>                 at org.apache.aries.blueprint.container.BeanRecipe.getInstance(BeanRecipe.java:236)[10:org.apache.aries.blueprint:0.3.2]
>                 ... 15 more
> The problem seems to be that the factory method is resolved against the implementation
class BundleImpl which is package private and not the interface org.osgi.framework.Bundle
which is public.
> There is a workaround by injecting the bundle in a wrapper bean and using this bean to
do the lookup.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

Mime
View raw message