felix-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Victor Manso Morente <vicma...@gmail.com>
Subject Re: Info about Apache Felix Framework and Google Android
Date Wed, 24 Oct 2018 10:25:49 GMT
Hi, again

I have started to do an Android app, I can't install a simple bundle for
example OSGiHelloWorld.

The OSGiHelloWorld.jar is prepared for Apache Felix with:

dx --dex --output=classes.dex JAR_file.jar

aapt add JAR_file.jar classes.dex


The logs are:


D/Felix: Felix is started
D/Felix: Bundle: org.apache.felix.framework
D/Felix: /storage/emulated/0
D/Felix: Additional Bundles were not installed
    Unable to cache bundle:
file:/storage/emulated/0/felix/OSGiHelloWorld.jar
W/System.err: org.osgi.framework.BundleException: Unable to cache bundle:
file:/storage/emulated/0/felix/OSGiHelloWorld.jar
        at org.apache.felix.framework.Felix.installBundle(Felix.java:3227)
W/System.err:     at
org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:147)
        at
org.apache.felix.framework.BundleContextImpl.installBundle(BundleContextImpl.java:120)
W/System.err:     at
es.upv.osgiandroid.MainActivity.lanzarFelix(MainActivity.java:117)
W/System.err:     at
es.upv.osgiandroid.MainActivity.onCreate(MainActivity.java:51)
W/System.err:     at android.app.Activity.performCreate(Activity.java:7084)
W/System.err:     at android.app.Activity.performCreate(Activity.java:7075)
W/System.err:     at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1215)
        at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2765)
        at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2890)
        at android.app.ActivityThread.-wrap11(Unknown Source:0)
        at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:1611)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:171)
        at android.app.ActivityThread.main(ActivityThread.java:6633)
        at java.lang.reflect.Method.invoke(Native Method)
        at
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:823)
    Caused by: java.io.FileNotFoundException:
/storage/emulated/0/felix/OSGiHelloWorld.jar (Permission denied)
W/System.err:     at java.io.FileInputStream.open0(Native Method)
        at java.io.FileInputStream.open(FileInputStream.java:200)
        at java.io.FileInputStream.<init>(FileInputStream.java:150)
        at java.io.FileInputStream.<init>(FileInputStream.java:103)
        at
sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90)
        at
sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188)
        at
org.apache.felix.framework.util.SecureAction.getURLConnectionInputStream(SecureAction.java:525)
        at
org.apache.felix.framework.cache.JarRevision.initialize(JarRevision.java:166)
        at
org.apache.felix.framework.cache.JarRevision.<init>(JarRevision.java:76)
        at
org.apache.felix.framework.cache.BundleArchive.createRevisionFromLocation(BundleArchive.java:799)
        at
org.apache.felix.framework.cache.BundleArchive.reviseInternal(BundleArchive.java:480)
        at
org.apache.felix.framework.cache.BundleArchive.<init>(BundleArchive.java:148)
        at
org.apache.felix.framework.cache.BundleCache.create(BundleCache.java:462)
        at org.apache.felix.framework.Felix.installBundle(Felix.java:3223)
    ... 17 more
D/Felix: Bundle: org.apache.felix.framework,ID: 0


Someone can explain me, why says "Caused by: java.io.FileNotFoundException:
/storage/emulated/0/felix/OSGiHelloWorld.jar (Permission denied)"

The jar is in this place.

Thank you very much.

Best regards,
Víctor

El lun., 8 oct. 2018 a las 21:08, Jörg Wille (<joerg.wille@gmail.com>)
escribió:

