On Mon, Nov 26, 2012 at 6:32 PM, Keith Hughes <[email protected]>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 <[email protected]> wrote:
>
> > you can update bundles :-)
> >
> > regards,
> >
> > Karl
> >
> >
> > On Mon, Nov 19, 2012 at 6:19 PM, Keith Hughes <[email protected]
> > >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 <[email protected]
> > > >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 <[email protected]>
> > 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 <
> > [email protected]
> > > >> >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 <[email protected]>
> > > 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 <
> > > >> [email protected]>
> > > >> > > 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&[email protected]
> > > >> > > >
> > > >> > > > 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
> > > >> > > [email protected]
> > > >> > > http://twitter.com/karlpauls
> > > >> > > http://www.linkedin.com/in/karlpauls
> > > >> > > https://profiles.google.com/karlpauls
> > > >> > >
> > > >> > >
> > > ---------------------------------------------------------------------
> > > >> > > To unsubscribe, e-mail: [email protected]
> > > >> > > For additional commands, e-mail: [email protected]
> > > >> > >
> > > >> > >
> > > >> >
> > > >>
> > > >>
> > > >>
> > > >> --
> > > >> Karl Pauls
> > > >> [email protected]
> > > >> http://twitter.com/karlpauls
> > > >> http://www.linkedin.com/in/karlpauls
> > > >> https://profiles.google.com/karlpauls
> > > >>
> > > >
> > > >
> > >
> >
> >
> >
> > --
> > Karl Pauls
> > [email protected]
> > http://twitter.com/karlpauls
> > http://www.linkedin.com/in/karlpauls
> > https://profiles.google.com/karlpauls
> >
>



-- 
Karl Pauls
[email protected]
http://twitter.com/karlpauls
http://www.linkedin.com/in/karlpauls
https://profiles.google.com/karlpauls

Reply via email to