0
votes

I'm trying to use Swagger (1.5.12) Annotations in my web application deployed to WAS Liberty Profile 16.0.0.3. However, when I access the /swagger.json URL, the following exception is thrown:

[err] [Default Executor-thread-13] WARN org.reflections.Reflections - could not create Vfs.Dir from url. ignoring the exception and continuing [err] org.reflections.ReflectionsException: could not create Vfs.Dir from url, no matching UrlType was found [wsjar:file:/opt/ibm/WebSphere/Liberty-ND-16.0.0.3/wlp/usr/servers/defaultServer/workarea/org.eclipse.osgi/61/data/cache/com.ibm.ws.app.manager_87/.cache/!/WEB-INF/classes/] either use fromURL(final URL url, final List urlTypes) or use the static setDefaultURLTypes(final List urlTypes) or addDefaultURLTypes(UrlType urlType) with your specialized UrlType. [err] at org.reflections.vfs.Vfs.fromURL(Vfs.java:109)

Do you know how to overcome this issue? I'd like to use this swagger.json output with the REST API Documentation that comes with WLP under /ibm/api/explorer/ context.

Thanks, any suggestions are really welcome!

2

2 Answers

1
votes

I solved the problem adding the following setting in server.xml:

<classloading useJarUrls="true"/>

I also had to downgrade to Swagger 1.5.3

1
votes

Yes, at the moment WebSphere Liberty supports Swagger annotations 1.5.3. You won't get a compiler error if using 1.5.4, but full support for that version is not there yet.

The version of the annotations package in Open Source moves up quickly, but rest assured that in the next few months WebSphere Liberty will synchronize with the latest versions.