Apache Felix Framework and Alternative Java VMs

This page is intended to document experiences of running Felix on alternative Java VMs. Currently, the following VMs are included:

If you have an experience you would like to contribute or edits/additions to an existing platform, please contribute it.

Mika Java Virtual Machine

Contributed by David Lindelöf.

We have made Apache Felix run successfully on the UNC90 embedded platform and here I'd like to share our experience.

Our UNC90 runs on an ARM9 chip with 16 Mb flash and 32 Mb RAM. It runs the uClinux operating system. The flash is divided in four partitions according to the linux/drivers/mtd/maps/modarm9.c file in uClinux's source distribution:

/dev/mtdblock/1: 256 kB for the U-Boot loader
/dev/mtdblock/2: 2.75 MB for the uClinux kernel
/dev/mtdblock/3: ~3 MB for the root partition
/dev/mtdblock/4: ~6.4 MB for user applications, mounted on /mnt

We have chosen the Mika Java Virtual Machine, made by /k/ Embedded Java Solutions. We install it under /usr/bin and /usr/lib respectively, and its total footprint is about 1.67 MB. It claims to be compatible with at least Java 1.3, but already includes many features from Java 1.4.

We have installed Felix on the user applications partition under /mnt/felix. The framework is then started by a script similar to this:

mika 
    -Dfelix.config.properties=file:felix.config.properties 
    -Djava.protocol.handler.pkgs=wonka.net 
    -jar bin/felix.jar

We had to slightly modify the default configuration file. We force the framework to export system packages as if we were running Java 1.4:

org.osgi.framework.system.packages=org.osgi.framework; version=1.3.0, 
 org.osgi.service.packageadmin; version=1.2.0, 
 org.osgi.service.startlevel; version=1.0.0, 
 org.osgi.service.url; version=1.0.0, 
 ${jre-1.4}
# ${jre-${java.specification.version}}

The -Djava.protocol.handler.pkgs=wonka.net option is necessary if you want to do anything URL-related. See here for a full discussion. Basically, we must specify the name of a package containing protocol handlers, which defaults to sun.net.www.protocol. But with Mika this must be set to wonka.net (use com.acunia.wonka.net on older versions of Mika).

We have found this setup to be more than satisfactory in terms of stability, performance and memory usage. We have uncovered several bugs in Mika's class library, but the folks at /k/ have always patched them in a timely manner.

Feedback

Subscribe to the Felix users mailing list by sending a message to users-subscribe@felix.apache.org; after subscribing, email questions or feedback to users@felix.apache.org.

  • No labels