You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Keith Hughes <ke...@gmail.com> on 2012/10/31 23:05:12 UTC

Android, boot delegation, and preverification

Hi folks,

I have an Android application based on Apache Felix. Everything works fine
when I run things on Linux, but as soon as I try moving to Android I run
into a problem.

My app uses Apache Commons Logging in all of its bundles. I have included a
bundle for Apache Commons Logging as a bundle as well.

When the container starts up I get the following stack trace which seems to
point out that it is accessing the org/apache/commons/logging/Log in the
Android system libraries.
<ht...@felix.apache.org>
10-31 15:43:53.251: W/dalvikvm(5034): Class resolved by unexpected DEX:
Linterac
tivespaces/configuration/FileSystemConfigurationStorageManager;(0x41747380):0x64
d0b000 ref [Lorg/apache/commons/logging/Log;]
Lorg/apache/commons/logging/Log;(0x417498d8):0x64d34000
10-31 15:43:53.251: W/dalvikvm(5034):
(Linteractivespaces/configuration/FileSystemConfigurationStorageManager;
had used a different Lorg/apache/commons/logging/Log; during
pre-verification)
10-31 15:43:53.251: W/System.err(5034): Exception
bootstrap/interactivespaces-system-1.2.0.jar
10-31 15:43:53.251: W/System.err(5034): org.osgi.framework.BundleException:
Activator start error in bundle interactivespaces.system [24].
10-31 15:43:53.251: W/System.err(5034):         at
org.apache.felix.framework.Felix.activateBundle(Felix.java:2027)
10-31 15:43:53.251: W/System.err(5034):         at
org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
10-31 15:43:53.251: W/System.err(5034):         at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
10-31 15:43:53.251: W/System.err(5034):         at
org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)
10-31 15:43:53.251: W/System.err(5034):         at
interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundle(InteractiveSpacesFrameworkAndroidBootstrap.java:188)
10-31 15:43:53.251: W/System.err(5034):         at
interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundles(InteractiveSpacesFrameworkAndroidBootstrap.java:173)
10-31 15:43:53.251: W/System.err(5034):         at
interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.boot(InteractiveSpacesFrameworkAndroidBootstrap.java:124)
10-31 15:43:53.261: W/System.err(5034):         at
interactivespaces.android.service.InteractiveSpacesService.onStartCommand(InteractiveSpacesService.java:67)
10-31 15:43:53.261: W/System.err(5034):         at
android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2490)
10-31 15:43:53.261: W/System.err(5034):         at
android.app.ActivityThread.access$1900(ActivityThread.java:130)
10-31 15:43:53.261: W/System.err(5034):         at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
10-31 15:43:53.261: W/System.err(5034):         at
android.os.Handler.dispatchMessage(Handler.java:99)
10-31 15:43:53.261: W/System.err(5034):         at
android.os.Looper.loop(Looper.java:137)
10-31 15:43:53.261: W/System.err(5034):         at
android.app.ActivityThread.main(ActivityThread.java:4745)
10-31 15:43:53.261: W/System.err(5034):         at
java.lang.reflect.Method.invokeNative(Native Method)
10-31 15:43:53.261: W/System.err(5034):         at
java.lang.reflect.Method.invoke(Method.java:511)
10-31 15:43:53.261: W/System.err(5034):         at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
10-31 15:43:53.261: W/System.err(5034):         at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
10-31 15:43:53.261: W/System.err(5034):         at
dalvik.system.NativeStart.main(Native Method)
10-31 15:43:53.261: W/System.err(5034): Caused by:
java.lang.IllegalAccessError: Class ref in pre-verified class resolved to
unexpected implementation
10-31 15:43:53.261: W/System.err(5034):         at
interactivespaces.configuration.FileSystemConfigurationStorageManager.loadConfigFile(FileSystemConfigurationStorageManager.java:105)
10-31 15:43:53.261: W/System.err(5034):         at
interactivespaces.configuration.FileSystemConfigurationStorageManager.startup(FileSystemConfigurationStorageManager.java:82)
10-31 15:43:53.261: W/System.err(5034):         at
interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSystemConfiguration(GeneralInteractiveSpacesSupportActivator.java:315)
10-31 15:43:53.261: W/System.err(5034):         at
interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSpaceEnvironment(GeneralInteractiveSpacesSupportActivator.java:216)
10-31 15:43:53.261: W/System.err(5034):         at
interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.start(GeneralInteractiveSpacesSupportActivator.java:143)
10-31 15:43:53.261: W/System.err(5034):         at
org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
10-31 15:43:53.261: W/System.err(5034):         at
org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
10-31 15:43:53.261: W/System.err(5034):         ... 18 more

I have tried experimenting with all of the legal values of the Bundle
Parent configuration property to no avail.

How can I tell Felix to ignore Commons Logging from the system boot path
and only use the one from the bundle?

Re: Android, boot delegation, and preverification

Posted by Karl Pauls <ka...@gmail.com>.
On Mon, Nov 26, 2012 at 8:38 PM, Keith Hughes <ke...@gmail.com>wrote:

> >
> > Did you try with the latest felix trunk? I think i have that fixed, i.e.,
> > you should not have to set it to false anymore with the current trunk....
> >
>
> I have some problems running in the latest version of Felix due to some
> things finally being done correctly w/respect to javax classes, in
> particular javax.transaction. Once I sort that out I will update to the
> latest version of Felix.


Ok, let me know if it is working for you (it should). There are a couple of
fixes in trunk in regard to android so it probably makes sense for you to
update :-)


> Great. If you have the time it would be great if you write something up and
> > contribute it so that we can put it on the felix documentation page :-)
>
>
> Sure. Which page, so I can get a good idea of what to write by looking at
> examples?
>

Well, there is a really old one around:

http://felix.apache.org/site/apache-felix-framework-and-google-android.html

but really, anything you can get together to help people that want to run
on android would be really welcome :-)

regards,

Karl

-- 
Karl Pauls
karlpauls@gmail.com
http://twitter.com/karlpauls
http://www.linkedin.com/in/karlpauls
https://profiles.google.com/karlpauls

Re: Android, boot delegation, and preverification

Posted by Keith Hughes <ke...@gmail.com>.
>
> Did you try with the latest felix trunk? I think i have that fixed, i.e.,
> you should not have to set it to false anymore with the current trunk....
>

I have some problems running in the latest version of Felix due to some
things finally being done correctly w/respect to javax classes, in
particular javax.transaction. Once I sort that out I will update to the
latest version of Felix.

Great. If you have the time it would be great if you write something up and
> contribute it so that we can put it on the felix documentation page :-)


Sure. Which page, so I can get a good idea of what to write by looking at
examples?

Re: Android, boot delegation, and preverification

Posted by Karl Pauls <ka...@gmail.com>.
On Mon, Nov 26, 2012 at 6:32 PM, Keith Hughes <ke...@gmail.com>wrote:

> OK, it finally all works.
>
> What I ended up having to do is take my core bundles and just make them
> part of the executable rather than dynamically loaded through OSGi. Once I
> did this I was able to get everything running, even the dynamic part which
> uses OSGi. There are a lot of Android log messages warning  about some
> pieces of code being skipped, I suspect that is the version of commons
> logging that I include (as well as Commons HTTP Client).
>
> The only other problem I ran into was a MalformedUrlException because http
> wasn't being recognized as a registered protocol. Turned out I needed to
> set the following property for the OSGi
> container: felix.service.urlhandlers = false.
>

Did you try with the latest felix trunk? I think i have that fixed, i.e.,
you should not have to set it to false anymore with the current trunk....


> In case others are interested, I ported the Interactive Spaces controller
> to Android.
>
> https://code.google.com/p/interactive-spaces/
>
> I can now start up the Android controller, have it connect to the master,
> and deploy activities to the Android device through the IS master. This
> means I can use Android devices in the interactive physical space.



Great. If you have the time it would be great if you write something up and
contribute it so that we can put it on the felix documentation page :-)

regards,

Karl


>
>
>
> On Mon, Nov 19, 2012 at 3:23 PM, Karl Pauls <ka...@gmail.com> wrote:
>
> > you can update bundles :-)
> >
> > regards,
> >
> > Karl
> >
> >
> > On Mon, Nov 19, 2012 at 6:19 PM, Keith Hughes <keith.mhughes@gmail.com
> > >wrote:
> >
> > > One final question, Karl, and I will leave you be... for now. :-)
> > >
> > > So I do have Felix working on Android and see things starting to work
> > with
> > > bundles being resolved and activated, which is good, so I know I can
> get
> > a
> > > static container running (once I modify my jars for commons logging).
> > >
> > > Is it possible to refresh a bundle under Felix on Android so that a new
> > > version of the bundle comes in from the outside and gets itself
> properly
> > > setup? Or, because of the way that Dalvik works, can you only run a
> > static
> > > OSGi container with a set of start bundles and maybe a deploy of a new
> > > bundle, but no updating an old bundle?
> > >
> > >
> > >
> > > On Mon, Nov 19, 2012 at 8:31 AM, Keith Hughes <keith.mhughes@gmail.com
> > > >wrote:
> > >
> > > > I was thinking about that as a possibility, but am trying to avoid
> that
> > > as
> > > > it will make my build process even worse.
> > > >
> > > > I am going to contact members of the Android team to see if they can
> > > > suggest anything. I will respond with what they say.
> > > >
> > > >
> > > >
> > > > On Mon, Nov 19, 2012 at 3:15 AM, Karl Pauls <ka...@gmail.com>
> > wrote:
> > > >
> > > >> I guess you have to patch the commons-logging jar and remove the
> > classes
> > > >> already provided by android, no?
> > > >>
> > > >> regards,
> > > >>
> > > >> Karl
> > > >>
> > > >>
> > > >> On Mon, Nov 19, 2012 at 3:05 AM, Keith Hughes <
> > keith.mhughes@gmail.com
> > > >> >wrote:
> > > >>
> > > >> > Karl,
> > > >> >
> > > >> > I thought I had this sorted, but apparently not.
> > > >> >
> > > >> > Part of the problem is that Android only supplies the Commons
> > Logging
> > > >> Log
> > > >> > interface and nothing else. If I want/need any of the other
> classes
> > > from
> > > >> > the same package I am kinda doomed.
> > > >> >
> > > >> > I tried moving commons logging into the libs folder, but dx
> > complains
> > > >> that
> > > >> > it has the same class twice, once from my jar and I guess once
> from
> > > the
> > > >> > Android runtime.
> > > >> >
> > > >> > Argh. Classloader problems are bad enough, but to have this as
> well.
> > > >> >
> > > >> >
> > > >> >
> > > >> > On Thu, Nov 1, 2012 at 2:31 AM, Karl Pauls <ka...@gmail.com>
> > > wrote:
> > > >> >
> > > >> > > Part of your problem is that android/davlik is not Java. It
> > doesn't
> > > >> > > follow normal Java classloading rules. Where that bites us from
> an
> > > >> > > OSGi pov is that you can't just substitute providers. In your
> > case,
> > > >> > > you might be able to get things to work by removing the imports
> of
> > > >> > > bundles to commons logging but typically the only way to make
> > things
> > > >> > > work is to make sure you only have one provider of a given
> package
> > > --
> > > >> > > hence, I'd remove commons logging from all bundles and put it in
> > the
> > > >> > > apk itself and have it bootdelegated.
> > > >> > >
> > > >> > > regards,
> > > >> > >
> > > >> > > Karl
> > > >> > >
> > > >> > > On Wed, Oct 31, 2012 at 11:05 PM, Keith Hughes <
> > > >> keith.mhughes@gmail.com>
> > > >> > > wrote:
> > > >> > > > Hi folks,
> > > >> > > >
> > > >> > > > I have an Android application based on Apache Felix.
> Everything
> > > >> works
> > > >> > > fine
> > > >> > > > when I run things on Linux, but as soon as I try moving to
> > > Android I
> > > >> > run
> > > >> > > > into a problem.
> > > >> > > >
> > > >> > > > My app uses Apache Commons Logging in all of its bundles. I
> have
> > > >> > > included a
> > > >> > > > bundle for Apache Commons Logging as a bundle as well.
> > > >> > > >
> > > >> > > > When the container starts up I get the following stack trace
> > which
> > > >> > seems
> > > >> > > to
> > > >> > > > point out that it is accessing the
> > org/apache/commons/logging/Log
> > > in
> > > >> > the
> > > >> > > > Android system libraries.
> > > >> > > > <
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> https://mail.google.com/mail/?view=cm&fs=1&tf=1&source=mailto&to=users-subscribe@felix.apache.org
> > > >> > > >
> > > >> > > > 10-31 15:43:53.251: W/dalvikvm(5034): Class resolved by
> > unexpected
> > > >> DEX:
> > > >> > > > Linterac
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> tivespaces/configuration/FileSystemConfigurationStorageManager;(0x41747380):0x64
> > > >> > > > d0b000 ref [Lorg/apache/commons/logging/Log;]
> > > >> > > > Lorg/apache/commons/logging/Log;(0x417498d8):0x64d34000
> > > >> > > > 10-31 15:43:53.251: W/dalvikvm(5034):
> > > >> > > >
> > > >> >
> > >
> (Linteractivespaces/configuration/FileSystemConfigurationStorageManager;
> > > >> > > > had used a different Lorg/apache/commons/logging/Log; during
> > > >> > > > pre-verification)
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034): Exception
> > > >> > > > bootstrap/interactivespaces-system-1.2.0.jar
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034):
> > > >> > > org.osgi.framework.BundleException:
> > > >> > > > Activator start error in bundle interactivespaces.system [24].
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >> > > >
> org.apache.felix.framework.Felix.activateBundle(Felix.java:2027)
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >> > > > org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >> > > >
> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >> > > >
> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundle(InteractiveSpacesFrameworkAndroidBootstrap.java:188)
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundles(InteractiveSpacesFrameworkAndroidBootstrap.java:173)
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.boot(InteractiveSpacesFrameworkAndroidBootstrap.java:124)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.android.service.InteractiveSpacesService.onStartCommand(InteractiveSpacesService.java:67)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >>
> android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2490)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> android.app.ActivityThread.access$1900(ActivityThread.java:130)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > > android.os.Handler.dispatchMessage(Handler.java:99)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > > android.os.Looper.loop(Looper.java:137)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > > android.app.ActivityThread.main(ActivityThread.java:4745)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > > java.lang.reflect.Method.invokeNative(Native Method)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > > java.lang.reflect.Method.invoke(Method.java:511)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > > dalvik.system.NativeStart.main(Native Method)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034): Caused by:
> > > >> > > > java.lang.IllegalAccessError: Class ref in pre-verified class
> > > >> resolved
> > > >> > to
> > > >> > > > unexpected implementation
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.configuration.FileSystemConfigurationStorageManager.loadConfigFile(FileSystemConfigurationStorageManager.java:105)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.configuration.FileSystemConfigurationStorageManager.startup(FileSystemConfigurationStorageManager.java:82)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSystemConfiguration(GeneralInteractiveSpacesSupportActivator.java:315)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSpaceEnvironment(GeneralInteractiveSpacesSupportActivator.java:216)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.start(GeneralInteractiveSpacesSupportActivator.java:143)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         ... 18 more
> > > >> > > >
> > > >> > > > I have tried experimenting with all of the legal values of the
> > > >> Bundle
> > > >> > > > Parent configuration property to no avail.
> > > >> > > >
> > > >> > > > How can I tell Felix to ignore Commons Logging from the system
> > > boot
> > > >> > path
> > > >> > > > and only use the one from the bundle?
> > > >> > >
> > > >> > >
> > > >> > >
> > > >> > > --
> > > >> > > Karl Pauls
> > > >> > > karlpauls@gmail.com
> > > >> > > http://twitter.com/karlpauls
> > > >> > > http://www.linkedin.com/in/karlpauls
> > > >> > > https://profiles.google.com/karlpauls
> > > >> > >
> > > >> > >
> > > ---------------------------------------------------------------------
> > > >> > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > > >> > > For additional commands, e-mail: users-help@felix.apache.org
> > > >> > >
> > > >> > >
> > > >> >
> > > >>
> > > >>
> > > >>
> > > >> --
> > > >> Karl Pauls
> > > >> karlpauls@gmail.com
> > > >> http://twitter.com/karlpauls
> > > >> http://www.linkedin.com/in/karlpauls
> > > >> https://profiles.google.com/karlpauls
> > > >>
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > Karl Pauls
> > karlpauls@gmail.com
> > http://twitter.com/karlpauls
> > http://www.linkedin.com/in/karlpauls
> > https://profiles.google.com/karlpauls
> >
>



-- 
Karl Pauls
karlpauls@gmail.com
http://twitter.com/karlpauls
http://www.linkedin.com/in/karlpauls
https://profiles.google.com/karlpauls

Re: Android, boot delegation, and preverification

Posted by Keith Hughes <ke...@gmail.com>.
OK, it finally all works.

What I ended up having to do is take my core bundles and just make them
part of the executable rather than dynamically loaded through OSGi. Once I
did this I was able to get everything running, even the dynamic part which
uses OSGi. There are a lot of Android log messages warning  about some
pieces of code being skipped, I suspect that is the version of commons
logging that I include (as well as Commons HTTP Client).

The only other problem I ran into was a MalformedUrlException because http
wasn't being recognized as a registered protocol. Turned out I needed to
set the following property for the OSGi
container: felix.service.urlhandlers = false.

In case others are interested, I ported the Interactive Spaces controller
to Android.

https://code.google.com/p/interactive-spaces/

I can now start up the Android controller, have it connect to the master,
and deploy activities to the Android device through the IS master. This
means I can use Android devices in the interactive physical space.




On Mon, Nov 19, 2012 at 3:23 PM, Karl Pauls <ka...@gmail.com> wrote:

> you can update bundles :-)
>
> regards,
>
> Karl
>
>
> On Mon, Nov 19, 2012 at 6:19 PM, Keith Hughes <keith.mhughes@gmail.com
> >wrote:
>
> > One final question, Karl, and I will leave you be... for now. :-)
> >
> > So I do have Felix working on Android and see things starting to work
> with
> > bundles being resolved and activated, which is good, so I know I can get
> a
> > static container running (once I modify my jars for commons logging).
> >
> > Is it possible to refresh a bundle under Felix on Android so that a new
> > version of the bundle comes in from the outside and gets itself properly
> > setup? Or, because of the way that Dalvik works, can you only run a
> static
> > OSGi container with a set of start bundles and maybe a deploy of a new
> > bundle, but no updating an old bundle?
> >
> >
> >
> > On Mon, Nov 19, 2012 at 8:31 AM, Keith Hughes <keith.mhughes@gmail.com
> > >wrote:
> >
> > > I was thinking about that as a possibility, but am trying to avoid that
> > as
> > > it will make my build process even worse.
> > >
> > > I am going to contact members of the Android team to see if they can
> > > suggest anything. I will respond with what they say.
> > >
> > >
> > >
> > > On Mon, Nov 19, 2012 at 3:15 AM, Karl Pauls <ka...@gmail.com>
> wrote:
> > >
> > >> I guess you have to patch the commons-logging jar and remove the
> classes
> > >> already provided by android, no?
> > >>
> > >> regards,
> > >>
> > >> Karl
> > >>
> > >>
> > >> On Mon, Nov 19, 2012 at 3:05 AM, Keith Hughes <
> keith.mhughes@gmail.com
> > >> >wrote:
> > >>
> > >> > Karl,
> > >> >
> > >> > I thought I had this sorted, but apparently not.
> > >> >
> > >> > Part of the problem is that Android only supplies the Commons
> Logging
> > >> Log
> > >> > interface and nothing else. If I want/need any of the other classes
> > from
> > >> > the same package I am kinda doomed.
> > >> >
> > >> > I tried moving commons logging into the libs folder, but dx
> complains
> > >> that
> > >> > it has the same class twice, once from my jar and I guess once from
> > the
> > >> > Android runtime.
> > >> >
> > >> > Argh. Classloader problems are bad enough, but to have this as well.
> > >> >
> > >> >
> > >> >
> > >> > On Thu, Nov 1, 2012 at 2:31 AM, Karl Pauls <ka...@gmail.com>
> > wrote:
> > >> >
> > >> > > Part of your problem is that android/davlik is not Java. It
> doesn't
> > >> > > follow normal Java classloading rules. Where that bites us from an
> > >> > > OSGi pov is that you can't just substitute providers. In your
> case,
> > >> > > you might be able to get things to work by removing the imports of
> > >> > > bundles to commons logging but typically the only way to make
> things
> > >> > > work is to make sure you only have one provider of a given package
> > --
> > >> > > hence, I'd remove commons logging from all bundles and put it in
> the
> > >> > > apk itself and have it bootdelegated.
> > >> > >
> > >> > > regards,
> > >> > >
> > >> > > Karl
> > >> > >
> > >> > > On Wed, Oct 31, 2012 at 11:05 PM, Keith Hughes <
> > >> keith.mhughes@gmail.com>
> > >> > > wrote:
> > >> > > > Hi folks,
> > >> > > >
> > >> > > > I have an Android application based on Apache Felix. Everything
> > >> works
> > >> > > fine
> > >> > > > when I run things on Linux, but as soon as I try moving to
> > Android I
> > >> > run
> > >> > > > into a problem.
> > >> > > >
> > >> > > > My app uses Apache Commons Logging in all of its bundles. I have
> > >> > > included a
> > >> > > > bundle for Apache Commons Logging as a bundle as well.
> > >> > > >
> > >> > > > When the container starts up I get the following stack trace
> which
> > >> > seems
> > >> > > to
> > >> > > > point out that it is accessing the
> org/apache/commons/logging/Log
> > in
> > >> > the
> > >> > > > Android system libraries.
> > >> > > > <
> > >> > >
> > >> >
> > >>
> >
> https://mail.google.com/mail/?view=cm&fs=1&tf=1&source=mailto&to=users-subscribe@felix.apache.org
> > >> > > >
> > >> > > > 10-31 15:43:53.251: W/dalvikvm(5034): Class resolved by
> unexpected
> > >> DEX:
> > >> > > > Linterac
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> tivespaces/configuration/FileSystemConfigurationStorageManager;(0x41747380):0x64
> > >> > > > d0b000 ref [Lorg/apache/commons/logging/Log;]
> > >> > > > Lorg/apache/commons/logging/Log;(0x417498d8):0x64d34000
> > >> > > > 10-31 15:43:53.251: W/dalvikvm(5034):
> > >> > > >
> > >> >
> > (Linteractivespaces/configuration/FileSystemConfigurationStorageManager;
> > >> > > > had used a different Lorg/apache/commons/logging/Log; during
> > >> > > > pre-verification)
> > >> > > > 10-31 15:43:53.251: W/System.err(5034): Exception
> > >> > > > bootstrap/interactivespaces-system-1.2.0.jar
> > >> > > > 10-31 15:43:53.251: W/System.err(5034):
> > >> > > org.osgi.framework.BundleException:
> > >> > > > Activator start error in bundle interactivespaces.system [24].
> > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >> > > > org.apache.felix.framework.Felix.activateBundle(Felix.java:2027)
> > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >> > > > org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
> > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >> > > > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
> > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >> > > > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)
> > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundle(InteractiveSpacesFrameworkAndroidBootstrap.java:188)
> > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundles(InteractiveSpacesFrameworkAndroidBootstrap.java:173)
> > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.boot(InteractiveSpacesFrameworkAndroidBootstrap.java:124)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.android.service.InteractiveSpacesService.onStartCommand(InteractiveSpacesService.java:67)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2490)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > android.app.ActivityThread.access$1900(ActivityThread.java:130)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > android.os.Handler.dispatchMessage(Handler.java:99)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > android.os.Looper.loop(Looper.java:137)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > android.app.ActivityThread.main(ActivityThread.java:4745)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > java.lang.reflect.Method.invokeNative(Native Method)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > java.lang.reflect.Method.invoke(Method.java:511)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > dalvik.system.NativeStart.main(Native Method)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034): Caused by:
> > >> > > > java.lang.IllegalAccessError: Class ref in pre-verified class
> > >> resolved
> > >> > to
> > >> > > > unexpected implementation
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.configuration.FileSystemConfigurationStorageManager.loadConfigFile(FileSystemConfigurationStorageManager.java:105)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.configuration.FileSystemConfigurationStorageManager.startup(FileSystemConfigurationStorageManager.java:82)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSystemConfiguration(GeneralInteractiveSpacesSupportActivator.java:315)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSpaceEnvironment(GeneralInteractiveSpacesSupportActivator.java:216)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.start(GeneralInteractiveSpacesSupportActivator.java:143)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         ... 18 more
> > >> > > >
> > >> > > > I have tried experimenting with all of the legal values of the
> > >> Bundle
> > >> > > > Parent configuration property to no avail.
> > >> > > >
> > >> > > > How can I tell Felix to ignore Commons Logging from the system
> > boot
> > >> > path
> > >> > > > and only use the one from the bundle?
> > >> > >
> > >> > >
> > >> > >
> > >> > > --
> > >> > > Karl Pauls
> > >> > > karlpauls@gmail.com
> > >> > > http://twitter.com/karlpauls
> > >> > > http://www.linkedin.com/in/karlpauls
> > >> > > https://profiles.google.com/karlpauls
> > >> > >
> > >> > >
> > ---------------------------------------------------------------------
> > >> > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > >> > > For additional commands, e-mail: users-help@felix.apache.org
> > >> > >
> > >> > >
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Karl Pauls
> > >> karlpauls@gmail.com
> > >> http://twitter.com/karlpauls
> > >> http://www.linkedin.com/in/karlpauls
> > >> https://profiles.google.com/karlpauls
> > >>
> > >
> > >
> >
>
>
>
> --
> Karl Pauls
> karlpauls@gmail.com
> http://twitter.com/karlpauls
> http://www.linkedin.com/in/karlpauls
> https://profiles.google.com/karlpauls
>

