Bundle resolution causes CNFE for java.lang.System
--------------------------------------------------

                 Key: FELIX-2618
                 URL: https://issues.apache.org/jira/browse/FELIX-2618
             Project: Felix
          Issue Type: Bug
          Components: Framework
    Affects Versions: framework-3.0.2
         Environment: Fedora 11 Linux x86_64 Java 1.6.0_13-b03 Felix Framework 
3.0.2
            Reporter: John Dunlap
            Priority: Minor


If I attempt to import the package org.apache.felix.shell in my bundle manifest 
I get the following error,

ERROR: Error starting 
file:/home/jddunlap/apache-felix/felix-framework-3.0.2/bundle/dictionary-service-1.0-SNAPSHOT.jar
 (org.osgi.framework.BundleException: Unresolved constraint in bundle [1]: 
Unable to resolve 1.0: missing requirement [1.0] package; 
(package=org.osgi.framework.shell))
org.osgi.framework.BundleException: Unresolved constraint in bundle [1]: Unable 
to resolve 1.0: missing requirement [1.0] package; 
(package=org.osgi.framework.shell)
        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3409)
        at org.apache.felix.framework.Felix.startBundle(Felix.java:1709)
        at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1143)
        at 
org.apache.felix.framework.StartLevelImpl.run(StartLevelImpl.java:264)
        at java.lang.Thread.run(Thread.java:619)
bundle://5.0:1/gosh_profile:15.20: ClassNotFoundException: java.lang.System
java.lang.ClassNotFoundException: java.lang.System
        at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1591)
        at org.apache.felix.framework.BundleImpl.loadClass(BundleImpl.java:887)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.felix.gogo.runtime.Reflective.method(Reflective.java:136)
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:465)
        at 
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:335)
        at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:184)
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:121)
        at org.apache.felix.gogo.runtime.Closure.eval(Closure.java:265)
        at 
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:307)
        at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:184)
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:121)
        at 
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:78)
        at org.apache.felix.gogo.shell.Shell.source(Shell.java:186)
        at org.apache.felix.gogo.shell.Shell.gosh(Shell.java:106)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.apache.felix.gogo.runtime.Reflective.method(Reflective.java:136)
        at 
org.apache.felix.gogo.runtime.CommandProxy.execute(CommandProxy.java:82)
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:421)
        at 
org.apache.felix.gogo.runtime.Closure.executeStatement(Closure.java:335)
        at org.apache.felix.gogo.runtime.Pipe.run(Pipe.java:108)
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:184)
        at org.apache.felix.gogo.runtime.Closure.execute(Closure.java:121)
        at 
org.apache.felix.gogo.runtime.CommandSessionImpl.execute(CommandSessionImpl.java:78)
        at org.apache.felix.gogo.shell.Activator.run(Activator.java:72)
        at java.lang.Thread.run(Thread.java:619)
Caused by: org.osgi.framework.BundleException: Unresolved constraint in bundle 
[1]: Unable to resolve 1.0: missing requirement [1.0] package; 
(package=org.osgi.framework.shell)
        at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3409)
        at org.apache.felix.framework.Felix.loadBundleClass(Felix.java:1584)
        ... 33 more

The problem appears to be in the manifest. If I remove
"org.apache.felix.shell" from the Import-Package manifest entry, the
error goes away. If I put it back the error returns. For example,
changing this,

"Import-Package: org.osgi.framework,org.apache.felix.shell"

to this,

"Import-Package: org.osgi.framework"

makes the error go away. It does not seem to matter if I implement
service interfaces from that package. The import itself appears to
trigger the error.

Issue created as requested by Richard S. Hall

Cheers!
-John

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to