It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Trying to access to chain premissons from task

Hi,

I'm trying to copy permission from one plan to another, but a get violations.
The code I'm trying to run:

PlanCreationBean planCreationBean = new PlanCreationBean();
Project parent = projectManager.getProjectByKey(targetProject);
Plan newPlan = chainCreationService.getNewInstance();

newPlan.setBuildName("Branch-"+newKey);
newPlan.setName(parent.getName()+"-Branch-"+newKey);

newPlan.setBuildKey(newKey);
newPlan.setKey(targetProject+"-"+newKey);
newPlan.setDescription("Branch plan for "+newKey);
newPlan.setPlanKey(PlanKeys.getPlanKey(targetProject+"-"+newKey));
newPlan.setProject(parent);

Chain newChain = (Chain) newPlan;
newChain.addNewStage("Test Stage", "Run all tests", false);

User user = userManager.getUser(PLAN_CREATOR);
logger.addBuildLogEntry("user: "+user.getEmail());
BambooAclUpdateHelper aclHelp = new BambooAclUpdateHelper();
planCreationBean.setPlanBeingCreated(newPlan);
planCreationBean.setConfigurationBeingEdited(chainCreationService.getBuildConfigurationWithDefaults());
//planCreationBean.setAclBeingCreated(acl);
try{
		chainCreationService.savePlan(planCreationBean);
} catch(Exception e1){
	throw new RuntimeException(e1);
}

But I get this error:

[INFO] [talledLocalContainer] 2012-07-12 15:06:18,161 INFO [Spring executor 4] [AlternativeDirectoryResourceLoader] Found alternative resource directory C:\Ver14.00\etc\bamboo\octopus\src-dev\octopus-bamboo-plugin\src\main\resources
[INFO] [talledLocalContainer] 2012-07-12 15:06:18,202 ERROR [main] [OsgiPlugin] Detected an error (BundleException) enabling the plugin 'com.company.bamboo.plugins.octopus' : Constraint violation for package 'org.springframework.dao' when resolving module 45.0 between existing import 0.org.springfr
amework.dao BLAMED ON [[45.0] package; (&(package=org.springframework.dao)(version>=0.0.0)(version<=0.0.0))] and uses constraint 4.0.org.springframework.dao BLAMED ON [[45.0] package; (package=org.springframework.orm.jpa)].  This error usually occurs when your plugin imports a package from another b
undle with a specific version constraint and either the bundle providing that package doesn't meet those version constraints, or there is no bundle available that provides the specified package. For more details on how to fix this, see http://confluence.atlassian.com/x/1xy6D
[INFO] [talledLocalContainer] 2012-07-12 15:06:18,202 WARN [main] [OsgiPlugin] Unable to enable plugin 'com.company.bamboo.plugins.octopus'
[INFO] [talledLocalContainer] com.atlassian.plugin.osgi.container.OsgiContainerException: Cannot start plugin: com.company.bamboo.plugins.octopus
[INFO] [talledLocalContainer]   at com.atlassian.plugin.osgi.factory.OsgiPlugin.enableInternal(OsgiPlugin.java:445)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.impl.AbstractPlugin.enable(AbstractPlugin.java:237)
....
[INFO] [talledLocalContainer]   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
[INFO] [talledLocalContainer]   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
[INFO] [talledLocalContainer] Caused by: org.osgi.framework.BundleException: Constraint violation for package 'org.springframework.dao' when resolving module 45.0 between existing import 0.org.springframework.dao BLAMED ON [[45.0] package; (&(package=org.springframework.dao)(version>=0.0.0)(version<
=0.0.0))] and uses constraint 4.0.org.springframework.dao BLAMED ON [[45.0] package; (package=org.springframework.orm.jpa)]
[INFO] [talledLocalContainer]   at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3415)
[INFO] [talledLocalContainer]   at org.apache.felix.framework.Felix.startBundle(Felix.java:1709)
[INFO] [talledLocalContainer]   at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:905)
[INFO] [talledLocalContainer]   at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:892)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.osgi.factory.OsgiPlugin.enableInternal(OsgiPlugin.java:417)
[INFO] [talledLocalContainer]   ... 25 more
[INFO] [talledLocalContainer] 2012-07-12 15:06:18,203 ERROR [main] [PluginEnabler] Unable to enable plugin com.company.bamboo.plugins.octopus
[INFO] [talledLocalContainer] com.atlassian.plugin.osgi.container.OsgiContainerException: Cannot start plugin: com.company.bamboo.plugins.octopus
[INFO] [talledLocalContainer]   at com.atlassian.plugin.osgi.factory.OsgiPlugin.enableInternal(OsgiPlugin.java:445)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.impl.AbstractPlugin.enable(AbstractPlugin.java:237)
...
[INFO] [talledLocalContainer]   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
[INFO] [talledLocalContainer] Caused by: org.osgi.framework.BundleException: Constraint violation for package 'org.springframework.dao' when resolving module 45.0 between existing import 0.org.springframework.dao BLAMED ON [[45.0] package; (&(package=org.springframework.dao)(version>=0.0.0)(version<
=0.0.0))] and uses constraint 4.0.org.springframework.dao BLAMED ON [[45.0] package; (package=org.springframework.orm.jpa)]
[INFO] [talledLocalContainer]   at org.apache.felix.framework.Felix.resolveBundle(Felix.java:3415)
[INFO] [talledLocalContainer]   at org.apache.felix.framework.Felix.startBundle(Felix.java:1709)
[INFO] [talledLocalContainer]   at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:905)
[INFO] [talledLocalContainer]   at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:892)
[INFO] [talledLocalContainer]   at com.atlassian.plugin.osgi.factory.OsgiPlugin.enableInternal(OsgiPlugin.java:417)
[INFO] [talledLocalContainer]   ... 25 more

How do I solve it?


1 answer

0 votes
Joe Clark Atlassian Team Jul 15, 2012

Hi Filip,


Are you specifying any OSGI bundle instructions in your pom.xml or atlassian-plugin.xml? If so, could you please provide a copy of these instructions.


Joe.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Off-topic

Friday Fun: Virtual dance party!

Do dance parties help you relieve stress? How about *virtual dance parties*? My team holds virtual dance parties to brighten the mood of a tough day or celebrate an upcoming weekend.  Want t...

70 views 7 4
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you