HI Я новичок в JBoss, оставайся простым и открытым API. я следую за примерами openapi, когда я получаю доступ к http://localhost:8080/demo/sample/openapi.json, он выдаст ошибку Не удалось выполнить: javax.ws.rs.NotFoundException
Web.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd">
<servlet>
<servlet-name>Resteasy</servlet-name>
<servlet-class>
org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher
</servlet-class>
<init-param>
<param-name>javax.ws.rs.Application</param-name>
<param-value>com.i.main.MyApplication</param-value>
</init-param>
<!-- specify resource classes to scan -->
<init-param>
<param-name>openApi.configuration.resourcePackages</param-name>
<param-value>com.i.resource,io.swagger.v3.jaxrs2.integration.resources</param-value>
</init-param>
<!-- specify scanner implementation,
e.g JaxrsAnnotationScanner scanning resourceClasses defined above (or resourcePackages)
but not considering resources defined by custom application
or JaxrsApplicationAndAnnotationScanner also considering resources defined by custom application
or JaxrsApplicationScanner only considering resources defined by custom application
-->
<init-param>
<param-name>openApi.configuration.scannerClass</param-name>
<param-
value>io.swagger.v3.jaxrs2.integration.JaxrsAnnotationScanner</param-
value>
</init-param>
<init-param>
<param-name>openApi.configuration.prettyPrint</param-name>
<param-value>true</param-value>
</init-param>
</servlet>
<!-- Auto scan REST service -->
<context-param>
<param-name>resteasy.scan</param-name>
<param-value>true</param-value>
</context-param>
<servlet-mapping>
<servlet-name>Resteasy</servlet-name>
<url-pattern>/sample/*</url-pattern>
</servlet-mapping>
<context-param>
<param-name>resteasy.servlet.mapping.prefix</param-name>
<param-value>/sample</param-value>
</context-param>
</web-app>
pom.xml
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.i</groupId>
<artifactId>demoswagger</artifactId>
<version>1.0</version>
<packaging>war</packaging>
<name>demoswagger</name>
<properties>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>javax.ws.rs</groupId>
<artifactId>javax.ws.rs-api</artifactId>
<version>2.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-jaxrs2</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>io.swagger.core.v3</groupId>
<artifactId>swagger-jaxrs2-servlet-
initializer</artifactId>
<version>2.0.0</version>
</dependency>
</dependencies>
</project>
Ошибка
22: 32: 02,043 ОШИБКА [org.jboss.resteasy.resteasy_jaxrs.i18n] (задание по умолчанию-2) RESTEASY002010: Не удалось выполнить: javax.ws.rs.NotFoundException: RESTEASY003210: Не удалось найти ресурс для полного пути: http://localhost:8080/demo/sample/openapi.json
в org.jboss.resteasy.core.registry.ClassNode.match (ClassNode.java:75) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar: 3.0.16.Final-redhat-1]
в org.jboss.resteasy.core.registry.RootClassNode.match (RootClassNode.java:48) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar: 3.0.16.Final-redhat-1]
в org.jboss.resteasy.core.ResourceMethodRegistry.getResourceInvoker (ResourceMethodRegistry.java:445) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar: 3.0.16.Final-redhat-1]
в org.jboss.resteasy.core.SynchronousDispatcher.getInvoker (SynchronousDispatcher.java:257) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar: 3.0.16.Final-redhat-1]
в org.jboss.resteasy.core.SynchronousDispatcher.invoke (SynchronousDispatcher.java:194) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar: 3.0.16.Final-redhat-1]
в org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service (ServletContainerDispatcher.java:221) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar: 3.0.16.Final-redhat-1]
в org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service (HttpServletDispatcher.java:56) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar: 3.0.16.Final-redhat-1]
в org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service (HttpServletDispatcher.java:51) [resteasy-jaxrs-3.0.16.Final-redhat-1.jar: 3.0.16.Final-redhat-1]
в javax.servlet.http.HttpServlet.service (HttpServlet.java:790) [jboss-servlet-api_3.1_spec-1.0.0.Final-redhat-1.jar: 1.0.0.Final-redhat-1]
в io.undertow.servlet.handlers.ServletHandler.handleRequest (ServletHandler.java:85) [undertow-servlet-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest (ServletSecurityRoleHandler.java:62) [undertow-servlet-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest (ServletDispatchingHandler.java:36) [undertow-servlet-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest (SecurityContextAssociationHandler.java:78)
в io.undertow.server.handlers.PredicateHandler.handleRequest (PredicateHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest (SSLInformationAssociationHandler.java:131) [undertow-servlet-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest (ServletAuthenticationCallHandler.java:57) [undertow-servlet-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.server.handlers.PredicateHandler.handleRequest (PredicateHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest (AbstractConfidentialityHandler.java:46) [undertow-core-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest (ServletConfidentialityConstraintHandler.java:64) [undertow-servlet-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest (AuthenticationMechanismsHandler.java:60) [undertow-core-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]в io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest (CachedAuthenticatedSessionHandler.java:77) [undertow-servlet-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.security.handlers.NotificationReceiverHandler.handleRequest (NotificationReceiverHandler.java:50) [undertow-core-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
at io.undertow.security.handlers.AbstractSecurityContextAssociationHandler.handleRequest (AbstractSecurityContextAssociationHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.server.handlers.PredicateHandler.handleRequest (PredicateHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest (JACCContextIdHandler.java:61)
в io.undertow.server.handlers.PredicateHandler.handleRequest (PredicateHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.server.handlers.PredicateHandler.handleRequest (PredicateHandler.java:43) [undertow-core-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest (ServletInitialHandler.java:285) [undertow-servlet-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest (ServletInitialHandler.java:264) [undertow-servlet-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.servlet.handlers.ServletInitialHandler.access $ 000 (ServletInitialHandler.java:81) [undertow-servlet-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.servlet.handlers.ServletInitialHandler $ 1.handleRequest (ServletInitialHandler.java:175) [undertow-servlet-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.server.Connectors.executeRootHandler (Connectors.java:202) [undertow-core-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в io.undertow.server.HttpServerExchange $ 1.run (HttpServerExchange.java:792) [undertow-core-1.3.21.Final-redhat-1.jar: 1.3.21.Final-redhat-1]
в java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1149) [rt.jar: 1.8.0_181]
в java.util.concurrent.ThreadPoolExecutor $ Worker.run (ThreadPoolExecutor.java:624) [rt.jar: 1.8.0_181]
at java.lang.Thread.run (Thread.java:748) [rt.jar: 1.8.0_181]
если у кого-нибудь есть пример, как подключить openapi к Resteasy с помощью jboss