Re: Android, boot delegation, and preverification

Posted by Karl Pauls <ka...@gmail.com>.
puh, no idea from the top of my head. I might have a backup somewhere but i
doubt i'll find it quickly (somewhat low on time atm). A quick google did
find this:

http://code.google.com/p/qlibrary/source/browse/osgi/?r=202#osgi%2Ffelix%2Fluminis

looks like what we had minus the shapes themselves (but they shouldn't
matter much). Notice, I don't know who that is nor why or what he put
there. Maybe try that and ping me back if it doesn't work :-)


regards,

Karl


On Tue, Nov 20, 2012 at 9:48 PM, Keith Hughes <ke...@gmail.com>wrote:

> Karl,
>
> I found a slide deck of yours talking about having the shapes OSGi example
> running as bundles under OSGi on Android. It mentioned
> http://opensource.luminis.net/ to get the source for the example, but the
> page seems to just have the host name. Where would I find that code?
>
> Thanks,
> -Keith
>
>
>
> On Mon, Nov 19, 2012 at 3:23 PM, Karl Pauls <ka...@gmail.com> wrote:
>
> > you can update bundles :-)
> >
> > regards,
> >
> > Karl
> >
> >
> > On Mon, Nov 19, 2012 at 6:19 PM, Keith Hughes <keith.mhughes@gmail.com
> > >wrote:
> >
> > > One final question, Karl, and I will leave you be... for now. :-)
> > >
> > > So I do have Felix working on Android and see things starting to work
> > with
> > > bundles being resolved and activated, which is good, so I know I can
> get
> > a
> > > static container running (once I modify my jars for commons logging).
> > >
> > > Is it possible to refresh a bundle under Felix on Android so that a new
> > > version of the bundle comes in from the outside and gets itself
> properly
> > > setup? Or, because of the way that Dalvik works, can you only run a
> > static
> > > OSGi container with a set of start bundles and maybe a deploy of a new
> > > bundle, but no updating an old bundle?
> > >
> > >
> > >
> > > On Mon, Nov 19, 2012 at 8:31 AM, Keith Hughes <keith.mhughes@gmail.com
> > > >wrote:
> > >
> > > > I was thinking about that as a possibility, but am trying to avoid
> that
> > > as
> > > > it will make my build process even worse.
> > > >
> > > > I am going to contact members of the Android team to see if they can
> > > > suggest anything. I will respond with what they say.
> > > >
> > > >
> > > >
> > > > On Mon, Nov 19, 2012 at 3:15 AM, Karl Pauls <ka...@gmail.com>
> > wrote:
> > > >
> > > >> I guess you have to patch the commons-logging jar and remove the
> > classes
> > > >> already provided by android, no?
> > > >>
> > > >> regards,
> > > >>
> > > >> Karl
> > > >>
> > > >>
> > > >> On Mon, Nov 19, 2012 at 3:05 AM, Keith Hughes <
> > keith.mhughes@gmail.com
> > > >> >wrote:
> > > >>
> > > >> > Karl,
> > > >> >
> > > >> > I thought I had this sorted, but apparently not.
> > > >> >
> > > >> > Part of the problem is that Android only supplies the Commons
> > Logging
> > > >> Log
> > > >> > interface and nothing else. If I want/need any of the other
> classes
> > > from
> > > >> > the same package I am kinda doomed.
> > > >> >
> > > >> > I tried moving commons logging into the libs folder, but dx
> > complains
> > > >> that
> > > >> > it has the same class twice, once from my jar and I guess once
> from
> > > the
> > > >> > Android runtime.
> > > >> >
> > > >> > Argh. Classloader problems are bad enough, but to have this as
> well.
> > > >> >
> > > >> >
> > > >> >
> > > >> > On Thu, Nov 1, 2012 at 2:31 AM, Karl Pauls <ka...@gmail.com>
> > > wrote:
> > > >> >
> > > >> > > Part of your problem is that android/davlik is not Java. It
> > doesn't
> > > >> > > follow normal Java classloading rules. Where that bites us from
> an
> > > >> > > OSGi pov is that you can't just substitute providers. In your
> > case,
> > > >> > > you might be able to get things to work by removing the imports
> of
> > > >> > > bundles to commons logging but typically the only way to make
> > things
> > > >> > > work is to make sure you only have one provider of a given
> package
> > > --
> > > >> > > hence, I'd remove commons logging from all bundles and put it in
> > the
> > > >> > > apk itself and have it bootdelegated.
> > > >> > >
> > > >> > > regards,
> > > >> > >
> > > >> > > Karl
> > > >> > >
> > > >> > > On Wed, Oct 31, 2012 at 11:05 PM, Keith Hughes <
> > > >> keith.mhughes@gmail.com>
> > > >> > > wrote:
> > > >> > > > Hi folks,
> > > >> > > >
> > > >> > > > I have an Android application based on Apache Felix.
> Everything
> > > >> works
> > > >> > > fine
> > > >> > > > when I run things on Linux, but as soon as I try moving to
> > > Android I
> > > >> > run
> > > >> > > > into a problem.
> > > >> > > >
> > > >> > > > My app uses Apache Commons Logging in all of its bundles. I
> have
> > > >> > > included a
> > > >> > > > bundle for Apache Commons Logging as a bundle as well.
> > > >> > > >
> > > >> > > > When the container starts up I get the following stack trace
> > which
> > > >> > seems
> > > >> > > to
> > > >> > > > point out that it is accessing the
> > org/apache/commons/logging/Log
> > > in
> > > >> > the
> > > >> > > > Android system libraries.
> > > >> > > > <
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> https://mail.google.com/mail/?view=cm&fs=1&tf=1&source=mailto&to=users-subscribe@felix.apache.org
> > > >> > > >
> > > >> > > > 10-31 15:43:53.251: W/dalvikvm(5034): Class resolved by
> > unexpected
> > > >> DEX:
> > > >> > > > Linterac
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> tivespaces/configuration/FileSystemConfigurationStorageManager;(0x41747380):0x64
> > > >> > > > d0b000 ref [Lorg/apache/commons/logging/Log;]
> > > >> > > > Lorg/apache/commons/logging/Log;(0x417498d8):0x64d34000
> > > >> > > > 10-31 15:43:53.251: W/dalvikvm(5034):
> > > >> > > >
> > > >> >
> > >
> (Linteractivespaces/configuration/FileSystemConfigurationStorageManager;
> > > >> > > > had used a different Lorg/apache/commons/logging/Log; during
> > > >> > > > pre-verification)
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034): Exception
> > > >> > > > bootstrap/interactivespaces-system-1.2.0.jar
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034):
> > > >> > > org.osgi.framework.BundleException:
> > > >> > > > Activator start error in bundle interactivespaces.system [24].
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >> > > >
> org.apache.felix.framework.Felix.activateBundle(Felix.java:2027)
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >> > > > org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >> > > >
> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >> > > >
> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundle(InteractiveSpacesFrameworkAndroidBootstrap.java:188)
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundles(InteractiveSpacesFrameworkAndroidBootstrap.java:173)
> > > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.boot(InteractiveSpacesFrameworkAndroidBootstrap.java:124)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.android.service.InteractiveSpacesService.onStartCommand(InteractiveSpacesService.java:67)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >>
> android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2490)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> android.app.ActivityThread.access$1900(ActivityThread.java:130)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > > android.os.Handler.dispatchMessage(Handler.java:99)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > > android.os.Looper.loop(Looper.java:137)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > > android.app.ActivityThread.main(ActivityThread.java:4745)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > > java.lang.reflect.Method.invokeNative(Native Method)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > > java.lang.reflect.Method.invoke(Method.java:511)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > > dalvik.system.NativeStart.main(Native Method)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034): Caused by:
> > > >> > > > java.lang.IllegalAccessError: Class ref in pre-verified class
> > > >> resolved
> > > >> > to
> > > >> > > > unexpected implementation
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.configuration.FileSystemConfigurationStorageManager.loadConfigFile(FileSystemConfigurationStorageManager.java:105)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.configuration.FileSystemConfigurationStorageManager.startup(FileSystemConfigurationStorageManager.java:82)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSystemConfiguration(GeneralInteractiveSpacesSupportActivator.java:315)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSpaceEnvironment(GeneralInteractiveSpacesSupportActivator.java:216)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.start(GeneralInteractiveSpacesSupportActivator.java:143)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> > > >> > >
> > > >> >
> > > >>
> > >
> >
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >> > > >
> org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
> > > >> > > > 10-31 15:43:53.261: W/System.err(5034):         ... 18 more
> > > >> > > >
> > > >> > > > I have tried experimenting with all of the legal values of the
> > > >> Bundle
> > > >> > > > Parent configuration property to no avail.
> > > >> > > >
> > > >> > > > How can I tell Felix to ignore Commons Logging from the system
> > > boot
> > > >> > path
> > > >> > > > and only use the one from the bundle?
> > > >> > >
> > > >> > >
> > > >> > >
> > > >> > > --
> > > >> > > Karl Pauls
> > > >> > > karlpauls@gmail.com
> > > >> > > http://twitter.com/karlpauls
> > > >> > > http://www.linkedin.com/in/karlpauls
> > > >> > > https://profiles.google.com/karlpauls
> > > >> > >
> > > >> > >
> > > ---------------------------------------------------------------------
> > > >> > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > > >> > > For additional commands, e-mail: users-help@felix.apache.org
> > > >> > >
> > > >> > >
> > > >> >
> > > >>
> > > >>
> > > >>
> > > >> --
> > > >> Karl Pauls
> > > >> karlpauls@gmail.com
> > > >> http://twitter.com/karlpauls
> > > >> http://www.linkedin.com/in/karlpauls
> > > >> https://profiles.google.com/karlpauls
> > > >>
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > Karl Pauls
> > karlpauls@gmail.com
> > http://twitter.com/karlpauls
> > http://www.linkedin.com/in/karlpauls
> > https://profiles.google.com/karlpauls
> >
>



-- 
Karl Pauls
karlpauls@gmail.com
http://twitter.com/karlpauls
http://www.linkedin.com/in/karlpauls
https://profiles.google.com/karlpauls

Re: Android, boot delegation, and preverification

Posted by Keith Hughes <ke...@gmail.com>.
Karl,

I found a slide deck of yours talking about having the shapes OSGi example
running as bundles under OSGi on Android. It mentioned
http://opensource.luminis.net/ to get the source for the example, but the
page seems to just have the host name. Where would I find that code?

