felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Karl Pauls <karlpa...@gmail.com>
Subject Re: Android, boot delegation, and preverification
Date Thu, 01 Nov 2012 08:31:58 GMT
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


Mime
View raw message