I am developing a plugin which contains different post functions. I developed and tested the first postfunction successfully and everything worked fine. I started to develop the second one and got an error that a OSGi resource cannot be resolved to an URL because it does not exist. Here is the full error message:
click to see error log
Unable to create application context for [de.westlotto.jira.plugin.bcm.management], unsatisfied dependencies: none
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [de.westlotto.jira.plugin.bcm.postfunction.CreateEmIssuesPostFunction]; nested exception is java.io.FileNotFoundException: OSGi resource[classpath:com/atlassian/jira/workflow/WorkflowFunctionUtils.class|bnd.id=255|bnd.sym=de.westlotto.jira.plugin.bcm.management] cannot be resolved to URL because it does not exist
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:184)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:316)
at org.springframework.context.annotation.ConfigurationClassPostProcessor.postProcessBeanDefinitionRegistry(ConfigurationClassPostProcessor.java:233)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanDefinitionRegistryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:521)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:419)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.invokeBeanFactoryPostProcessors(AbstractDelegatedExecutionApplicationContext.java:359)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext$3.run(AbstractDelegatedExecutionApplicationContext.java:251)
at org.eclipse.gemini.blueprint.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.startRefresh(AbstractDelegatedExecutionApplicationContext.java:217)
at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.stageOne(DependencyWaiterApplicationContextExecutor.java:224)
at org.eclipse.gemini.blueprint.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor.refresh(DependencyWaiterApplicationContextExecutor.java:177)
at org.eclipse.gemini.blueprint.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:154)
at org.eclipse.gemini.blueprint.extender.internal.activator.LifecycleManager$1.run(LifecycleManager.java:213)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.FileNotFoundException: OSGi resource[classpath:com/atlassian/jira/workflow/WorkflowFunctionUtils.class|bnd.id=255|bnd.sym=de.westlotto.jira.plugin.bcm.management] cannot be resolved to URL because it does not exist
at org.eclipse.gemini.blueprint.io.OsgiBundleResource.getURL(OsgiBundleResource.java:229)
at org.eclipse.gemini.blueprint.io.OsgiBundleResource.getInputStream(OsgiBundleResource.java:181)
at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:51)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:103)
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:123)
at org.springframework.context.annotation.ConfigurationClassParser.asSourceClass(ConfigurationClassParser.java:732)
at org.springframework.context.annotation.ConfigurationClassParser$SourceClass.getSuperClass(ConfigurationClassParser.java:948)
at org.springframework.context.annotation.ConfigurationClassParser.doProcessConfigurationClass(ConfigurationClassParser.java:333)
at org.springframework.context.annotation.ConfigurationClassParser.processConfigurationClass(ConfigurationClassParser.java:245)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:194)
at org.springframework.context.annotation.ConfigurationClassParser.parse(ConfigurationClassParser.java:176)
... 15 more
The error apparently says that the bundle with the key de.westlotto.jira.plugin.bcm.management can not be found and therefore not be resolved to an URL.
I do not know why this happens as I did nothing else then adding a second post function in code and in the atlassian-plugin.xml. I am also confused as this key does not equal my plugin key. The plugin key is de.westlotto.jira.plugin.bcm.bcmmanagement with an additional bcm in it. I do not know where this key comes from.
When I open up the OSGi tab (/plugins/servlet/upm/osgi) my plugin is listed and there the Bundle-SymbolicName is again de.westlotto.jira.plugin.bcm.management.
I also deleted the plugin jar and the directories .bundled-plugins and .osgi-plugins under JIRA_HOME and restarted jira, but I still run into this error.
Can someone help me here?