Thanks,
-Keith



On Mon, Nov 19, 2012 at 3:23 PM, Karl Pauls <ka...@gmail.com> wrote:

> you can update bundles :-)
>
> regards,
>
> Karl
>
>
> On Mon, Nov 19, 2012 at 6:19 PM, Keith Hughes <keith.mhughes@gmail.com
> >wrote:
>
> > One final question, Karl, and I will leave you be... for now. :-)
> >
> > So I do have Felix working on Android and see things starting to work
> with
> > bundles being resolved and activated, which is good, so I know I can get
> a
> > static container running (once I modify my jars for commons logging).
> >
> > Is it possible to refresh a bundle under Felix on Android so that a new
> > version of the bundle comes in from the outside and gets itself properly
> > setup? Or, because of the way that Dalvik works, can you only run a
> static
> > OSGi container with a set of start bundles and maybe a deploy of a new
> > bundle, but no updating an old bundle?
> >
> >
> >
> > On Mon, Nov 19, 2012 at 8:31 AM, Keith Hughes <keith.mhughes@gmail.com
> > >wrote:
> >
> > > I was thinking about that as a possibility, but am trying to avoid that
> > as
> > > it will make my build process even worse.
> > >
> > > I am going to contact members of the Android team to see if they can
> > > suggest anything. I will respond with what they say.
> > >
> > >
> > >
> > > On Mon, Nov 19, 2012 at 3:15 AM, Karl Pauls <ka...@gmail.com>
> wrote:
> > >
> > >> I guess you have to patch the commons-logging jar and remove the
> classes
> > >> already provided by android, no?
> > >>
> > >> regards,
> > >>
> > >> Karl
> > >>
> > >>
> > >> On Mon, Nov 19, 2012 at 3:05 AM, Keith Hughes <
> keith.mhughes@gmail.com
> > >> >wrote:
> > >>
> > >> > Karl,
> > >> >
> > >> > I thought I had this sorted, but apparently not.
> > >> >
> > >> > Part of the problem is that Android only supplies the Commons
> Logging
> > >> Log
> > >> > interface and nothing else. If I want/need any of the other classes
> > from
> > >> > the same package I am kinda doomed.
> > >> >
> > >> > I tried moving commons logging into the libs folder, but dx
> complains
> > >> that
> > >> > it has the same class twice, once from my jar and I guess once from
> > the
> > >> > Android runtime.
> > >> >
> > >> > Argh. Classloader problems are bad enough, but to have this as well.
> > >> >
> > >> >
> > >> >
> > >> > On Thu, Nov 1, 2012 at 2:31 AM, Karl Pauls <ka...@gmail.com>
> > wrote:
> > >> >
> > >> > > Part of your problem is that android/davlik is not Java. It
> doesn't
> > >> > > follow normal Java classloading rules. Where that bites us from an
> > >> > > OSGi pov is that you can't just substitute providers. In your
> case,
> > >> > > you might be able to get things to work by removing the imports of
> > >> > > bundles to commons logging but typically the only way to make
> things
> > >> > > work is to make sure you only have one provider of a given package
> > --
> > >> > > hence, I'd remove commons logging from all bundles and put it in
> the
> > >> > > apk itself and have it bootdelegated.
> > >> > >
> > >> > > regards,
> > >> > >
> > >> > > Karl
> > >> > >
> > >> > > On Wed, Oct 31, 2012 at 11:05 PM, Keith Hughes <
> > >> keith.mhughes@gmail.com>
> > >> > > wrote:
> > >> > > > Hi folks,
> > >> > > >
> > >> > > > I have an Android application based on Apache Felix. Everything
> > >> works
> > >> > > fine
> > >> > > > when I run things on Linux, but as soon as I try moving to
> > Android I
> > >> > run
> > >> > > > into a problem.
> > >> > > >
> > >> > > > My app uses Apache Commons Logging in all of its bundles. I have
> > >> > > included a
> > >> > > > bundle for Apache Commons Logging as a bundle as well.
> > >> > > >
> > >> > > > When the container starts up I get the following stack trace
> which
> > >> > seems
> > >> > > to
> > >> > > > point out that it is accessing the
> org/apache/commons/logging/Log
> > in
> > >> > the
> > >> > > > Android system libraries.
> > >> > > > <
> > >> > >
> > >> >
> > >>
> >
> https://mail.google.com/mail/?view=cm&fs=1&tf=1&source=mailto&to=users-subscribe@felix.apache.org
> > >> > > >
> > >> > > > 10-31 15:43:53.251: W/dalvikvm(5034): Class resolved by
> unexpected
> > >> DEX:
> > >> > > > Linterac
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> tivespaces/configuration/FileSystemConfigurationStorageManager;(0x41747380):0x64
> > >> > > > d0b000 ref [Lorg/apache/commons/logging/Log;]
> > >> > > > Lorg/apache/commons/logging/Log;(0x417498d8):0x64d34000
> > >> > > > 10-31 15:43:53.251: W/dalvikvm(5034):
> > >> > > >
> > >> >
> > (Linteractivespaces/configuration/FileSystemConfigurationStorageManager;
> > >> > > > had used a different Lorg/apache/commons/logging/Log; during
> > >> > > > pre-verification)
> > >> > > > 10-31 15:43:53.251: W/System.err(5034): Exception
> > >> > > > bootstrap/interactivespaces-system-1.2.0.jar
> > >> > > > 10-31 15:43:53.251: W/System.err(5034):
> > >> > > org.osgi.framework.BundleException:
> > >> > > > Activator start error in bundle interactivespaces.system [24].
> > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >> > > > org.apache.felix.framework.Felix.activateBundle(Felix.java:2027)
> > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >> > > > org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
> > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >> > > > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
> > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >> > > > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)
> > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundle(InteractiveSpacesFrameworkAndroidBootstrap.java:188)
> > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundles(InteractiveSpacesFrameworkAndroidBootstrap.java:173)
> > >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.boot(InteractiveSpacesFrameworkAndroidBootstrap.java:124)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.android.service.InteractiveSpacesService.onStartCommand(InteractiveSpacesService.java:67)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2490)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > android.app.ActivityThread.access$1900(ActivityThread.java:130)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > android.os.Handler.dispatchMessage(Handler.java:99)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > android.os.Looper.loop(Looper.java:137)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > android.app.ActivityThread.main(ActivityThread.java:4745)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > java.lang.reflect.Method.invokeNative(Native Method)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > java.lang.reflect.Method.invoke(Method.java:511)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > dalvik.system.NativeStart.main(Native Method)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034): Caused by:
> > >> > > > java.lang.IllegalAccessError: Class ref in pre-verified class
> > >> resolved
> > >> > to
> > >> > > > unexpected implementation
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.configuration.FileSystemConfigurationStorageManager.loadConfigFile(FileSystemConfigurationStorageManager.java:105)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.configuration.FileSystemConfigurationStorageManager.startup(FileSystemConfigurationStorageManager.java:82)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSystemConfiguration(GeneralInteractiveSpacesSupportActivator.java:315)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSpaceEnvironment(GeneralInteractiveSpacesSupportActivator.java:216)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.start(GeneralInteractiveSpacesSupportActivator.java:143)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > >
> > >> > >
> > >> >
> > >>
> >
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >> > > > org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
> > >> > > > 10-31 15:43:53.261: W/System.err(5034):         ... 18 more
> > >> > > >
> > >> > > > I have tried experimenting with all of the legal values of the
> > >> Bundle
> > >> > > > Parent configuration property to no avail.
> > >> > > >
> > >> > > > How can I tell Felix to ignore Commons Logging from the system
> > boot
> > >> > path
> > >> > > > and only use the one from the bundle?
> > >> > >
> > >> > >
> > >> > >
> > >> > > --
> > >> > > Karl Pauls
> > >> > > karlpauls@gmail.com
> > >> > > http://twitter.com/karlpauls
> > >> > > http://www.linkedin.com/in/karlpauls
> > >> > > https://profiles.google.com/karlpauls
> > >> > >
> > >> > >
> > ---------------------------------------------------------------------
> > >> > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > >> > > For additional commands, e-mail: users-help@felix.apache.org
> > >> > >
> > >> > >
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Karl Pauls
> > >> karlpauls@gmail.com
> > >> http://twitter.com/karlpauls
> > >> http://www.linkedin.com/in/karlpauls
> > >> https://profiles.google.com/karlpauls
> > >>
> > >
> > >
> >
>
>
>
> --
> Karl Pauls
> karlpauls@gmail.com
> http://twitter.com/karlpauls
> http://www.linkedin.com/in/karlpauls
> https://profiles.google.com/karlpauls
>

Re: Android, boot delegation, and preverification

Posted by Karl Pauls <ka...@gmail.com>.
you can update bundles :-)

regards,

Karl


On Mon, Nov 19, 2012 at 6:19 PM, Keith Hughes <ke...@gmail.com>wrote:

