[ 
https://issues.apache.org/jira/browse/FELIX-4315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Giorgi Vladimir Kazakov closed FELIX-4315.
------------------------------------------

    Resolution: Fixed

The issue comes from a redefinition of classes. Dalvik does not support having 
classes define twice (even in two different bundles or classloaders). That 
means you can't follow the good practice rules of OSGi you generally use:

each class must be defined once and only once
each exported package must be defined only once (regardless its version)
I suppose you have another bundle exporting the configuration admin package or 
the log service package (such as the OSGi Compendium, or an implementation of 
these services). In this case you need to transform a bit the iPOJO bundle by 
removing the export of these packages as well as the included classes. If you 
can package iPOJO yourself, open the pom file and remove:

<!-- Compendium packages -->
org.osgi.service.cm; version=1.3,
org.osgi.service.log; version=1.3

> Start apache-felix 4.2.1 with iPOJO on Android
> ----------------------------------------------
>
>                 Key: FELIX-4315
>                 URL: https://issues.apache.org/jira/browse/FELIX-4315
>             Project: Felix
>          Issue Type: Bug
>          Components: Framework, iPOJO
>    Affects Versions: framework-4.2.1, ipojo-runtime-1.11.0
>         Environment: Android: 4.0, 4.2, 4.2, 4.3
>            Reporter: Giorgi Vladimir Kazakov
>
> I try to start apache-felix 4.2.1 with iPOJO 1.11.0 on Android 4.+.
> config.properties standard with added:
> org.osgi.framework.system.packages.extra= \
> android, \
> android.accessibilityservice, \
> ...
> android.support.v4.view.accessibility, \
> android.support.v4.widget
> start command:
> /system/bin/dalvikvm -Xbootclasspath:/system/framework/core.jar -classpath 
> bin/felix.jar org.apache.felix.main.Main
> After start it write:
> Problem creating boot delegation class loader: 
> java.lang.reflect.InvocationTargetException
> When start Apache Felix iPOJO (1.11.0) throws error:
> ! ERROR: Bundle org.apache.felix.ipojo [14] Error starting 
> file:/data/local/feli
> x/felix-framework-4.2.1a/bundle/org.apache.felix.ipojo-1.11.0.jar 
> (org.osgi.fram
> ework.BundleException: Activator start error in bundle org.apache.felix.ipojo 
> [1
> 4].)
> java.lang.NoClassDefFoundError: 
> org.apache.felix.ipojo.util.Logger$ConsoleLogSer
> vice
>         at org.apache.felix.ipojo.util.Logger.<clinit>(Logger.java:51)
>         at 
> org.apache.felix.ipojo.extender.internal.Extender.start(Extender.java
> :123)
>         at 
> org.apache.felix.framework.util.SecureAction.startActivator(SecureAct
> ion.java:645)
>         at org.apache.felix.framework.Felix.activateBundle(Felix.java:2146)
>         at org.apache.felix.framework.Felix.startBundle(Felix.java:2064)
>         at 
> org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1291)
>         at 
> org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStart
> LevelImpl.java:304)
>         at java.lang.Thread.run(Thread.java:841)
> Then dexing have warning, but not for ConsoleLogService warning.
> dx --dex --output=./classes.dex ./org.apache.felix.ipojo-1.11.0.jar:
> warning: Ignoring InnerClasses attribute for an anonymous inner class
> (org.osgi.service.cm.ConfigurationPermissionCollection$1) that doesn't come 
> with
>  an
> associated EnclosingMethod attribute. This class was probably produced by a
> compiler that did not target the modern .class file format. The recommended
> solution is to recompile the class from source, using an up-to-date compiler
> and without specifying any "-target" type options. The consequence of ignoring
> this warning is that reflective operations on this class will incorrectly
> indicate that it is *not* an inner class.
> See details:
> http://stackoverflow.com/questions/19892520/start-apache-felix-4-2-1-with-ipojo-on-android



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to