Tomee JEE6 with Swagger

246 views
Skip to first unread message

Patrick Sansoucy

unread,
May 13, 2015, 12:30:14 AM5/13/15
to swagger-sw...@googlegroups.com
Hello,

I have spent the last couple of days trying to add swagger to a project which is based off the following Tomee Rest example: https://tomee.apache.org/examples-trunk/rest-example/README.html without much success :(
I basically used the swagger-java-jersey-sample-app off the swagger-core git and am getting a load of WARNING when accessing the page (which load the resources) and end up with a mostly empty page consisting of the Explorer link (non functionning) and my 2 input fields.

My log displays the following errors:

May 13, 2015 12:10:53 AM org.apache.cxf.jaxrs.utils.JAXRSUtils findTargetMethod
WARNING: No operation matching request path "/backend-service/css/screen.css" is found, Relative Path: /css/screen.css, HTTP Method: GET, ContentType: */*, Accept: text/css,*/*;q=0.1,. Please enable FINE/TRACE log level for more details.

The ressources are at the proper location within the WAR file 

Any pointers/guides/help would be appreciated 

Thanks
Pat

Ron Ratovsky

unread,
May 13, 2015, 2:50:51 AM5/13/15
to swagger-sw...@googlegroups.com
You're running too fast. Do you have access to the swagger.json?

--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
-----------------------------------------
http://swagger.io
https://twitter.com/SwaggerApi
-----------------------------------------

Patrick Sansoucy

unread,
May 13, 2015, 8:14:02 PM5/13/15
to swagger-sw...@googlegroups.com
Re,

I don't see anything json related in my war ... But I do see this during the execution:
May 13, 2015 12:10:48 AM org.apache.openejb.server.cxf.rs.CxfRsHttpListener logEndpoints
INFO: REST Application: http://localhost:8080/backend-service/                                 -> org.apache.openejb.server.rest.InternalApplication
May 13, 2015 12:10:48 AM org.apache.openejb.server.cxf.rs.CxfRsHttpListener logEndpoints
INFO:      Service URI: http://localhost:8080/backend-service/                                 -> Pojo com.wordnik.swagger.jaxrs.listing.ApiListingResource
May 13, 2015 12:10:48 AM org.apache.openejb.server.cxf.rs.CxfRsHttpListener logEndpoints
INFO:               GET http://localhost:8080/backend-service/swagger.json                     ->      Response getListingJson(Application, ServletConfig, HttpHeaders, UriInfo)
May 13, 2015 12:10:48 AM org.apache.openejb.server.cxf.rs.CxfRsHttpListener logEndpoints
INFO:               GET http://localhost:8080/backend-service/swagger.yaml                     ->      Response getListingYaml(Application, ServletConfig, HttpHeaders, UriInfo)
May 13, 2015 12:10:48 AM org.apache.openejb.server.cxf.rs.CxfRsHttpListener logEndpoints
INFO:      Service URI: http://localhost:8080/backend-service/api/customer                     -> Pojo foo.bar.service.rest.CustomerResource             
May 13, 2015 12:10:48 AM org.apache.openejb.server.cxf.rs.CxfRsHttpListener logEndpoints
INFO:            DELETE http://localhost:8080/backend-service/api/customer/delete/{customerId} ->      void delete(Long)              
May 13, 2015 12:10:48 AM org.apache.openejb.server.cxf.rs.CxfRsHttpListener logEndpoints
INFO:               GET http://localhost:8080/backend-service/api/customer/ping                ->      String ping()                  
May 13, 2015 12:10:48 AM org.apache.openejb.server.cxf.rs.CxfRsHttpListener logEndpoints
INFO:               GET http://localhost:8080/backend-service/api/customer/show/{customerId}   ->      Customer show(Long)            
May 13, 2015 12:10:48 AM org.apache.openejb.server.cxf.rs.CxfRsHttpListener logEndpoints
INFO:              POST http://localhost:8080/backend-service/api/customer/echo                ->      String ping(String)            
May 13, 2015 12:10:48 AM org.apache.openejb.server.cxf.rs.CxfRsHttpListener logEndpoints
INFO:              POST http://localhost:8080/backend-service/api/customer/update/{customerId} ->      Customer update(Long, Customer)
May 13, 2015 12:10:48 AM org.apache.openejb.server.cxf.rs.CxfRsHttpListener logEndpoints
INFO:               PUT http://localhost:8080/backend-service/api/customer/create              ->      Customer create(Customer)      

Thanks !

Ron Ratovsky

unread,
May 14, 2015, 4:55:05 AM5/14/15
to swagger-sw...@googlegroups.com
The swagger.json is generated at runtime, it's not part of your war. http://localhost:8080/backend-service/swagger.json. Make sure you can open the link when the application is running.

As for the UI, how exactly did you integrate it with your war?


--
You received this message because you are subscribed to the Google Groups "Swagger" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swagger-swaggers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Patrick Sansoucy

unread,
May 14, 2015, 9:54:59 PM5/14/15
to swagger-sw...@googlegroups.com
Yup,

Got something ... It is basically looks like the stuff from the bootstrap class + the stuff from my resource endpoint (see the pastebin dump):

Thanks for the help !
Reply all
Reply to author
Forward
0 new messages