> One final question, Karl, and I will leave you be... for now. :-)
>
> So I do have Felix working on Android and see things starting to work with
> bundles being resolved and activated, which is good, so I know I can get a
> static container running (once I modify my jars for commons logging).
>
> Is it possible to refresh a bundle under Felix on Android so that a new
> version of the bundle comes in from the outside and gets itself properly
> setup? Or, because of the way that Dalvik works, can you only run a static
> OSGi container with a set of start bundles and maybe a deploy of a new
> bundle, but no updating an old bundle?
>
>
>
> On Mon, Nov 19, 2012 at 8:31 AM, Keith Hughes <keith.mhughes@gmail.com
> >wrote:
>
> > I was thinking about that as a possibility, but am trying to avoid that
> as
> > it will make my build process even worse.
> >
> > I am going to contact members of the Android team to see if they can
> > suggest anything. I will respond with what they say.
> >
> >
> >
> > On Mon, Nov 19, 2012 at 3:15 AM, Karl Pauls <ka...@gmail.com> wrote:
> >
> >> I guess you have to patch the commons-logging jar and remove the classes
> >> already provided by android, no?
> >>
> >> regards,
> >>
> >> Karl
> >>
> >>
> >> On Mon, Nov 19, 2012 at 3:05 AM, Keith Hughes <keith.mhughes@gmail.com
> >> >wrote:
> >>
> >> > Karl,
> >> >
> >> > I thought I had this sorted, but apparently not.
> >> >
> >> > Part of the problem is that Android only supplies the Commons Logging
> >> Log
> >> > interface and nothing else. If I want/need any of the other classes
> from
> >> > the same package I am kinda doomed.
> >> >
> >> > I tried moving commons logging into the libs folder, but dx complains
> >> that
> >> > it has the same class twice, once from my jar and I guess once from
> the
> >> > Android runtime.
> >> >
> >> > Argh. Classloader problems are bad enough, but to have this as well.
> >> >
> >> >
> >> >
> >> > On Thu, Nov 1, 2012 at 2:31 AM, Karl Pauls <ka...@gmail.com>
> wrote:
> >> >
> >> > > Part of your problem is that android/davlik is not Java. It doesn't
> >> > > follow normal Java classloading rules. Where that bites us from an
> >> > > OSGi pov is that you can't just substitute providers. In your case,
> >> > > you might be able to get things to work by removing the imports of
> >> > > bundles to commons logging but typically the only way to make things
> >> > > work is to make sure you only have one provider of a given package
> --
> >> > > hence, I'd remove commons logging from all bundles and put it in the
> >> > > apk itself and have it bootdelegated.
> >> > >
> >> > > regards,
> >> > >
> >> > > Karl
> >> > >
> >> > > On Wed, Oct 31, 2012 at 11:05 PM, Keith Hughes <
> >> keith.mhughes@gmail.com>
> >> > > wrote:
> >> > > > Hi folks,
> >> > > >
> >> > > > I have an Android application based on Apache Felix. Everything
> >> works
> >> > > fine
> >> > > > when I run things on Linux, but as soon as I try moving to
> Android I
> >> > run
> >> > > > into a problem.
> >> > > >
> >> > > > My app uses Apache Commons Logging in all of its bundles. I have
> >> > > included a
> >> > > > bundle for Apache Commons Logging as a bundle as well.
> >> > > >
> >> > > > When the container starts up I get the following stack trace which
> >> > seems
> >> > > to
> >> > > > point out that it is accessing the org/apache/commons/logging/Log
> in
> >> > the
> >> > > > Android system libraries.
> >> > > > <
> >> > >
> >> >
> >>
> https://mail.google.com/mail/?view=cm&fs=1&tf=1&source=mailto&to=users-subscribe@felix.apache.org
> >> > > >
> >> > > > 10-31 15:43:53.251: W/dalvikvm(5034): Class resolved by unexpected
> >> DEX:
> >> > > > Linterac
> >> > > >
> >> > >
> >> >
> >>
> tivespaces/configuration/FileSystemConfigurationStorageManager;(0x41747380):0x64
> >> > > > d0b000 ref [Lorg/apache/commons/logging/Log;]
> >> > > > Lorg/apache/commons/logging/Log;(0x417498d8):0x64d34000
> >> > > > 10-31 15:43:53.251: W/dalvikvm(5034):
> >> > > >
> >> >
> (Linteractivespaces/configuration/FileSystemConfigurationStorageManager;
> >> > > > had used a different Lorg/apache/commons/logging/Log; during
> >> > > > pre-verification)
> >> > > > 10-31 15:43:53.251: W/System.err(5034): Exception
> >> > > > bootstrap/interactivespaces-system-1.2.0.jar
> >> > > > 10-31 15:43:53.251: W/System.err(5034):
> >> > > org.osgi.framework.BundleException:
> >> > > > Activator start error in bundle interactivespaces.system [24].
> >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> >> > > > org.apache.felix.framework.Felix.activateBundle(Felix.java:2027)
> >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> >> > > > org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
> >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> >> > > > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
> >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> >> > > > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)
> >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> >> > > >
> >> > >
> >> >
> >>
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundle(InteractiveSpacesFrameworkAndroidBootstrap.java:188)
> >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> >> > > >
> >> > >
> >> >
> >>
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundles(InteractiveSpacesFrameworkAndroidBootstrap.java:173)
> >> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> >> > > >
> >> > >
> >> >
> >>
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.boot(InteractiveSpacesFrameworkAndroidBootstrap.java:124)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > >
> >> > >
> >> >
> >>
> interactivespaces.android.service.InteractiveSpacesService.onStartCommand(InteractiveSpacesService.java:67)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > >
> >> android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2490)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > > android.app.ActivityThread.access$1900(ActivityThread.java:130)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > >
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > > android.os.Handler.dispatchMessage(Handler.java:99)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > > android.os.Looper.loop(Looper.java:137)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > > android.app.ActivityThread.main(ActivityThread.java:4745)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > > java.lang.reflect.Method.invokeNative(Native Method)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > > java.lang.reflect.Method.invoke(Method.java:511)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > >
> >> > >
> >> >
> >>
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > > dalvik.system.NativeStart.main(Native Method)
> >> > > > 10-31 15:43:53.261: W/System.err(5034): Caused by:
> >> > > > java.lang.IllegalAccessError: Class ref in pre-verified class
> >> resolved
> >> > to
> >> > > > unexpected implementation
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > >
> >> > >
> >> >
> >>
> interactivespaces.configuration.FileSystemConfigurationStorageManager.loadConfigFile(FileSystemConfigurationStorageManager.java:105)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > >
> >> > >
> >> >
> >>
> interactivespaces.configuration.FileSystemConfigurationStorageManager.startup(FileSystemConfigurationStorageManager.java:82)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > >
> >> > >
> >> >
> >>
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSystemConfiguration(GeneralInteractiveSpacesSupportActivator.java:315)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > >
> >> > >
> >> >
> >>
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSpaceEnvironment(GeneralInteractiveSpacesSupportActivator.java:216)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > >
> >> > >
> >> >
> >>
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.start(GeneralInteractiveSpacesSupportActivator.java:143)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > >
> >> > >
> >> >
> >>
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> >> > > > org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
> >> > > > 10-31 15:43:53.261: W/System.err(5034):         ... 18 more
> >> > > >
> >> > > > I have tried experimenting with all of the legal values of the
> >> Bundle
> >> > > > Parent configuration property to no avail.
> >> > > >
> >> > > > How can I tell Felix to ignore Commons Logging from the system
> boot
> >> > path
> >> > > > and only use the one from the bundle?
> >> > >
> >> > >
> >> > >
> >> > > --
> >> > > Karl Pauls
> >> > > karlpauls@gmail.com
> >> > > http://twitter.com/karlpauls
> >> > > http://www.linkedin.com/in/karlpauls
> >> > > https://profiles.google.com/karlpauls
> >> > >
> >> > >
> ---------------------------------------------------------------------
> >> > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> >> > > For additional commands, e-mail: users-help@felix.apache.org
> >> > >
> >> > >
> >> >
> >>
> >>
> >>
> >> --
> >> Karl Pauls
> >> karlpauls@gmail.com
> >> http://twitter.com/karlpauls
> >> http://www.linkedin.com/in/karlpauls
> >> https://profiles.google.com/karlpauls
> >>
> >
> >
>



-- 
Karl Pauls
karlpauls@gmail.com
http://twitter.com/karlpauls
http://www.linkedin.com/in/karlpauls
https://profiles.google.com/karlpauls

Re: Android, boot delegation, and preverification

Posted by Keith Hughes <ke...@gmail.com>.
One final question, Karl, and I will leave you be... for now. :-)

So I do have Felix working on Android and see things starting to work with
bundles being resolved and activated, which is good, so I know I can get a
static container running (once I modify my jars for commons logging).

Is it possible to refresh a bundle under Felix on Android so that a new
version of the bundle comes in from the outside and gets itself properly
setup? Or, because of the way that Dalvik works, can you only run a static
OSGi container with a set of start bundles and maybe a deploy of a new
bundle, but no updating an old bundle?



On Mon, Nov 19, 2012 at 8:31 AM, Keith Hughes <ke...@gmail.com>wrote:

> I was thinking about that as a possibility, but am trying to avoid that as
> it will make my build process even worse.
>
> I am going to contact members of the Android team to see if they can
> suggest anything. I will respond with what they say.
>
>
>
> On Mon, Nov 19, 2012 at 3:15 AM, Karl Pauls <ka...@gmail.com> wrote:
>
>> I guess you have to patch the commons-logging jar and remove the classes
>> already provided by android, no?
>>
>> regards,
>>
>> Karl
>>
>>
>> On Mon, Nov 19, 2012 at 3:05 AM, Keith Hughes <keith.mhughes@gmail.com
>> >wrote:
>>
>> > Karl,
>> >
>> > I thought I had this sorted, but apparently not.
>> >
>> > Part of the problem is that Android only supplies the Commons Logging
>> Log
>> > interface and nothing else. If I want/need any of the other classes from
>> > the same package I am kinda doomed.
>> >
>> > I tried moving commons logging into the libs folder, but dx complains
>> that
>> > it has the same class twice, once from my jar and I guess once from the
>> > Android runtime.
>> >
>> > Argh. Classloader problems are bad enough, but to have this as well.
>> >
>> >
>> >
>> > On Thu, Nov 1, 2012 at 2:31 AM, Karl Pauls <ka...@gmail.com> wrote:
>> >
>> > > Part of your problem is that android/davlik is not Java. It doesn't
>> > > follow normal Java classloading rules. Where that bites us from an
>> > > OSGi pov is that you can't just substitute providers. In your case,
>> > > you might be able to get things to work by removing the imports of
>> > > bundles to commons logging but typically the only way to make things
>> > > work is to make sure you only have one provider of a given package --
>> > > hence, I'd remove commons logging from all bundles and put it in the
>> > > apk itself and have it bootdelegated.
>> > >
>> > > regards,
>> > >
>> > > Karl
>> > >
>> > > On Wed, Oct 31, 2012 at 11:05 PM, Keith Hughes <
>> keith.mhughes@gmail.com>
>> > > wrote:
>> > > > Hi folks,
>> > > >
>> > > > I have an Android application based on Apache Felix. Everything
>> works
>> > > fine
>> > > > when I run things on Linux, but as soon as I try moving to Android I
>> > run
>> > > > into a problem.
>> > > >
>> > > > My app uses Apache Commons Logging in all of its bundles. I have
>> > > included a
>> > > > bundle for Apache Commons Logging as a bundle as well.
>> > > >
>> > > > When the container starts up I get the following stack trace which
>> > seems
>> > > to
>> > > > point out that it is accessing the org/apache/commons/logging/Log in
>> > the
>> > > > Android system libraries.
>> > > > <
>> > >
>> >
>> https://mail.google.com/mail/?view=cm&fs=1&tf=1&source=mailto&to=users-subscribe@felix.apache.org
>> > > >
>> > > > 10-31 15:43:53.251: W/dalvikvm(5034): Class resolved by unexpected
>> DEX:
>> > > > Linterac
>> > > >
>> > >
>> >
>> tivespaces/configuration/FileSystemConfigurationStorageManager;(0x41747380):0x64
>> > > > d0b000 ref [Lorg/apache/commons/logging/Log;]
>> > > > Lorg/apache/commons/logging/Log;(0x417498d8):0x64d34000
>> > > > 10-31 15:43:53.251: W/dalvikvm(5034):
>> > > >
>> > (Linteractivespaces/configuration/FileSystemConfigurationStorageManager;
>> > > > had used a different Lorg/apache/commons/logging/Log; during
>> > > > pre-verification)
>> > > > 10-31 15:43:53.251: W/System.err(5034): Exception
>> > > > bootstrap/interactivespaces-system-1.2.0.jar
>> > > > 10-31 15:43:53.251: W/System.err(5034):
>> > > org.osgi.framework.BundleException:
>> > > > Activator start error in bundle interactivespaces.system [24].
>> > > > 10-31 15:43:53.251: W/System.err(5034):         at
>> > > > org.apache.felix.framework.Felix.activateBundle(Felix.java:2027)
>> > > > 10-31 15:43:53.251: W/System.err(5034):         at
>> > > > org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
>> > > > 10-31 15:43:53.251: W/System.err(5034):         at
>> > > > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
>> > > > 10-31 15:43:53.251: W/System.err(5034):         at
>> > > > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)
>> > > > 10-31 15:43:53.251: W/System.err(5034):         at
>> > > >
>> > >
>> >
>> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundle(InteractiveSpacesFrameworkAndroidBootstrap.java:188)
>> > > > 10-31 15:43:53.251: W/System.err(5034):         at
>> > > >
>> > >
>> >
>> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundles(InteractiveSpacesFrameworkAndroidBootstrap.java:173)
>> > > > 10-31 15:43:53.251: W/System.err(5034):         at
>> > > >
>> > >
>> >
>> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.boot(InteractiveSpacesFrameworkAndroidBootstrap.java:124)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > >
>> > >
>> >
>> interactivespaces.android.service.InteractiveSpacesService.onStartCommand(InteractiveSpacesService.java:67)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > >
>> android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2490)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > > android.app.ActivityThread.access$1900(ActivityThread.java:130)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > > android.os.Handler.dispatchMessage(Handler.java:99)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > > android.os.Looper.loop(Looper.java:137)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > > android.app.ActivityThread.main(ActivityThread.java:4745)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > > java.lang.reflect.Method.invokeNative(Native Method)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > > java.lang.reflect.Method.invoke(Method.java:511)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > >
>> > >
>> >
>> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > > dalvik.system.NativeStart.main(Native Method)
>> > > > 10-31 15:43:53.261: W/System.err(5034): Caused by:
>> > > > java.lang.IllegalAccessError: Class ref in pre-verified class
>> resolved
>> > to
>> > > > unexpected implementation
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > >
>> > >
>> >
>> interactivespaces.configuration.FileSystemConfigurationStorageManager.loadConfigFile(FileSystemConfigurationStorageManager.java:105)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > >
>> > >
>> >
>> interactivespaces.configuration.FileSystemConfigurationStorageManager.startup(FileSystemConfigurationStorageManager.java:82)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > >
>> > >
>> >
>> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSystemConfiguration(GeneralInteractiveSpacesSupportActivator.java:315)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > >
>> > >
>> >
>> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSpaceEnvironment(GeneralInteractiveSpacesSupportActivator.java:216)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > >
>> > >
>> >
>> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.start(GeneralInteractiveSpacesSupportActivator.java:143)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > >
>> > >
>> >
>> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         at
>> > > > org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
>> > > > 10-31 15:43:53.261: W/System.err(5034):         ... 18 more
>> > > >
>> > > > I have tried experimenting with all of the legal values of the
>> Bundle
>> > > > Parent configuration property to no avail.
>> > > >
>> > > > How can I tell Felix to ignore Commons Logging from the system boot
>> > path
>> > > > and only use the one from the bundle?
>> > >
>> > >
>> > >
>> > > --
>> > > Karl Pauls
>> > > karlpauls@gmail.com
>> > > http://twitter.com/karlpauls
>> > > http://www.linkedin.com/in/karlpauls
>> > > https://profiles.google.com/karlpauls
>> > >
>> > > ---------------------------------------------------------------------
>> > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> > > For additional commands, e-mail: users-help@felix.apache.org
>> > >
>> > >
>> >
>>
>>
>>
>> --
>> Karl Pauls
>> karlpauls@gmail.com
>> http://twitter.com/karlpauls
>> http://www.linkedin.com/in/karlpauls
>> https://profiles.google.com/karlpauls
>>
>
>

