[ 
https://issues.apache.org/jira/browse/CXF-7092?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15583399#comment-15583399
 ] 

Dennis Kieselhorst commented on CXF-7092:
-----------------------------------------

With your fix the demo now boots up again, but accessing SwaggerUI fails with:
{noformat}
Caused by: java.lang.NoSuchMethodError: 
javax.ws.rs.ClientErrorException.validate(Ljavax/ws/rs/core/Response;Ljavax/ws/rs/core/Response$Status$Family;)Ljavax/ws/rs/core/Response;
        at 
javax.ws.rs.ClientErrorException.<init>(ClientErrorException.java:145) 
~[javax.ws.rs-api-2.1-m01.jar:na]
        at javax.ws.rs.NotFoundException.<init>(NotFoundException.java:104) 
~[javax.ws.rs-api-2.1-m01.jar:na]
        at 
org.apache.cxf.jaxrs.swagger.Swagger2Feature$SwaggerUIService.getResource(Swagger2Feature.java:441)
 ~[cxf-rt-rs-service-description-swagger-3.2.0-SNAPSHOT.jar:3.2.0.SNAPSHOT]
        at sun.reflect.GeneratedMethodAccessor92.invoke(Unknown Source) ~[na:na]
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[na:1.8.0_101]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_101]
        at 
org.apache.cxf.service.invoker.AbstractInvoker.performInvocation(AbstractInvoker.java:180)
 ~[cxf-core-3.2.0-SNAPSHOT.jar:3.2.0.SNAPSHOT]
        at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:96) 
~[cxf-core-3.2.0-SNAPSHOT.jar:3.2.0.SNAPSHOT]
        ... 63 common frames omitted
{noformat}

You can check https://github.com/deki/cxf/tree/CXF-7092 for the changes I made.

> 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)

Reply via email to