Jira 7.5.0 plugin with apache cxf dependency

Hello,

 

I need to add a cxf dependency in a jira plugin, version 7.5.0, to consume custom soap web service.

<dependency>
<groupId>org.apache.cxf</groupId>
<artifactId>cxf-rt-frontend-jaxws</artifactId>
<version>3.2.1</version>
</dependency>

For each upload of my plugin, there are OSGI Bundle Exceptions like : 

org.osgi.framework.BundleException: Unresolved constraint in bundle [401]: Unable to resolve 401.0: missing requirement [401.0] osgi.wiring.package; (osgi.wiring.package=com.sun.msv.grammar)

There are dozens of dependencies...

How can I fix this?

 

Best regards,

Christophe

 

 

1 answer

0 votes

Hello, 

In your pom.xml what is in the <Import-Package> tag? Put there optional and OSGI will not consider these packages as required. But if you later need them then you will have a NPE or ClassNotFound or something like this.

Hi Alexey,

 

Thanks for you answer.

I already added this :

org.springframework.osgi.*;resolution:="optional",
org.eclipse.gemini.blueprint.*;resolution:="optional",
org.apache.aries.*;resolution:="optional",
org.apache.avalon.*;resolution:="optional",
org.apache.axiom.*;resolution:="optional",
org.apache.axis.*;resolution:="optional",
org.apache.commons.*;resolution:="optional",
org.apache.log.*;resolution:="optional",
org.apache.taglibs.*;resolution:="optional",
org.apache.geronimo.*;resolution:="optional",
org.apache.log4j.*;resolution:="optional",
org.codehaus.*;resolution:="optional",
org.osgi.*;resolution:="optional",
org.relaxng.*;resolution:="optional",
com.ctc.*;resolution:="optional",
com.sun.*;resolution:="optional",
net.sf.cglib.*;resolution:="optional",
javax.*;resolution:="optional",
*

Then I removed, because it's effectively correct the previous error, but the next one appears :

unsatisfied dependencies: none 

org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://cxf.apache.org/jaxws]
Offending resource: URL [bundle://450.0:0/META-INF/spring/plugin-context.xml]

It looks like missing something from apache CXF (and I make many of the cxf dependencies optional)... Even if I add the cxf-core dependency (which is normaly provided by cxf-rt-frontend-jaxws), the jaxws schema is missing.

 

What am I missing?

I never used Apache cxf. But I guess it is looking for some kind of Spring configuration. This configuration must be in an xml format. Now all that is needed to define what must be in the xml file and put it in your plugin so that apache.cxf could read it.

My apologies, I skiped some explainations.

 

In the atlassian-plugin.xml spring beans file, I import the cxf.xml file, to create a bean.

<import resource="classpath:META-INF/cxf/cxf.xml" />

This import is in error.

If I remove this, there is no error. But I need this for my jaxws client.

<jaxws:client ... />

To be able to dig into more details, I need your pom.xml, atlassian-plugin.xml and cxf.xml

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,095 views 4 9
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you