Re: Android, boot delegation, and preverification

Posted by Keith Hughes <ke...@gmail.com>.
I was thinking about that as a possibility, but am trying to avoid that as
it will make my build process even worse.

I am going to contact members of the Android team to see if they can
suggest anything. I will respond with what they say.



On Mon, Nov 19, 2012 at 3:15 AM, Karl Pauls <ka...@gmail.com> wrote:

> I guess you have to patch the commons-logging jar and remove the classes
> already provided by android, no?
>
> regards,
>
> Karl
>
>
> On Mon, Nov 19, 2012 at 3:05 AM, Keith Hughes <keith.mhughes@gmail.com
> >wrote:
>
> > Karl,
> >
> > I thought I had this sorted, but apparently not.
> >
> > Part of the problem is that Android only supplies the Commons Logging Log
> > interface and nothing else. If I want/need any of the other classes from
> > the same package I am kinda doomed.
> >
> > I tried moving commons logging into the libs folder, but dx complains
> that
> > it has the same class twice, once from my jar and I guess once from the
> > Android runtime.
> >
> > Argh. Classloader problems are bad enough, but to have this as well.
> >
> >
> >
> > On Thu, Nov 1, 2012 at 2:31 AM, Karl Pauls <ka...@gmail.com> wrote:
> >
> > > Part of your problem is that android/davlik is not Java. It doesn't
> > > follow normal Java classloading rules. Where that bites us from an
> > > OSGi pov is that you can't just substitute providers. In your case,
> > > you might be able to get things to work by removing the imports of
> > > bundles to commons logging but typically the only way to make things
> > > work is to make sure you only have one provider of a given package --
> > > hence, I'd remove commons logging from all bundles and put it in the
> > > apk itself and have it bootdelegated.
> > >
> > > regards,
> > >
> > > Karl
> > >
> > > On Wed, Oct 31, 2012 at 11:05 PM, Keith Hughes <
> keith.mhughes@gmail.com>
> > > wrote:
> > > > Hi folks,
> > > >
> > > > I have an Android application based on Apache Felix. Everything works
> > > fine
> > > > when I run things on Linux, but as soon as I try moving to Android I
> > run
> > > > into a problem.
> > > >
> > > > My app uses Apache Commons Logging in all of its bundles. I have
> > > included a
> > > > bundle for Apache Commons Logging as a bundle as well.
> > > >
> > > > When the container starts up I get the following stack trace which
> > seems
> > > to
> > > > point out that it is accessing the org/apache/commons/logging/Log in
> > the
> > > > Android system libraries.
> > > > <
> > >
> >
> https://mail.google.com/mail/?view=cm&fs=1&tf=1&source=mailto&to=users-subscribe@felix.apache.org
> > > >
> > > > 10-31 15:43:53.251: W/dalvikvm(5034): Class resolved by unexpected
> DEX:
> > > > Linterac
> > > >
> > >
> >
> tivespaces/configuration/FileSystemConfigurationStorageManager;(0x41747380):0x64
> > > > d0b000 ref [Lorg/apache/commons/logging/Log;]
> > > > Lorg/apache/commons/logging/Log;(0x417498d8):0x64d34000
> > > > 10-31 15:43:53.251: W/dalvikvm(5034):
> > > >
> > (Linteractivespaces/configuration/FileSystemConfigurationStorageManager;
> > > > had used a different Lorg/apache/commons/logging/Log; during
> > > > pre-verification)
> > > > 10-31 15:43:53.251: W/System.err(5034): Exception
> > > > bootstrap/interactivespaces-system-1.2.0.jar
> > > > 10-31 15:43:53.251: W/System.err(5034):
> > > org.osgi.framework.BundleException:
> > > > Activator start error in bundle interactivespaces.system [24].
> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > > org.apache.felix.framework.Felix.activateBundle(Felix.java:2027)
> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > > org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)
> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >
> > >
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundle(InteractiveSpacesFrameworkAndroidBootstrap.java:188)
> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >
> > >
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundles(InteractiveSpacesFrameworkAndroidBootstrap.java:173)
> > > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > >
> > >
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.boot(InteractiveSpacesFrameworkAndroidBootstrap.java:124)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >
> > >
> >
> interactivespaces.android.service.InteractiveSpacesService.onStartCommand(InteractiveSpacesService.java:67)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >
> android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2490)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > > android.app.ActivityThread.access$1900(ActivityThread.java:130)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > > android.os.Handler.dispatchMessage(Handler.java:99)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > > android.os.Looper.loop(Looper.java:137)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > > android.app.ActivityThread.main(ActivityThread.java:4745)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > > java.lang.reflect.Method.invokeNative(Native Method)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > > java.lang.reflect.Method.invoke(Method.java:511)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >
> > >
> >
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > > dalvik.system.NativeStart.main(Native Method)
> > > > 10-31 15:43:53.261: W/System.err(5034): Caused by:
> > > > java.lang.IllegalAccessError: Class ref in pre-verified class
> resolved
> > to
> > > > unexpected implementation
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >
> > >
> >
> interactivespaces.configuration.FileSystemConfigurationStorageManager.loadConfigFile(FileSystemConfigurationStorageManager.java:105)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >
> > >
> >
> interactivespaces.configuration.FileSystemConfigurationStorageManager.startup(FileSystemConfigurationStorageManager.java:82)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >
> > >
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSystemConfiguration(GeneralInteractiveSpacesSupportActivator.java:315)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >
> > >
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSpaceEnvironment(GeneralInteractiveSpacesSupportActivator.java:216)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >
> > >
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.start(GeneralInteractiveSpacesSupportActivator.java:143)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > >
> > >
> >
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
> > > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > > org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
> > > > 10-31 15:43:53.261: W/System.err(5034):         ... 18 more
> > > >
> > > > I have tried experimenting with all of the legal values of the Bundle
> > > > Parent configuration property to no avail.
> > > >
> > > > How can I tell Felix to ignore Commons Logging from the system boot
> > path
> > > > and only use the one from the bundle?
> > >
> > >
> > >
> > > --
> > > Karl Pauls
> > > karlpauls@gmail.com
> > > http://twitter.com/karlpauls
> > > http://www.linkedin.com/in/karlpauls
> > > https://profiles.google.com/karlpauls
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > > For additional commands, e-mail: users-help@felix.apache.org
> > >
> > >
> >
>
>
>
> --
> Karl Pauls
> karlpauls@gmail.com
> http://twitter.com/karlpauls
> http://www.linkedin.com/in/karlpauls
> https://profiles.google.com/karlpauls
>

Re: Android, boot delegation, and preverification

Posted by Karl Pauls <ka...@gmail.com>.
I guess you have to patch the commons-logging jar and remove the classes
already provided by android, no?

regards,

Karl


On Mon, Nov 19, 2012 at 3:05 AM, Keith Hughes <ke...@gmail.com>wrote:

> Karl,
>
> I thought I had this sorted, but apparently not.
>
> Part of the problem is that Android only supplies the Commons Logging Log
> interface and nothing else. If I want/need any of the other classes from
> the same package I am kinda doomed.
>
> I tried moving commons logging into the libs folder, but dx complains that
> it has the same class twice, once from my jar and I guess once from the
> Android runtime.
>
> Argh. Classloader problems are bad enough, but to have this as well.
>
>
>
> On Thu, Nov 1, 2012 at 2:31 AM, Karl Pauls <ka...@gmail.com> wrote:
>
> > Part of your problem is that android/davlik is not Java. It doesn't
> > follow normal Java classloading rules. Where that bites us from an
> > OSGi pov is that you can't just substitute providers. In your case,
> > you might be able to get things to work by removing the imports of
> > bundles to commons logging but typically the only way to make things
> > work is to make sure you only have one provider of a given package --
> > hence, I'd remove commons logging from all bundles and put it in the
> > apk itself and have it bootdelegated.
> >
> > regards,
> >
> > Karl
> >
> > On Wed, Oct 31, 2012 at 11:05 PM, Keith Hughes <ke...@gmail.com>
> > wrote:
> > > Hi folks,
> > >
> > > I have an Android application based on Apache Felix. Everything works
> > fine
> > > when I run things on Linux, but as soon as I try moving to Android I
> run
> > > into a problem.
> > >
> > > My app uses Apache Commons Logging in all of its bundles. I have
> > included a
> > > bundle for Apache Commons Logging as a bundle as well.
> > >
> > > When the container starts up I get the following stack trace which
> seems
> > to
> > > point out that it is accessing the org/apache/commons/logging/Log in
> the
> > > Android system libraries.
> > > <
> >
> https://mail.google.com/mail/?view=cm&fs=1&tf=1&source=mailto&to=users-subscribe@felix.apache.org
> > >
> > > 10-31 15:43:53.251: W/dalvikvm(5034): Class resolved by unexpected DEX:
> > > Linterac
> > >
> >
> tivespaces/configuration/FileSystemConfigurationStorageManager;(0x41747380):0x64
> > > d0b000 ref [Lorg/apache/commons/logging/Log;]
> > > Lorg/apache/commons/logging/Log;(0x417498d8):0x64d34000
> > > 10-31 15:43:53.251: W/dalvikvm(5034):
> > >
> (Linteractivespaces/configuration/FileSystemConfigurationStorageManager;
> > > had used a different Lorg/apache/commons/logging/Log; during
> > > pre-verification)
> > > 10-31 15:43:53.251: W/System.err(5034): Exception
> > > bootstrap/interactivespaces-system-1.2.0.jar
> > > 10-31 15:43:53.251: W/System.err(5034):
> > org.osgi.framework.BundleException:
> > > Activator start error in bundle interactivespaces.system [24].
> > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > org.apache.felix.framework.Felix.activateBundle(Felix.java:2027)
> > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
> > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
> > > 10-31 15:43:53.251: W/System.err(5034):         at
> > > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)
> > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundle(InteractiveSpacesFrameworkAndroidBootstrap.java:188)
> > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundles(InteractiveSpacesFrameworkAndroidBootstrap.java:173)
> > > 10-31 15:43:53.251: W/System.err(5034):         at
> > >
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.boot(InteractiveSpacesFrameworkAndroidBootstrap.java:124)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >
> >
> interactivespaces.android.service.InteractiveSpacesService.onStartCommand(InteractiveSpacesService.java:67)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2490)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > android.app.ActivityThread.access$1900(ActivityThread.java:130)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > android.os.Handler.dispatchMessage(Handler.java:99)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > android.os.Looper.loop(Looper.java:137)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > android.app.ActivityThread.main(ActivityThread.java:4745)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > java.lang.reflect.Method.invokeNative(Native Method)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > java.lang.reflect.Method.invoke(Method.java:511)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >
> >
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > dalvik.system.NativeStart.main(Native Method)
> > > 10-31 15:43:53.261: W/System.err(5034): Caused by:
> > > java.lang.IllegalAccessError: Class ref in pre-verified class resolved
> to
> > > unexpected implementation
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >
> >
> interactivespaces.configuration.FileSystemConfigurationStorageManager.loadConfigFile(FileSystemConfigurationStorageManager.java:105)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >
> >
> interactivespaces.configuration.FileSystemConfigurationStorageManager.startup(FileSystemConfigurationStorageManager.java:82)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSystemConfiguration(GeneralInteractiveSpacesSupportActivator.java:315)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSpaceEnvironment(GeneralInteractiveSpacesSupportActivator.java:216)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.start(GeneralInteractiveSpacesSupportActivator.java:143)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > >
> >
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
> > > 10-31 15:43:53.261: W/System.err(5034):         at
> > > org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
> > > 10-31 15:43:53.261: W/System.err(5034):         ... 18 more
> > >
> > > I have tried experimenting with all of the legal values of the Bundle
> > > Parent configuration property to no avail.
> > >
> > > How can I tell Felix to ignore Commons Logging from the system boot
> path
> > > and only use the one from the bundle?
> >
> >
> >
> > --
> > Karl Pauls
> > karlpauls@gmail.com
> > http://twitter.com/karlpauls
> > http://www.linkedin.com/in/karlpauls
> > https://profiles.google.com/karlpauls
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > For additional commands, e-mail: users-help@felix.apache.org
> >
> >
>



-- 
Karl Pauls
karlpauls@gmail.com
http://twitter.com/karlpauls
http://www.linkedin.com/in/karlpauls
https://profiles.google.com/karlpauls

Re: Android, boot delegation, and preverification

Posted by Keith Hughes <ke...@gmail.com>.
Karl,

I thought I had this sorted, but apparently not.

Part of the problem is that Android only supplies the Commons Logging Log
interface and nothing else. If I want/need any of the other classes from
the same package I am kinda doomed.

I tried moving commons logging into the libs folder, but dx complains that
it has the same class twice, once from my jar and I guess once from the
Android runtime.

Argh. Classloader problems are bad enough, but to have this as well.



On Thu, Nov 1, 2012 at 2:31 AM, Karl Pauls <ka...@gmail.com> wrote:

> Part of your problem is that android/davlik is not Java. It doesn't
> follow normal Java classloading rules. Where that bites us from an
> OSGi pov is that you can't just substitute providers. In your case,
> you might be able to get things to work by removing the imports of
> bundles to commons logging but typically the only way to make things
> work is to make sure you only have one provider of a given package --
> hence, I'd remove commons logging from all bundles and put it in the
> apk itself and have it bootdelegated.
>
> regards,
>
> Karl
>
> On Wed, Oct 31, 2012 at 11:05 PM, Keith Hughes <ke...@gmail.com>
> wrote:
> > Hi folks,
> >
> > I have an Android application based on Apache Felix. Everything works
> fine
> > when I run things on Linux, but as soon as I try moving to Android I run
> > into a problem.
> >
> > My app uses Apache Commons Logging in all of its bundles. I have
> included a
> > bundle for Apache Commons Logging as a bundle as well.
> >
> > When the container starts up I get the following stack trace which seems
> to
> > point out that it is accessing the org/apache/commons/logging/Log in the
> > Android system libraries.
> > <
> https://mail.google.com/mail/?view=cm&fs=1&tf=1&source=mailto&to=users-subscribe@felix.apache.org
> >
> > 10-31 15:43:53.251: W/dalvikvm(5034): Class resolved by unexpected DEX:
> > Linterac
> >
> tivespaces/configuration/FileSystemConfigurationStorageManager;(0x41747380):0x64
> > d0b000 ref [Lorg/apache/commons/logging/Log;]
> > Lorg/apache/commons/logging/Log;(0x417498d8):0x64d34000
> > 10-31 15:43:53.251: W/dalvikvm(5034):
> > (Linteractivespaces/configuration/FileSystemConfigurationStorageManager;
> > had used a different Lorg/apache/commons/logging/Log; during
> > pre-verification)
> > 10-31 15:43:53.251: W/System.err(5034): Exception
> > bootstrap/interactivespaces-system-1.2.0.jar
> > 10-31 15:43:53.251: W/System.err(5034):
> org.osgi.framework.BundleException:
> > Activator start error in bundle interactivespaces.system [24].
> > 10-31 15:43:53.251: W/System.err(5034):         at
> > org.apache.felix.framework.Felix.activateBundle(Felix.java:2027)
> > 10-31 15:43:53.251: W/System.err(5034):         at
> > org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
> > 10-31 15:43:53.251: W/System.err(5034):         at
> > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
> > 10-31 15:43:53.251: W/System.err(5034):         at
> > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)
> > 10-31 15:43:53.251: W/System.err(5034):         at
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundle(InteractiveSpacesFrameworkAndroidBootstrap.java:188)
> > 10-31 15:43:53.251: W/System.err(5034):         at
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundles(InteractiveSpacesFrameworkAndroidBootstrap.java:173)
> > 10-31 15:43:53.251: W/System.err(5034):         at
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.boot(InteractiveSpacesFrameworkAndroidBootstrap.java:124)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> >
> interactivespaces.android.service.InteractiveSpacesService.onStartCommand(InteractiveSpacesService.java:67)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2490)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > android.app.ActivityThread.access$1900(ActivityThread.java:130)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > android.os.Handler.dispatchMessage(Handler.java:99)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > android.os.Looper.loop(Looper.java:137)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > android.app.ActivityThread.main(ActivityThread.java:4745)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > java.lang.reflect.Method.invokeNative(Native Method)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > java.lang.reflect.Method.invoke(Method.java:511)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> >
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > dalvik.system.NativeStart.main(Native Method)
> > 10-31 15:43:53.261: W/System.err(5034): Caused by:
> > java.lang.IllegalAccessError: Class ref in pre-verified class resolved to
> > unexpected implementation
> > 10-31 15:43:53.261: W/System.err(5034):         at
> >
> interactivespaces.configuration.FileSystemConfigurationStorageManager.loadConfigFile(FileSystemConfigurationStorageManager.java:105)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> >
> interactivespaces.configuration.FileSystemConfigurationStorageManager.startup(FileSystemConfigurationStorageManager.java:82)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSystemConfiguration(GeneralInteractiveSpacesSupportActivator.java:315)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSpaceEnvironment(GeneralInteractiveSpacesSupportActivator.java:216)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.start(GeneralInteractiveSpacesSupportActivator.java:143)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> >
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
> > 10-31 15:43:53.261: W/System.err(5034):         ... 18 more
> >
> > I have tried experimenting with all of the legal values of the Bundle
> > Parent configuration property to no avail.
> >
> > How can I tell Felix to ignore Commons Logging from the system boot path
> > and only use the one from the bundle?
>
>
>
> --
> Karl Pauls
> karlpauls@gmail.com
> http://twitter.com/karlpauls
> http://www.linkedin.com/in/karlpauls
> https://profiles.google.com/karlpauls
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Android, boot delegation, and preverification

Posted by Keith Hughes <ke...@gmail.com>.
Actually, I cannot include commons logging as a jar in the APK. dx
complains about the fact that it already has the main interface for Log and
I can't add anything else.

And since the bytecodes are different between android and my code, I will
have to change my build system to use the bundle when not android and use
android when android.

Sigh.



On Thu, Nov 1, 2012 at 9:59 AM, Keith Hughes <ke...@gmail.com>wrote:

> OK, thanks Karl. I was beginning to think I might be stuck with something
> like that.
>
> One advantage, though, I suppose, is my bootstrap system can use the
> logging framework for itself.
>
> I will try and see if it solves my problem. I will respond one way or the
> other.
>
>
>
> On Thu, Nov 1, 2012 at 2:31 AM, Karl Pauls <ka...@gmail.com> wrote:
>
>> Part of your problem is that android/davlik is not Java. It doesn't
>> follow normal Java classloading rules. Where that bites us from an
>> OSGi pov is that you can't just substitute providers. In your case,
>> you might be able to get things to work by removing the imports of
>> bundles to commons logging but typically the only way to make things
>> work is to make sure you only have one provider of a given package --
>> hence, I'd remove commons logging from all bundles and put it in the
>> apk itself and have it bootdelegated.
>>
>> regards,
>>
>> Karl
>>
>> On Wed, Oct 31, 2012 at 11:05 PM, Keith Hughes <ke...@gmail.com>
>> wrote:
>> > Hi folks,
>> >
>> > I have an Android application based on Apache Felix. Everything works
>> fine
>> > when I run things on Linux, but as soon as I try moving to Android I run
>> > into a problem.
>> >
>> > My app uses Apache Commons Logging in all of its bundles. I have
>> included a
>> > bundle for Apache Commons Logging as a bundle as well.
>> >
>> > When the container starts up I get the following stack trace which
>> seems to
>> > point out that it is accessing the org/apache/commons/logging/Log in the
>> > Android system libraries.
>> > <
>> https://mail.google.com/mail/?view=cm&fs=1&tf=1&source=mailto&to=users-subscribe@felix.apache.org
>> >
>> > 10-31 15:43:53.251: W/dalvikvm(5034): Class resolved by unexpected DEX:
>> > Linterac
>> >
>> tivespaces/configuration/FileSystemConfigurationStorageManager;(0x41747380):0x64
>> > d0b000 ref [Lorg/apache/commons/logging/Log;]
>> > Lorg/apache/commons/logging/Log;(0x417498d8):0x64d34000
>> > 10-31 15:43:53.251: W/dalvikvm(5034):
>> > (Linteractivespaces/configuration/FileSystemConfigurationStorageManager;
>> > had used a different Lorg/apache/commons/logging/Log; during
>> > pre-verification)
>> > 10-31 15:43:53.251: W/System.err(5034): Exception
>> > bootstrap/interactivespaces-system-1.2.0.jar
>> > 10-31 15:43:53.251: W/System.err(5034):
>> org.osgi.framework.BundleException:
>> > Activator start error in bundle interactivespaces.system [24].
>> > 10-31 15:43:53.251: W/System.err(5034):         at
>> > org.apache.felix.framework.Felix.activateBundle(Felix.java:2027)
>> > 10-31 15:43:53.251: W/System.err(5034):         at
>> > org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
>> > 10-31 15:43:53.251: W/System.err(5034):         at
>> > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
>> > 10-31 15:43:53.251: W/System.err(5034):         at
>> > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)
>> > 10-31 15:43:53.251: W/System.err(5034):         at
>> >
>> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundle(InteractiveSpacesFrameworkAndroidBootstrap.java:188)
>> > 10-31 15:43:53.251: W/System.err(5034):         at
>> >
>> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundles(InteractiveSpacesFrameworkAndroidBootstrap.java:173)
>> > 10-31 15:43:53.251: W/System.err(5034):         at
>> >
>> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.boot(InteractiveSpacesFrameworkAndroidBootstrap.java:124)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> >
>> interactivespaces.android.service.InteractiveSpacesService.onStartCommand(InteractiveSpacesService.java:67)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> > android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2490)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> > android.app.ActivityThread.access$1900(ActivityThread.java:130)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> > android.os.Handler.dispatchMessage(Handler.java:99)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> > android.os.Looper.loop(Looper.java:137)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> > android.app.ActivityThread.main(ActivityThread.java:4745)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> > java.lang.reflect.Method.invokeNative(Native Method)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> > java.lang.reflect.Method.invoke(Method.java:511)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> >
>> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> > dalvik.system.NativeStart.main(Native Method)
>> > 10-31 15:43:53.261: W/System.err(5034): Caused by:
>> > java.lang.IllegalAccessError: Class ref in pre-verified class resolved
>> to
>> > unexpected implementation
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> >
>> interactivespaces.configuration.FileSystemConfigurationStorageManager.loadConfigFile(FileSystemConfigurationStorageManager.java:105)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> >
>> interactivespaces.configuration.FileSystemConfigurationStorageManager.startup(FileSystemConfigurationStorageManager.java:82)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> >
>> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSystemConfiguration(GeneralInteractiveSpacesSupportActivator.java:315)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> >
>> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSpaceEnvironment(GeneralInteractiveSpacesSupportActivator.java:216)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> >
>> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.start(GeneralInteractiveSpacesSupportActivator.java:143)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> >
>> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
>> > 10-31 15:43:53.261: W/System.err(5034):         at
>> > org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
>> > 10-31 15:43:53.261: W/System.err(5034):         ... 18 more
>> >
>> > I have tried experimenting with all of the legal values of the Bundle
>> > Parent configuration property to no avail.
>> >
>> > How can I tell Felix to ignore Commons Logging from the system boot path
>> > and only use the one from the bundle?
>>
>>
>>
>> --
>> Karl Pauls
>> karlpauls@gmail.com
>> http://twitter.com/karlpauls
>> http://www.linkedin.com/in/karlpauls
>> https://profiles.google.com/karlpauls
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>

