Could you please raise a JIRA issue for that ? It seems to me that such use case should work out of the box.
On Mon, Jul 30, 2012 at 3:55 PM, Huylebroeck Johan <[email protected] > wrote: > Hi all,**** > > ** ** > > I’m using apache aries 0.3.2 and I was trying to load a script from the > bundle like this: **** > > ** ** > > <bean id=*"script"* factory-ref=*"blueprintBundle"* factory-method=* > "getEntry"*>**** > > <argument value=*"scripts/myScript"*/>**** > > </bean>**** > > ** ** > > But it fails with this nice 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.**** > > ** ** > > I was wondering if using the blueprintBundle (or context/container) > directly as a factory bean is legal and this should work? **** > > or is my current workaround (inject the bundle in a wrapper bean and > delegating the lookup to this bean) the way to go?**** > > ** ** > > ** ** > > Kind regards,**** > > ** ** > > Johan Huylebroeck**** > > **** > > http://www.i8c.be/integr8-consulting**** > > ** ** > > ** ** > > ** ** > -- ------------------------ Guillaume Nodet ------------------------ Blog: http://gnodet.blogspot.com/ ------------------------ FuseSource, Integration everywhere http://fusesource.com