> Hi Victor,
> I don't know if you are facing the same problem I had, when I was trying
> Felix on Android 8.1, targeting API 27, a couple month ago.
> I have dexified my test-bundle with this
> <https://github.com/luoqii/felix-on-android/blob/master/dexify.sh> script.
> Felix does start and the bundle gets successfully installed
> (context.installBundle(url, is)).
> But when I try to start the bundle I get following exception:
>
> *Opening an oat file without a class loader. Are you using the deprecated
> DexFile APIs?*
>
> The DexFile is being used by Felix in
> Class org.apache.felix.framework.BundleWiringImpl (1342) and I have read
> <https://developer.android.com/reference/dalvik/system/DexFile.html> that
> the DexFile class is deprecated since Android API 26.
> But although deprecated, I checked that this class is still part of the API
> 27, so this felix code should actually still work.
> Here is the error log:
> 03-30 09:29:08.647: W/System.err(6351):
> java.lang.reflect.InvocationTargetException
> 03-30 09:29:08.647: W/System.err(6351):  at
> java.lang.reflect.Method.invoke(Native Method)
> 03-30 09:29:08.647: W/System.err(6351):  at
> javafxports.android.DalvikLauncher$1.run(DalvikLauncher.java:188)
> 03-30 09:29:08.648: W/System.err(6351):  at
> java.lang.Thread.run(Thread.java:764)
> 03-30 09:29:08.648: W/System.err(6351): Caused by:
> java.lang.RuntimeException: Exception in Application init method
> 03-30 09:29:08.648: W/System.err(6351):  at
>
> com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:912)
> 03-30 09:29:08.648: W/System.err(6351):  at
>
> com.sun.javafx.application.LauncherImpl.lambda$launchApplication$138(LauncherImpl.java:182)
> 03-30 09:29:08.648: D/vndksupport(2155): Loading /vendor/lib64/hw/
> gralloc.hikey960.so from current namespace instead of sphal namespace.
> 03-30 09:29:08.648: W/System.err(6351):  at
> com.sun.javafx.application.LauncherImpl.access$lambda$1(Unknown Source:8)
> 03-30 09:29:08.648: W/System.err(6351):  at
> com.sun.javafx.application.LauncherImpl$$Lambda$2.run(Unknown Source:13)
> 03-30 09:29:08.648: W/System.err(6351):  ... 1 more
> 03-30 09:29:08.648: W/System.err(6351): Caused by:
> org.osgi.framework.BundleException: Activator start error in bundle
> com.indsp.playground.helloworldbundle.HelloWorld [1].
> 03-30 09:29:08.648: W/System.err(6351):  at
> org.apache.felix.framework.Felix.activateBundle(Felix.java:2289)
> 03-30 09:29:08.648: W/System.err(6351):  at
> org.apache.felix.framework.Felix.startBundle(Felix.java:2145)
> 03-30 09:29:08.648: W/System.err(6351):  at
> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
> 03-30 09:29:08.648: W/System.err(6351):  at
> org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)
> 03-30 09:29:08.648: W/System.err(6351):  at
>
> com.indsp.playground.osgimobiledemo.osgijavafxdemo.OsgiApplication.init(OsgiApplication.java:60)
> 03-30 09:29:08.648: W/System.err(6351):  at
>
> com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:841)
> 03-30 09:29:08.648: W/System.err(6351):  ... 4 more
> 03-30 09:29:08.648: W/System.err(6351): Caused by:
> java.lang.UnsupportedOperationException: can't load this type of class file
> 03-30 09:29:08.648: W/System.err(6351):  at
> java.lang.ClassLoader.defineClass(ClassLoader.java:591)
> 03-30 09:29:08.648: W/System.err(6351):  at
>
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.defineClass(BundleWiringImpl.java:2375)
> 03-30 09:29:08.649: W/System.err(6351):  at
>
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.findClass(BundleWiringImpl.java:2159)
> 03-30 09:29:08.649: W/System.err(6351):  at
>
> org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1578)
> 03-30 09:29:08.649: W/System.err(6351):  at
>
> org.apache.felix.framework.BundleWiringImpl.access$200(BundleWiringImpl.java:80)
> 03-30 09:29:08.649: W/System.err(6351):  at
>
> org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:2018)
> 03-30 09:29:08.649: W/System.err(6351):  at
> java.lang.ClassLoader.loadClass(ClassLoader.java:312)
> 03-30 09:29:08.649: W/System.err(6351):  at
>
> org.apache.felix.framework.BundleWiringImpl.getClassByDelegation(BundleWiringImpl.java:1404)
> 03-30 09:29:08.649: W/System.err(6351):  at
> org.apache.felix.framework.Felix.createBundleActivator(Felix.java:4505)
> 03-30 09:29:08.649: W/System.err(6351):  at
> org.apache.felix.framework.Felix.activateBundle(Felix.java:2220)
> 03-30 09:29:08.649: W/System.err(6351):  ... 9 more
>
> I am interested to see the error logs you get.
> Thanks,
> Jorg
>
>
> Am Mo., 8. Okt. 2018 um 17:57 Uhr schrieb Victor Manso Morente <
> vicmanmo@gmail.com>:
>
> > You can explain me how I can do it or if you have an example of an
> android
> > application.
> >
> > Thank you very much
> >
> > El lun., 8 oct. 2018 16:40, Bruce Jackson <bruce.jackson@thingstream.io>
> > escribió:
> >
> > > I haven’t tried this recently, but last time I did, I just downloaded
> the
> > > felix jar from the main download page and included it as a library into
> > my
> > > Android application.
> > >
> > > > On 8 Oct 2018, at 16:36, Victor Manso Morente <vicmanmo@gmail.com>
> > > wrote:
> > > >
> > > > Hi Bruce
> > > >
> > > > I can't download It and I can't try It.
> > > >
> > > > Because I try to do an application to embed Apache felix in Android
> to
> > > run
> > > > a gateway of osgi.
> > > >
> > > > Thanks.
> > > >
> > > > El lun., 8 oct. 2018 15:36, Bruce Jackson <
> > bruce.jackson@thingstream.io>
> > > > escribió:
> > > >
> > > >> Hi Victor
> > > >>
> > > >> When you say "doesn't work" what do you mean? Have you got some logs
> > you
> > > >> can send?
> > > >>
> > > >> Thanks
> > > >>
> > > >> Bruce
> > > >>
> > > >> On Mon, 8 Oct 2018 at 14:54, Victor Manso Morente <
> vicmanmo@gmail.com
> > >
> > > >> wrote:
> > > >>
> > > >>> Hi,
> > > >>>
> > > >>> I need your help about *Apache Felix Framework and Google Android*
> > > >>>
> > > >>> I have seen the page:
> > > >>>
> > > >>>
> > > >>>
> > > >>
> > >
> >
> http://felix.apache.org/documentation/subprojects/apache-felix-framework/apache-felix-framework-and-google-android.html
> > > >>>
> > > >>> But the project zip file osgi-android.zip
> > > >>> <
> > > >>>
> > > >>
> > >
> >
> http://felix.apache.org/documentation/subprojects/apache-felix-framework/apache-felix-framework-and-google-android.html
> > > >>>> ,
> > > >>> doesn't work.
> > > >>>
> > > >>> Can you help me?
> > > >>>
> > > >>> Thank you very much.
> > > >>>
> > > >>> Best  regards,
> > > >>> Víctor
> > > >>>
> > > >>
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> > > For additional commands, e-mail: users-help@felix.apache.org
> > >
> > >
> >
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message