【发布时间】:2016-09-12 22:48:22
【问题描述】:
我在 swagger 中为 Uber API 示例生成了 JAX-RS 服务器代码。是默认的Json,打开http://editor.swagger.io/#/可以找到
现在我尝试在 websphere 中部署它,但我看到以下消息:
Error 404: javax.servlet.ServletException: java.io.FileNotFoundException: SRVE0190E: File not found: /v1/swagger.json
当我访问这个网址时:http://localhost:9080/swagger-jaxrs-server/v1/swagger.json
我没有对自动生成的代码进行任何更改。
我正在使用 wlp-javaee7-8.5.5.9
这就是我的 server.xml 文件的样子:
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>javaee-7.0</feature>
<feature>localConnector-1.0</feature>
<feature>apiDiscovery-1.0</feature>
</featureManager>
<basicRegistry id="basic" realm="BasicRealm">
<!-- <user name="yourUserName" password="" /> -->
</basicRegistry>
<!-- To access this server from a remote client add a host attribute to the following element, e.g. host="*" -->
<httpEndpoint httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>
<!-- Automatically expand WAR files and EAR files -->
<applicationManager autoExpand="true"/>
<applicationMonitor updateTrigger="mbean"/>
<webApplication id="swagger-jaxrs-server" location="swagger-jaxrs-server.war" name="swagger-jaxrs-server"/>
有人能指出这里缺少什么吗?
更新:1
此 URL 工作正常:http://localhost:8080/swagger-jaxrs-server/swagger.json。这是 Json 的一部分:
所以,我尝试了以下两个网址.. 但都没有工作。
http://localhost:8080/swagger-jaxrs-server/estimates/price
http://localhost:8080/swagger-jaxrs-server/v1/estimates/price
我没有看到带有自动生成代码的 web.xml。
【问题讨论】:
标签: java jakarta-ee websphere swagger websphere-liberty