[
https://issues.apache.org/jira/browse/CXF-7092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15581920#comment-15581920
]
Dennis Kieselhorst commented on CXF-7092:
-----------------------------------------
Hi Sergey, thx for the fast response. Just tried with 3.1.8, the issues still
exists.
I'm exactly using the auto-link feature as described in
http://cxf.apache.org/docs/swagger2feature.html#Swagger2Feature-AutomaticUIActivation
and accessing the UI using:
http://localhost:8080/services/api-docs?url=/services/swagger.json
In comparison with the demo you mentioned neither server.servlet-path, nor
cxf.path and service-list-path are set in application.yml, everything relies on
the default values.
Unfortunately I cannot start this demo on master branch, it currently fails
with:
{noformat}
Caused by: org.springframework.beans.BeanInstantiationException: Failed to
instantiate
[org.apache.cxf.jaxrs.swagger.Swagger2Feature$ServletConfigProvider]: No
default constructor found; nested exception is java.lang.NoSuchMethodException:
org.apache.cxf.jaxrs.swagger.Swagger2Feature$ServletConfigProvider.<init>()
at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:85)
at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1098)
... 38 more
Caused by: java.lang.NoSuchMethodException:
org.apache.cxf.jaxrs.swagger.Swagger2Feature$ServletConfigProvider.<init>()
at java.lang.Class.getConstructor0(Class.java:3082)
at java.lang.Class.getDeclaredConstructor(Class.java:2178)
at
org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:80)
... 39 more
{noformat}
> Swagger2Feature tries to resolve swagger-ui resources with api-docs
> -------------------------------------------------------------------
>
> Key: CXF-7092
> URL: https://issues.apache.org/jira/browse/CXF-7092
> Project: CXF
> Issue Type: Bug
> Components: JAX-RS
> Affects Versions: 3.1.7
> Environment: Spring Boot 1.4.1
> Swagger 2.2.2
> Reporter: Dennis Kieselhorst
> Fix For: 3.1.8
>
> Attachments: cxf7092.png
>
>
> Add Swagger2Feature for customization to the class annotated with
> @SpringBootApplication, e.g.:
> {code:java}
> @Bean
> public Swagger2Feature swagger2Feature() {
> Swagger2Feature swagger2Feature = new Swagger2Feature();
> swagger2Feature.setPrettyPrint(true);
> swagger2Feature.setContact("person who knows the API");
> return swagger2Feature;
> }
> {code}
> Open url for swagger UI in browser will fail with:
> {noformat}
> Caused by: java.io.FileNotFoundException: JAR entry
> META-INF/resources/webjars/swagger-ui/2.2.2/api-docs/lib/swagger-oauth.js not
> found in /work/m2repository/org/webjars/swagger-ui/2.2.2/swagger-ui-2.2.2.jar
> at
> sun.net.www.protocol.jar.JarURLConnection.connect(JarURLConnection.java:142)
> at
> sun.net.www.protocol.jar.JarURLConnection.getInputStream(JarURLConnection.java:150)
> at java.net.URL.openStream(URL.java:1045)
> at
> org.apache.cxf.jaxrs.swagger.Swagger2Feature$SwaggerUIService.getResource(Swagger2Feature.java:298)
> ... 102 more
> {noformat}
> Please note that it works correctly when the Swagger2Feature is
> auto-configured without customizations.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)