Solving two dependency chains in FuseESB and Jersey Servlet

I'm trying to deploy sergeant jersey to FuseESB (based on apache serviceMix), but I get the following error:

Error executing command: Unable to resolve module com.temp.myappserver [248.4] because it is exposed to package 'javax.ws.rs' from org.apache.servicemix.specs.jsr311-api-1.1 [139.0] and com.sun.jersey.jersey-core [274.0] via two dependency chains. Chain 1: com.temp.myappserver [248.4] import: (&(package=javax.ws.rs)(version>=1.1.0)(!(version>=2.0.0))) | export: package=javax.ws.rs org.apache.servicemix.specs.jsr311-api-1.1 [139.0] Chain 2: com.temp.myappserver [248.4] import: (package=com.sun.jersey.spi.container.servlet) | export: package=com.sun.jersey.spi.container.servlet; uses:=com.sun.jersey.server.impl.application com.sun.jersey.jersey-servlet [267.0] import: (package=com.sun.jersey.server.impl.application) | export: package=com.sun.jersey.server.impl.application; uses:=javax.ws.rs com.sun.jersey.jersey-server [265.0] import: (package=javax.ws.rs) | export: package=javax.ws.rs com.sun.jersey.jersey-core [274.0] 

I know why I get this error. Indeed, the jersey-core jar manifest exports javax.ws.rs, and serviceMix depends on its own implementation. Is there any way to solve it or do I need to convert my services to CXF?

+4
source share
1 answer

You correctly analyzed the problem: Felix cannot solve this problem, since there are two packages that provide the package, com.sun.jersey.jersey-core does not import it ( it should ), and your own packages want to import a specific version different from the one provided by com.sun.jersey.jersey-core (since this package does not provide a version operator, it defaults to 0.0.0 , so it does not meet your requirement).

So what can you do?

  • The best solution for a jersey-core package would be to provide the right import instead of overlaying your own version on the rest of the framework.
  • Since this may take some time, you can refuse to approve the version in your own import by giving the framework the ability to link you to the jersey-core package instead of servicemix . I know this is not an ideal situation, but it seems to be the best we can do.

For a general note on usage restrictions, see Neil Bartlett's “Use” Report .

+2
source

Source: https://habr.com/ru/post/1396378/


All Articles