Re: Android, boot delegation, and preverification

Posted by Keith Hughes <ke...@gmail.com>.
OK, thanks Karl. I was beginning to think I might be stuck with something
like that.

One advantage, though, I suppose, is my bootstrap system can use the
logging framework for itself.

I will try and see if it solves my problem. I will respond one way or the
other.



On Thu, Nov 1, 2012 at 2:31 AM, Karl Pauls <ka...@gmail.com> wrote:

> Part of your problem is that android/davlik is not Java. It doesn't
> follow normal Java classloading rules. Where that bites us from an
> OSGi pov is that you can't just substitute providers. In your case,
> you might be able to get things to work by removing the imports of
> bundles to commons logging but typically the only way to make things
> work is to make sure you only have one provider of a given package --
> hence, I'd remove commons logging from all bundles and put it in the
> apk itself and have it bootdelegated.
>
> regards,
>
> Karl
>
> On Wed, Oct 31, 2012 at 11:05 PM, Keith Hughes <ke...@gmail.com>
> wrote:
> > Hi folks,
> >
> > I have an Android application based on Apache Felix. Everything works
> fine
> > when I run things on Linux, but as soon as I try moving to Android I run
> > into a problem.
> >
> > My app uses Apache Commons Logging in all of its bundles. I have
> included a
> > bundle for Apache Commons Logging as a bundle as well.
> >
> > When the container starts up I get the following stack trace which seems
> to
> > point out that it is accessing the org/apache/commons/logging/Log in the
> > Android system libraries.
> > <
> https://mail.google.com/mail/?view=cm&fs=1&tf=1&source=mailto&to=users-subscribe@felix.apache.org
> >
> > 10-31 15:43:53.251: W/dalvikvm(5034): Class resolved by unexpected DEX:
> > Linterac
> >
> tivespaces/configuration/FileSystemConfigurationStorageManager;(0x41747380):0x64
> > d0b000 ref [Lorg/apache/commons/logging/Log;]
> > Lorg/apache/commons/logging/Log;(0x417498d8):0x64d34000
> > 10-31 15:43:53.251: W/dalvikvm(5034):
> > (Linteractivespaces/configuration/FileSystemConfigurationStorageManager;
> > had used a different Lorg/apache/commons/logging/Log; during
> > pre-verification)
> > 10-31 15:43:53.251: W/System.err(5034): Exception
> > bootstrap/interactivespaces-system-1.2.0.jar
> > 10-31 15:43:53.251: W/System.err(5034):
> org.osgi.framework.BundleException:
> > Activator start error in bundle interactivespaces.system [24].
> > 10-31 15:43:53.251: W/System.err(5034):         at
> > org.apache.felix.framework.Felix.activateBundle(Felix.java:2027)
> > 10-31 15:43:53.251: W/System.err(5034):         at
> > org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
> > 10-31 15:43:53.251: W/System.err(5034):         at
> > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
> > 10-31 15:43:53.251: W/System.err(5034):         at
> > org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)
> > 10-31 15:43:53.251: W/System.err(5034):         at
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundle(InteractiveSpacesFrameworkAndroidBootstrap.java:188)
> > 10-31 15:43:53.251: W/System.err(5034):         at
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundles(InteractiveSpacesFrameworkAndroidBootstrap.java:173)
> > 10-31 15:43:53.251: W/System.err(5034):         at
> >
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.boot(InteractiveSpacesFrameworkAndroidBootstrap.java:124)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> >
> interactivespaces.android.service.InteractiveSpacesService.onStartCommand(InteractiveSpacesService.java:67)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2490)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > android.app.ActivityThread.access$1900(ActivityThread.java:130)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > android.os.Handler.dispatchMessage(Handler.java:99)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > android.os.Looper.loop(Looper.java:137)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > android.app.ActivityThread.main(ActivityThread.java:4745)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > java.lang.reflect.Method.invokeNative(Native Method)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > java.lang.reflect.Method.invoke(Method.java:511)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> >
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > dalvik.system.NativeStart.main(Native Method)
> > 10-31 15:43:53.261: W/System.err(5034): Caused by:
> > java.lang.IllegalAccessError: Class ref in pre-verified class resolved to
> > unexpected implementation
> > 10-31 15:43:53.261: W/System.err(5034):         at
> >
> interactivespaces.configuration.FileSystemConfigurationStorageManager.loadConfigFile(FileSystemConfigurationStorageManager.java:105)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> >
> interactivespaces.configuration.FileSystemConfigurationStorageManager.startup(FileSystemConfigurationStorageManager.java:82)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSystemConfiguration(GeneralInteractiveSpacesSupportActivator.java:315)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSpaceEnvironment(GeneralInteractiveSpacesSupportActivator.java:216)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> >
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.start(GeneralInteractiveSpacesSupportActivator.java:143)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> >
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
> > 10-31 15:43:53.261: W/System.err(5034):         at
> > org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
> > 10-31 15:43:53.261: W/System.err(5034):         ... 18 more
> >
> > I have tried experimenting with all of the legal values of the Bundle
> > Parent configuration property to no avail.
> >
> > How can I tell Felix to ignore Commons Logging from the system boot path
> > and only use the one from the bundle?
>
>
>
> --
> Karl Pauls
> karlpauls@gmail.com
> http://twitter.com/karlpauls
> http://www.linkedin.com/in/karlpauls
> https://profiles.google.com/karlpauls
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>

Re: Android, boot delegation, and preverification

Posted by Karl Pauls <ka...@gmail.com>.
Part of your problem is that android/davlik is not Java. It doesn't
follow normal Java classloading rules. Where that bites us from an
OSGi pov is that you can't just substitute providers. In your case,
you might be able to get things to work by removing the imports of
bundles to commons logging but typically the only way to make things
work is to make sure you only have one provider of a given package --
hence, I'd remove commons logging from all bundles and put it in the
apk itself and have it bootdelegated.

regards,

Karl

On Wed, Oct 31, 2012 at 11:05 PM, Keith Hughes <ke...@gmail.com> wrote:
> Hi folks,
>
> I have an Android application based on Apache Felix. Everything works fine
> when I run things on Linux, but as soon as I try moving to Android I run
> into a problem.
>
> My app uses Apache Commons Logging in all of its bundles. I have included a
> bundle for Apache Commons Logging as a bundle as well.
>
> When the container starts up I get the following stack trace which seems to
> point out that it is accessing the org/apache/commons/logging/Log in the
> Android system libraries.
> <ht...@felix.apache.org>
> 10-31 15:43:53.251: W/dalvikvm(5034): Class resolved by unexpected DEX:
> Linterac
> tivespaces/configuration/FileSystemConfigurationStorageManager;(0x41747380):0x64
> d0b000 ref [Lorg/apache/commons/logging/Log;]
> Lorg/apache/commons/logging/Log;(0x417498d8):0x64d34000
> 10-31 15:43:53.251: W/dalvikvm(5034):
> (Linteractivespaces/configuration/FileSystemConfigurationStorageManager;
> had used a different Lorg/apache/commons/logging/Log; during
> pre-verification)
> 10-31 15:43:53.251: W/System.err(5034): Exception
> bootstrap/interactivespaces-system-1.2.0.jar
> 10-31 15:43:53.251: W/System.err(5034): org.osgi.framework.BundleException:
> Activator start error in bundle interactivespaces.system [24].
> 10-31 15:43:53.251: W/System.err(5034):         at
> org.apache.felix.framework.Felix.activateBundle(Felix.java:2027)
> 10-31 15:43:53.251: W/System.err(5034):         at
> org.apache.felix.framework.Felix.startBundle(Felix.java:1895)
> 10-31 15:43:53.251: W/System.err(5034):         at
> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:944)
> 10-31 15:43:53.251: W/System.err(5034):         at
> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:931)
> 10-31 15:43:53.251: W/System.err(5034):         at
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundle(InteractiveSpacesFrameworkAndroidBootstrap.java:188)
> 10-31 15:43:53.251: W/System.err(5034):         at
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.startBundles(InteractiveSpacesFrameworkAndroidBootstrap.java:173)
> 10-31 15:43:53.251: W/System.err(5034):         at
> interactivespaces.android.service.InteractiveSpacesFrameworkAndroidBootstrap.boot(InteractiveSpacesFrameworkAndroidBootstrap.java:124)
> 10-31 15:43:53.261: W/System.err(5034):         at
> interactivespaces.android.service.InteractiveSpacesService.onStartCommand(InteractiveSpacesService.java:67)
> 10-31 15:43:53.261: W/System.err(5034):         at
> android.app.ActivityThread.handleServiceArgs(ActivityThread.java:2490)
> 10-31 15:43:53.261: W/System.err(5034):         at
> android.app.ActivityThread.access$1900(ActivityThread.java:130)
> 10-31 15:43:53.261: W/System.err(5034):         at
> android.app.ActivityThread$H.handleMessage(ActivityThread.java:1292)
> 10-31 15:43:53.261: W/System.err(5034):         at
> android.os.Handler.dispatchMessage(Handler.java:99)
> 10-31 15:43:53.261: W/System.err(5034):         at
> android.os.Looper.loop(Looper.java:137)
> 10-31 15:43:53.261: W/System.err(5034):         at
> android.app.ActivityThread.main(ActivityThread.java:4745)
> 10-31 15:43:53.261: W/System.err(5034):         at
> java.lang.reflect.Method.invokeNative(Native Method)
> 10-31 15:43:53.261: W/System.err(5034):         at
> java.lang.reflect.Method.invoke(Method.java:511)
> 10-31 15:43:53.261: W/System.err(5034):         at
> com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
> 10-31 15:43:53.261: W/System.err(5034):         at
> com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
> 10-31 15:43:53.261: W/System.err(5034):         at
> dalvik.system.NativeStart.main(Native Method)
> 10-31 15:43:53.261: W/System.err(5034): Caused by:
> java.lang.IllegalAccessError: Class ref in pre-verified class resolved to
> unexpected implementation
> 10-31 15:43:53.261: W/System.err(5034):         at
> interactivespaces.configuration.FileSystemConfigurationStorageManager.loadConfigFile(FileSystemConfigurationStorageManager.java:105)
> 10-31 15:43:53.261: W/System.err(5034):         at
> interactivespaces.configuration.FileSystemConfigurationStorageManager.startup(FileSystemConfigurationStorageManager.java:82)
> 10-31 15:43:53.261: W/System.err(5034):         at
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSystemConfiguration(GeneralInteractiveSpacesSupportActivator.java:315)
> 10-31 15:43:53.261: W/System.err(5034):         at
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.setupSpaceEnvironment(GeneralInteractiveSpacesSupportActivator.java:216)
> 10-31 15:43:53.261: W/System.err(5034):         at
> interactivespaces.system.bootstrap.osgi.GeneralInteractiveSpacesSupportActivator.start(GeneralInteractiveSpacesSupportActivator.java:143)
> 10-31 15:43:53.261: W/System.err(5034):         at
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:645)
> 10-31 15:43:53.261: W/System.err(5034):         at
> org.apache.felix.framework.Felix.activateBundle(Felix.java:1977)
> 10-31 15:43:53.261: W/System.err(5034):         ... 18 more
>
> I have tried experimenting with all of the legal values of the Bundle
> Parent configuration property to no avail.
>
> How can I tell Felix to ignore Commons Logging from the system boot path
> and only use the one from the bundle?



-- 
Karl Pauls
karlpauls@gmail.com
http://twitter.com/karlpauls
http://www.linkedin.com/in/karlpauls
https://profiles.google.com/karlpauls

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
For additional commands, e-mail: users-help@felix.apache.org