Kie 服务器:找不到相关资源

Kie Server: Could not find resource for relative

我正在尝试测试我配置的 kie server

我可以成功调用

http://localhost:8080/kie-server/services/rest/server/

符合预期returns

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response type="SUCCESS" msg="Kie Server info">
  <kie-server-info>
    <version>6.3.0-SNAPSHOT</version>
  </kie-server-info>
</response>

但是当我尝试向另一个人发送请求时 url

http://localhost:8080/kie-server/services/rest/server/jobs

我收到

HTTP Status 404 - RESTEASY001185: Could not find resource for relative : /server/jobs of full path: http://localhost:8080/kie-server/services/rest/server/jobs

在我的 kie-server.war 我有这个 web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         version="2.5"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

  <listener>
    <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class>
  </listener>
  <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>org.kie.server.services.KieServerApplication</param-value>
    </init-param>
  </servlet>
  <servlet-mapping>
    <servlet-name>Resteasy</servlet-name>
    <url-pattern>/services/rest/*</url-pattern>
  </servlet-mapping>
  <context-param>
    <param-name>resteasy.servlet.mapping.prefix</param-name>
    <param-value>/services/rest</param-value>
  </context-param>

  <security-constraint>
    <web-resource-collection>
      <web-resource-name>All web resources</web-resource-name>
      <url-pattern>/*</url-pattern>
    </web-resource-collection>
    <auth-constraint>
      <role-name>kie-server</role-name>
    </auth-constraint>
  </security-constraint>
  <login-config>
    <auth-method>BASIC</auth-method>
    <realm-name>KIE Server</realm-name>
  </login-config>
  <security-role>
    <role-name>kie-server</role-name>
  </security-role>

</web-app>

有什么问题?

我认为您混淆了 KIE 服务器 REST API 和 KIE Workbench REST API。根据文档 [1],KIE 服务器 API 中没有 /jobs REST 端点。

相同的文档显示在 KIE Workbench API 中有一个 /jobs/{jobId} 端点。

希望对您有所帮助,