Hi all,
I’m trying to call some plugin’s API from another plugin. It typically works but in this case I see the following exception during deploy:
Unable to create application context for [com.openwaygroup.jira.clientPlugin], **unsatisfied dependencies: none**
java.lang.NoClassDefFoundError: com/openwaygroup/jira/wlsync/data/MarshalledSlogService
at java.lang.Class.getDeclaredConstructors0(Native Method)
...
Caused by: java.lang.ClassNotFoundException: com.openwaygroup.jira.wlsync.data.MarshalledSlogService not found by com.openwaygroup.jira.clientPlugin [378]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)
...
Provider’s pom.xml
<instructions>
<Atlassian-Plugin-Key>${atlassian.plugin.key}<Atlassian-Plugin-Key>
<Export-Package> **com.openwaygroup.jira.wlsync.data** </Export-Package>
<Import-Package>org.springframework.osgi.*;resolution:="optional",
org.eclipse.gemini.blueprint.*;resolution:="optional", *;version="0";resolution:=optional
</Import-Package>
<Spring-Context>*</Spring-Context>
</instructions>
And the following classes
package com.openwaygroup.jira.wlsync.data;
@ExportAsService
@Component
public class MarshalledSlogServiceImpl implements MarshalledSlogService {
package com.openwaygroup.jira.wlsync.data;
@Named
public interface MarshalledSlogService {
Client’s pom.xml
<dependency>
<groupId>com.openwaygroup.jira</groupId>
<artifactId>OW_wls</artifactId>
<version>1.0.8</version>
<scope>provided</scope>
</dependency>
and the code
@Named
public class RestHelper {
@Autowired
public RestHelper(final @ComponentImport MarshalledSlogService marshalledSlogService) {
Because this approach works fine in another cases I definitely missed some nuance but don’t see what.
Thanks in advance for any recommendations,
Mike