0

I added below swagger dependencies on my web application which based on spring-boot + jersey.

    compile('io.springfox:springfox-swagger2:'+springfoxSwaggerVersion)
compile('io.springfox:springfox-petstore:'+springfoxSwaggerVersion)
compile('io.springfox:springfox-swagger-ui:'+springfoxSwaggerVersion)
compile('io.swagger:swagger-jersey2-jaxrs:1.5.8')
compile('io.swagger:swagger-annotations:1.5.8')
compile('org.apache.httpcomponents:httpclient:4.5.1')

I am able to see below output when launched the application. But I am not able to access the link http://localhost:8080/swagger-ui.html. I know that if I am using spring-mvc, it works fine but not work with jersey. Does jersey do something to break it? How can I fix it? What else did I miss here?

2016-03-31 09:39:09.102  INFO 83543 --- [           main] o.s.w.s.handler.SimpleUrlHandlerMapping  : Mapped URL path [/swagger-ui.html] onto handler of type [class org.springframework.web.servlet.resource.ResourceHttpRequestHandler]
Joey Yi Zhao
  • 37,514
  • 71
  • 268
  • 523
  • Did you read the link I posted as a comment in your previous post? – Paul Samsotha Mar 31 '16 at 02:08
  • sorry I didn't get you, do you mean this link:http://stackoverflow.com/questions/36306510/how-to-find-the-togglz-url-when-integrating-with-spring-boot-and-jersey? – Joey Yi Zhao Mar 31 '16 at 02:34
  • Yes. If you are having the a problem with serving static content, the link I provided may help you out – Paul Samsotha Mar 31 '16 at 03:42
  • I added an @ApplicationPath on my jersey configuration and it works. But I don't want to change the root path of my application. So I prefer the other way, I added spring.jersey.type=filter on my application.properties but it doesn't work. What else should I do here? – Joey Yi Zhao Mar 31 '16 at 04:04
  • You need to set t a Jersey property. In that link, I linked to another post that shows what property you need to set – Paul Samsotha Mar 31 '16 at 04:07
  • Ok thanks. It helps me could you please post it as an answer here then I can accept it? – Joey Yi Zhao Apr 01 '16 at 02:16
  • Can you just close it as a duplicate. I don't really feel like repeating answers that are already out there. – Paul Samsotha Apr 01 '16 at 09:40

0 Answers0