swagger-api / swagger-core

Examples and server integrations for generating the Swagger API Specification, which enables easy access to your REST API
http://swagger.io
Apache License 2.0
7.37k stars 2.17k forks source link

An exception occurred during processing of the com.wordnik.swagger.jaxrs.listing.ApiListingResourceJSON class #1109

Closed SuperMarioX closed 9 years ago

SuperMarioX commented 9 years ago

Using swagger + jaxrs and pom.xml is configed successfully.

  1. In myapp.java,
        services.add(com.wordnik.swagger.jaxrs.listing.ApiDeclarationProvider.class);
        services.add(com.wordnik.swagger.jaxrs.listing.ApiListingResourceJSON.class);
        services.add(com.wordnik.swagger.jaxrs.listing.ResourceListingProvider.class);
  1. in web.xml servelet config is configed as below.
 <servlet>
<servlet-name>TitanAppServiceSwaggerConfig</servlet-name>
<servlet-class>com.TitanAppServiceSwaggerConfig</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
  1. in my servlet class, using Beanconfig class config the swagger

While I run my app on liberty, I got this error and could not list the json.

[ERROR   ] An exception occurred during processing of the com.wordnik.swagger.jaxrs.listing.ApiListingResourceJSON class. This class is ignored.

Could anyone help me on this issue? Many thanks, :-)

webron commented 9 years ago

Which version of swagger-core do you use?

SuperMarioX commented 9 years ago

2.10

webron commented 9 years ago

That's the scala version, but it also means you're using the 1.3.X branch.

I assume this is a new integration - you should use the 1.5 branch. The wiki contains a few guides for integration. Even though there isn't one for wink, the integration would be very similar to any of the other guides out there and the steps would be very simple (there's a wink sample in the develop_2.0 branch).

Try that and report back if you have any issues.

SuperMarioX commented 9 years ago

Thanks webron. I have fixed this issue by following closely the guide without servlet. But while integrating with other similar projects, this issue remains if I choose servlet way. I am not sure, but I finally got a way to run it successfully.

webron commented 9 years ago

Well, there are some issues with Liberty but since that's a commercial product, we don't have access to it for testing.

One thing to keep in mind that since the same configuration works with other app server but not with Liberty, it's more likely that the issue is with Liberty itself.

Can we close the issue?

SuperMarioX commented 9 years ago

Yes, Config swagger on liberty is a headache and always cause issues. But I think we will find a walkaround. Pls close it and many thanks.