Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-5324

Can not install/start the framework.security bundle

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • framework.security-2.4.0
    • None
    • None

    Description

      First i run the following command to start the felix framework.
      $ /usr/local/jamvm/bin/jamvm -Dorg.osgi.framework.security="osgi" -Dpolicy.provider=gnu.java.security.PolicyFile -Djava.security.policy=file:///home/benhsu/felix-framework-5.4.0/conf/java.policy -jar bin/felix.jar

      The file content of java.policy is as follows.
      grant {
      permission java.security.AllPermission;
      };

      grant codeBase "http://felix.extensions:9/" {
      permission java.security.AllPermission;
      };

      There are two ways to start framework.security bundle, but all are fail and i got the different errors.

      1. Put the framework.security bundle into bundle directory and it will be started when framework starts.
      I got the following debug message and gogo shell hanged on not to work.

      DEBUG: WIRE: [org.apache.felix.gogo.command [3](R 3.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.felix.service.command)(status=provisional)(version>=0.10.0)(!(version>=1.0.0))) -> [org.apache.felix.gogo.runtime [4](R 4.0)]
      DEBUG: WIRE: [org.apache.felix.gogo.command [3](R 3.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.5.0)(!(version>=2.0.0))) -> [org.apache.felix.framework [0](R 0)]
      DEBUG: WIRE: [org.apache.felix.gogo.command [3](R 3.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework.wiring)(version>=1.0.0)(!(version>=2.0.0))) -> [org.apache.felix.framework [0](R 0)]
      DEBUG: WIRE: [org.apache.felix.gogo.command [3](R 3.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.service.packageadmin)(version>=1.2.0)(!(version>=2.0.0))) -> [org.apache.felix.framework [0](R 0)]
      DEBUG: WIRE: [org.apache.felix.gogo.command [3](R 3.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.service.startlevel)(version>=1.1.0)(!(version>=2.0.0))) -> [org.apache.felix.framework [0](R 0)]
      DEBUG: WIRE: [org.apache.felix.gogo.command [3](R 3.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.util.tracker)(version>=1.3.0)(!(version>=2.0.0))) -> [org.apache.felix.framework [0](R 0)]
      DEBUG: WIRE: [org.apache.felix.bundlerepository [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.service.log)(version>=1.3.0)(!(version>=2.0.0))) -> [org.apache.felix.gogo.command [3](R 3.0)]
      DEBUG: WIRE: [org.apache.felix.bundlerepository [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.7.0)(!(version>=2.0.0))) -> [org.apache.felix.framework [0](R 0)]
      DEBUG: WIRE: [org.apache.felix.bundlerepository [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.framework.wiring)(version>=1.1.0)(!(version>=2.0.0))) -> [org.apache.felix.framework [0](R 0)]
      DEBUG: WIRE: [org.apache.felix.bundlerepository [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.resource)(version>=1.0.0)(!(version>=2.0.0))) -> [org.apache.felix.framework [0](R 0)]
      DEBUG: WIRE: [org.apache.felix.bundlerepository [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.service.url)(version>=1.0.0)(!(version>=2.0.0))) -> [org.apache.felix.framework [0](R 0)]
      DEBUG: WIRE: [org.apache.felix.bundlerepository [1](R 1.0)] osgi.wiring.package; (&(osgi.wiring.package=org.osgi.util.tracker)(version>=1.5.0)(!(version>=2.0.0))) -> [org.apache.felix.framework [0](R 0)]
      DEBUG: WIRE: [org.apache.felix.gogo.runtime [4](R 4.0)] osgi.wiring.package; (osgi.wiring.package=org.osgi.framework) -> [org.apache.felix.framework [0](R 0)]
      DEBUG: WIRE: [org.apache.felix.gogo.runtime [4](R 4.0)] osgi.wiring.package; (osgi.wiring.package=org.osgi.util.tracker) -> [org.apache.felix.framework [0](R 0)]
      DEBUG: DYNAMIC WIRE: [org.apache.felix.gogo.command [3](R 3.0)] osgi.wiring.package; (osgi.wiring.package=org.apache.felix.bundlerepository) -> [org.apache.felix.bundlerepository [1](R 1.0)]
      DEBUG: WIRE: [org.apache.felix.gogo.shell [5](R 5.0)] osgi.wiring.package; (&(osgi.wiring.package=org.apache.felix.service.command)(status=provisional)(version>=0.10.0)) -> [org.apache.felix.gogo.runtime [4](R 4.0)]
      DEBUG: WIRE: [org.apache.felix.gogo.shell [5](R 5.0)] osgi.wiring.package; (osgi.wiring.package=org.osgi.framework) -> [org.apache.felix.framework [0](R 0)]
      DEBUG: WIRE: [org.apache.felix.gogo.shell [5](R 5.0)] osgi.wiring.package; (osgi.wiring.package=org.osgi.service.startlevel) -> [org.apache.felix.framework [0](R 0)]
      DEBUG: WIRE: [org.apache.felix.gogo.shell [5](R 5.0)] osgi.wiring.package; (osgi.wiring.package=org.osgi.util.tracker) -> [org.apache.felix.framework [0](R 0)]
      ERROR: Bundle org.apache.felix.gogo.runtime [4] EventDispatcher: Error during dispatch. (java.lang.NoClassDefFoundError: org/apache/felix/framework/security/condpermadmin/DomainGripper)
      java.lang.NoClassDefFoundError: org/apache/felix/framework/security/condpermadmin/DomainGripper
      at org.apache.felix.framework.security.condpermadmin.ConditionalPermissionAdminImpl.handlePAHandle(ConditionalPermissionAdminImpl.java:1084)
      at org.apache.felix.framework.SecurityProviderImpl.hasBundlePermission(SecurityProviderImpl.java:114)
      at org.apache.felix.framework.Felix.impliesBundlePermission(Felix.java:4438)
      at org.apache.felix.framework.BundleProtectionDomain.implies(BundleProtectionDomain.java:404)
      at java.security.AccessControlContext.checkPermission(AccessControlContext.java:156)
      at java.security.AccessController.checkPermission(AccessController.java:76)
      at java.lang.SecurityManager.checkPermission(SecurityManager.java:368)
      at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:467)
      at org.osgi.util.tracker.ServiceTracker.addingService(ServiceTracker.java:414)
      at org.apache.felix.gogo.runtime.activator.Activator$1.addingService(Activator.java:94)
      at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
      at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)
      at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
      at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)
      at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)
      at org.apache.felix.framework.util.EventDispatcher$4.run(EventDispatcher.java:984)
      at java.security.AccessController.doPrivileged(AccessController.java:96)
      at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:979)
      at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:839)
      at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:546)
      at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557)
      at org.apache.felix.framework.Felix.registerService(Felix.java:3549)
      at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348)
      at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:322)
      at org.apache.felix.gogo.shell.Activator.startShell(Activator.java:100)
      at org.apache.felix.gogo.shell.Activator.access$000(Activator.java:35)
      at org.apache.felix.gogo.shell.Activator$1.addingService(Activator.java:135)
      at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)
      at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)
      at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)
      at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)
      at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:318)
      at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)
      at org.apache.felix.gogo.shell.Activator.processorTracker(Activator.java:150)
      at org.apache.felix.gogo.shell.Activator.start(Activator.java:47)
      at org.apache.felix.framework.util.SecureAction$Actions.run(SecureAction.java:1709)
      at java.security.AccessController.doPrivileged(AccessController.java:195)
      at org.apache.felix.framework.util.SecureAction.startActivator(SecureAction.java:688)
      at org.apache.felix.framework.Felix.activateBundle(Felix.java:2226)
      at org.apache.felix.framework.Felix.startBundle(Felix.java:2144)
      at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1371)
      at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStartLevelImpl.java:308)
      at java.lang.Thread.run(Thread.java:745)
      ...

      I checked and found org/apache/felix/framework/security/condpermadmin/DomainGripper inside of org.apache.felix.framework.security-2.4.0.jar, why it shows not to find?

      2. After the framework started, i ran the install/start command in gogo shell and i got the following error.
      On the other hand, any command did not work anymore and showed another error.
      ____________________________
      Welcome to Apache Felix Gogo

      g! start file:///home/benhsu/felix-framework-5.4.0/org.apache.felix.framework.security-2.4.0.jar
      gogo: InvocationTargetException: null
      g! lb
      gogo: NoClassDefFoundError: org/apache/felix/framework/security/util/Permissions$Entry

      After i restarted the framework, i found the framework.security bundle being resolved but not started the both of PermissionAdmin and ConditionalPermissionAdmin services by the following command.
      $ inspec cap service 0
      ____________________________
      Welcome to Apache Felix Gogo

      g! lb
      START LEVEL 1
      ID|State |Level|Name
      0|Active | 0|System Bundle (5.4.0)|5.4.0
      1|Active | 1|Apache Felix Bundle Repository (2.0.6)|2.0.6
      2|Active | 1|Apache Felix Gogo Command (0.16.0)|0.16.0
      3|Active | 1|Apache Felix Gogo Runtime (0.16.2)|0.16.2
      4|Active | 1|Apache Felix Gogo Shell (0.10.0)|0.10.0
      5|Resolved | 1|Apache Felix Security Provider (2.4.0)|2.4.0
      g! inspect cap service 0\
      gogo: EOFException: unexpected EOT in \ escape
      g! inspect cap service 0
      org.apache.felix.framework [0] provides:
      ----------------------------------------
      service; org.osgi.service.resolver.Resolver with properties:
      service.bundleid = 0
      service.id = 1
      service.scope = singleton
      service; org.osgi.service.packageadmin.PackageAdmin with properties:
      service.bundleid = 0
      service.id = 2
      service.scope = singleton
      service; org.osgi.service.startlevel.StartLevel with properties:
      service.bundleid = 0
      service.id = 3
      service.scope = singleton
      Used by:
      org.apache.felix.framework [0]

      Any idea on these problem please let me know.
      Thanks in advance.

      Attachments

        Activity

          People

            Unassigned Unassigned
            benhsu2327 benhsu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: