felix-framework does not start - resource error

Bug #1010742 reported by Scott Wimer
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
felix-main (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Ubuntu 12.04
felix-main 4.0.1-2
libfelix-main-java 4.0.1-2

The felix-framework script does not start. Instead, when it attempts to run the /usr/share/java/org.apache.felix.main.jar jar file, it exits due to a resource error. Here is the resulting stack trace:
$ felix-framework
Could not create framework: java.lang.Exception: Could not find framework factory.
java.lang.Exception: Could not find framework factory.
 at org.apache.felix.main.Main.getFrameworkFactory(Main.java:346)
 at org.apache.felix.main.Main.main(Main.java:286)

When I run the jar by hand in verbose mode (reproducing the command line that the felix-framework script uses, I get the following output (massively trimmed down):
$ java -verbose -Dfelix.config.properties=file:/etc/felix-framework/config.properties -jar /usr/share/felix-framework/bin/felix.jar org.apache.felix.upnp.tester-0.4.0.jar
[Opened /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/rt.jar]
[Loaded java.lang.Object from /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/rt.jar]
    [ ... SNIP ... ]
[Loaded org.apache.felix.framework.util.Util from file:/usr/share/maven-repo/org/apache/felix/org.apache.felix.main/4.0.1/org.apache.felix.main-4.0.1.jar]
[Loaded java.lang.IllegalArgumentException from /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/rt.jar]
[Loaded java.lang.NumberFormatException from /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/rt.jar]
[Loaded sun.misc.Launcher$1 from /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/rt.jar]
[Loaded java.net.URLClassLoader$2 from /usr/lib/jvm/java-6-openjdk-amd64/jre/lib/rt.jar]
Could not create framework: java.lang.Exception: Could not find framework factory.
java.lang.Exception: Could not find framework factory.
 at org.apache.felix.main.Main.getFrameworkFactory(Main.java:346)
 at org.apache.felix.main.Main.main(Main.java:286)

If the source code at http://felix-main.sourcearchive.com/documentation/4.0.1-2/Main_8java_source.html is the appropriate code, then I think the error may have to do with the resource path used in the getFrameworkFactory() function:
    private static FrameworkFactory getFrameworkFactory() throws Exception
    {
        URL url = Main.class.getClassLoader().getResource(
            "META-INF/services/org.osgi.framework.launch.FrameworkFactory");

When I extract and examine felix.jar, there is no "/services/" directory in the "META-INF/" directory in the jar file at all. I *think* that is the root of the problem, but I don't claim to have more than a cursory understanding of the java resource management stuff.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in felix-main (Ubuntu):
status: New → Confirmed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.