Return-Path: X-Original-To: apmail-felix-dev-archive@www.apache.org Delivered-To: apmail-felix-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1CCEC9C7C for ; Mon, 17 Oct 2011 11:04:33 +0000 (UTC) Received: (qmail 66644 invoked by uid 500); 17 Oct 2011 11:04:32 -0000 Delivered-To: apmail-felix-dev-archive@felix.apache.org Received: (qmail 66606 invoked by uid 500); 17 Oct 2011 11:04:32 -0000 Mailing-List: contact dev-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list dev@felix.apache.org Received: (qmail 66598 invoked by uid 99); 17 Oct 2011 11:04:32 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Oct 2011 11:04:32 +0000 X-ASF-Spam-Status: No, hits=-2000.5 required=5.0 tests=ALL_TRUSTED,RP_MATCHES_RCVD X-Spam-Check-By: apache.org Received: from [140.211.11.116] (HELO hel.zones.apache.org) (140.211.11.116) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Oct 2011 11:04:31 +0000 Received: from hel.zones.apache.org (hel.zones.apache.org [140.211.11.116]) by hel.zones.apache.org (Postfix) with ESMTP id 188E42B1D05 for ; Mon, 17 Oct 2011 11:04:11 +0000 (UTC) Date: Mon, 17 Oct 2011 11:04:11 +0000 (UTC) From: "Karl Pauls (Commented) (JIRA)" To: dev@felix.apache.org Message-ID: <488700597.28.1318849451102.JavaMail.tomcat@hel.zones.apache.org> In-Reply-To: <2052740564.12392.1318555931995.JavaMail.tomcat@hel.zones.apache.org> Subject: [jira] [Commented] (FELIX-3163) Failed in use ConditionalPermissionAdmin MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/FELIX-3163?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13128788#comment-13128788 ] Karl Pauls commented on FELIX-3163: ----------------------------------- Well, you give all permission first -- hence, all bundles have allpermission. Give only your policy bundle allpermission, then deny the filepermission to your plugin, and finally give all permission to all bundles. That should make it work. > Failed in use ConditionalPermissionAdmin > ---------------------------------------- > > Key: FELIX-3163 > URL: https://issues.apache.org/jira/browse/FELIX-3163 > Project: Felix > Issue Type: Bug > Components: Framework Security > Affects Versions: framework-4.0.0, framework.security-2.0.0 > Reporter: Yanni Yan > Original Estimate: 5h > Remaining Estimate: 5h > > I test ConditionalPermissionAdmin as follow: > private void setLocalCPA() throws Exception { > ServiceReference srf = context.getServiceReference(ConditionalPermissionAdmin.class.getName()); > if (null == srf){ > throw new BundleException("Not found service: " + ConditionalPermissionAdmin.class.getName()); > } > > ConditionalPermissionAdmin cpa = (ConditionalPermissionAdmin)context.getService(srf); > if (null == cpa){ > throw new BundleException("Failed to get service :" + ConditionalPermissionAdmin.class.getName()); > } > > ConditionalPermissionUpdate cpu = cpa.newConditionalPermissionUpdate(); > // clear all exist permissions > cpu.getConditionalPermissionInfos().clear(); > > // assign all permission to all bundles > ConditionalPermissionInfo cpi = cpa.newConditionalPermissionInfo(null, new ConditionInfo[]{ > new ConditionInfo(BundleLocationCondition.class.getName(),new String[] {context.getBundle(0).getLocation()}) > }, new PermissionInfo[]{ > new PermissionInfo(AllPermission.class.getName(), "*", "*") > }, ConditionalPermissionInfo.ALLOW); > cpu.getConditionalPermissionInfos().add(cpi); > // deny FilePermission to current bundle > > cpu.commit(); > } > After my bundle start, felix hunged. I restart felix, felix print as follow: > D:\Workspace\Felix>java -Djava.security.policy=all.policy -Dorg.osgi.fr > amework.security=osgi -jar bin/felix.jar > ERROR: Bundle org.apache.felix.bundlerepository [1] Error starting file:/D:/Work > space/UniAgent/Felix/bundle/org.apache.felix.bundlerepository-1.6.6.jar (org.osg > i.framework.BundleException: Unresolved constraint in bundle org.apache.felix.bu > ndlerepository [1]: Unable to resolve 1.0: missing requirement [1.0] osgi.wiring > .package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.4.0)(!(version>= > 2.0.0)))) > org.osgi.framework.BundleException: Unresolved constraint in bundle org.apache.f > elix.bundlerepository [1]: Unable to resolve 1.0: missing requirement [1.0] osgi > .wiring.package; (&(osgi.wiring.package=org.osgi.framework)(version>=1.4.0)(!(ve > rsion>=2.0.0))) > at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:381 > 8) > at org.apache.felix.framework.Felix.startBundle(Felix.java:1868) > at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191) > at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStart > LevelImpl.java:295) > at java.lang.Thread.run(Unknown Source) > ERROR: Bundle org.apache.felix.gogo.command [3] Error starting file:/D:/Workspac > e/UniAgent/Felix/bundle/org.apache.felix.gogo.command-0.12.0.jar (org.osgi.frame > work.BundleException: Unresolved constraint in bundle org.apache.felix.gogo.comm > and [3]: Unable to resolve 3.0: missing requirement [3.0] osgi.wiring.package; ( > &(osgi.wiring.package=org.apache.felix.service.command)(status=provisional)(vers > ion>=0.10.0)(!(version>=1.0.0)))) > org.osgi.framework.BundleException: Unresolved constraint in bundle org.apache.f > elix.gogo.command [3]: Unable to resolve 3.0: missing requirement [3.0] osgi.wir > ing.package; (&(osgi.wiring.package=org.apache.felix.service.command)(status=pro > visional)(version>=0.10.0)(!(version>=1.0.0))) > at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:381 > 8) > at org.apache.felix.framework.Felix.startBundle(Felix.java:1868) > at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191) > at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStart > LevelImpl.java:295) > at java.lang.Thread.run(Unknown Source) > ERROR: Bundle org.apache.felix.gogo.runtime [4] Error starting file:/D:/Workspac > e/UniAgent/Felix/bundle/org.apache.felix.gogo.runtime-0.10.0.jar (org.osgi.frame > work.BundleException: Unresolved constraint in bundle org.apache.felix.gogo.runt > ime [4]: Unable to resolve 4.0: missing requirement [4.0] osgi.wiring.package; ( > osgi.wiring.package=org.osgi.framework)) > org.osgi.framework.BundleException: Unresolved constraint in bundle org.apache.f > elix.gogo.runtime [4]: Unable to resolve 4.0: missing requirement [4.0] osgi.wir > ing.package; (osgi.wiring.package=org.osgi.framework) > at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:381 > 8) > at org.apache.felix.framework.Felix.startBundle(Felix.java:1868) > at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191) > at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStart > LevelImpl.java:295) > at java.lang.Thread.run(Unknown Source) > ERROR: Bundle org.apache.felix.gogo.shell [5] Error starting file:/D:/Workspace/ > UniAgent/Felix/bundle/org.apache.felix.gogo.shell-0.10.0.jar (org.osgi.framework > .BundleException: Unresolved constraint in bundle org.apache.felix.gogo.shell [5 > ]: Unable to resolve 5.0: missing requirement [5.0] osgi.wiring.package; (&(osgi > .wiring.package=org.apache.felix.service.command)(status=provisional)(version>=0 > .10.0))) > org.osgi.framework.BundleException: Unresolved constraint in bundle org.apache.f > elix.gogo.shell [5]: Unable to resolve 5.0: missing requirement [5.0] osgi.wirin > g.package; (&(osgi.wiring.package=org.apache.felix.service.command)(status=provi > sional)(version>=0.10.0)) > at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:381 > 8) > at org.apache.felix.framework.Felix.startBundle(Felix.java:1868) > at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191) > at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStart > LevelImpl.java:295) > at java.lang.Thread.run(Unknown Source) > ERROR: Bundle First [7] Error starting file:plugins/First_1.0.0.0.jar (org.osgi. > framework.BundleException: Unresolved constraint in bundle First [7]: Unable to > resolve 7.0: missing requirement [7.0] osgi.wiring.package; (&(osgi.wiring.packa > ge=org.osgi.framework)(version>=1.3.0))) > org.osgi.framework.BundleException: Unresolved constraint in bundle First [7]: U > nable to resolve 7.0: missing requirement [7.0] osgi.wiring.package; (&(osgi.wir > ing.package=org.osgi.framework)(version>=1.3.0)) > at org.apache.felix.framework.Felix.resolveBundleRevision(Felix.java:381 > 8) > at org.apache.felix.framework.Felix.startBundle(Felix.java:1868) > at org.apache.felix.framework.Felix.setActiveStartLevel(Felix.java:1191) > at org.apache.felix.framework.FrameworkStartLevelImpl.run(FrameworkStart > LevelImpl.java:295) > at java.lang.Thread.run(Unknown Source) > I didn't know what happend. Please help me. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira