Domanda

I integrated a Jax-Rs Jersey (1.16) Restful service application with swagger. Application uses spring boot to launch. I see below exception when I run the application using java -jar my-service-1.0-SNAPSHOT.jar and access the http://localhost:8080/index.html to list the JaxRs resources.

14:01:53,135 INFO  Scanning for root resource and provider classes in the packages:
  com.company.automation.impl
  com.wordnik.swagger.jersey.listing       [http-nio-8080-exec-1] PackagesResourceConfig
14:01:53,435 ERROR StandardWrapper.Throwable                                                                                                                              [http-nio-8080-exec-1] [/]
com.sun.jersey.core.spi.scanning.ScannerException: IO error when scanning jar jar:file:/home/suman/dev/projects/MyService/my-service/build/libs/my-service-1.0-SNAPSHOT.jar!/lib/swagger-jersey-jaxrs_2.10-1.3.4.jar!/com/wordnik/swagger/jersey/listing
    at com.sun.jersey.core.spi.scanning.uri.JarZipSchemeScanner.scan(JarZipSchemeScanner.java:82)
    at com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:225)
    at com.sun.jersey.core.spi.scanning.PackageNamesScanner.scan(PackageNamesScanner.java:141)
    at com.sun.jersey.api.core.ScanningResourceConfig.init(ScanningResourceConfig.java:80)

I build the fat jar using gradle build including spring-boot-gradle-plugin. I could see that swagger-jersey-jaxrs_2.10-1.3.4.jar was bundled with the fat jar. What am I missing?
I can the run the application fine by other means i.e gradle distZip and extracting the zip content into a directory and run the application run script files created by gradle. But I would really like to run it using java -jar to avoid extracting zip contents step.

[EDIT] Is this a caveat mentioned in http://www.opencredo.com/2014/02/24/experiences-with-spring-boot/ under Caveats section?

È stato utile?

Soluzione

This is a documented Jersey bug, see here.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top