Hello Angelo,
Thank you for your fast response!
Here is some more info:
a:
public FelixManager(String rootPath)
{
this.rootPath = rootPath;
felixProperties = new FelixProperties(this.rootPath);
bundlesDir = new File(rootPath+"/felix/bundle");
if (!bundlesDir.exists()) {
if (!bundlesDir.mkdirs()) {
throw new IllegalStateException("Unable to create bundles dir");
}
}
cacheDir = new File(rootPath+"/felix/cache");
if (!cacheDir.exists()) {
if (!cacheDir.mkdirs()) {
throw new IllegalStateException("Unable to create felixcache dir");
}
}
try
{
felix = new Felix(felixProperties);
felix.start();
}
catch (Exception ex)
{
ex.printStackTrace();
}
}
The felix properties are defined as following:
private String m_felixAbsolutePath;
public FelixProperties(String rootpath)
{
m_felixAbsolutePath = rootpath;
put("org.osgi.framework.storage", m_felixAbsolutePath+"/felix/cache");
put("felix.cache.rootdir",m_felixAbsolutePath+"/felix");
put("felix.log.level", "4");
put("felix.startlevel.bundle", "1");
put("org.osgi.framework.system.packages.extra",
ANDROID_PACKAGES_FOR_EXPORT);
}
private final String ANDROID_PACKAGES_FOR_EXPORT=
"android; " +
"android.app;" +
"android.content;" +
"android.database;" + etc. etc.
and b:
Manifest-Version: 1.0
Bundle-Name: drawbundle
Bundle-Activator: com.osgi.integration.drawbundle.Activator
Bundle-SymbolicName: com.osgi.integration.drawbundle
Bundle-Version: 0.0.1
Import-Package: org.osgi.framework,
DynamicImport-Package: android.*
I first, to no avail, tried including the Android packages manually in the
Import-Package statement, like so:
Import-Package: org.osgi.framework,
android.view.LayoutInflater,
android.view.View,
android.widget.LinearLayout,
android.app.Activity,
android.app.TextView
I've also tried including the Android jarfile in another bundle, and
exporting the packages from there, and then importing that bundle in the
above manifest.
Maurice
On Mon, Apr 2, 2012 at 10:39 AM, Angelo van der Sijpt <
[email protected]> wrote:
> This could have something to do with the way you instantiate your
> framework, _or_ with the way your bundle is packaged.
> Could you post (a) your framework instantiation code, and (b) the manifest
> of your bundle?
>
> Angelo
>
>
> On Apr 2, 2012, at 10:18 AM, M. van Ree wrote:
>
> > Hello all,
> >
> > I have a problem when trying to make the Android lib available to my OSGi
> > bundles.
> > The error I'm getting is:
> >
> > 04-02 08:03:00.351: W/dalvikvm(18531): Method mismatch: onDraw in
> > Lcom/osgi/integration/drawbundle/DrawView; (cl=0x4067bb40) and super
> > Landroid/view/View; (cl=0x0)
> > 04-02 08:03:00.391: W/System.err(18531): Caused by:
> java.lang.LinkageError:
> > Classes resolve differently in superclass
> >
> > Off course I can see the cl=0x0, so that must be the culprit, but I have
> no
> > idea on how to get it fixed...
> > I'm exporting the packages as following in a properties class:
> >
> > private static final String ANDROID_PACKAGES_FOR_EXPORT =
> > ("android; " +
> > "android.app;" +
> > "android.content;" +
> > "android.database;" +
> > etc. etc. );
> >
> > I'm really drawing a blank here on what could be wrong, I would expect to
> > receive an error on exporting/importing something empty that would point
> me
> > in the right direction, but it doesn't seem to be the case.
> > Who can tell me what I'm doing wrong here?
> >
> >
> > Regards,
> > Maurice
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
--
Met vriendelijke groet,
Maurice van Ree