对 JBPM REST 进行简单调用时出现 NotFoundException API
NotFoundException when doing a simple call to JBPM REST API
我正在尝试对 JBPM REST 进行简单调用 API。通过 Postman 执行 GET 请求按预期工作,例如:
http://localhost:8080/jbpm-console/rest/task/query?potentialOwner=krisv&language=en-UK
returns 返回 3 个任务。
然后我尝试使用 JBPM Remote Java API 做一个简单的 java 客户端,但服务器返回 NotFoundException(客户端抛出 NullPointer 异常)。代码几乎是从 JBPM 文档复制粘贴的:
URL instanceUrl = new URL("http://localhost:8080/jbpm-console/");
String deploymentId = "org.jbpm:Evaluation:1.0";
String processDefId = "evaluation";
String user = "krisv";
String password = "krisv";
// Setup the factory class with the necessarry information to communicate with the REST services
RemoteRuntimeEngineFactory restSessionFactory =
new RemoteRestRuntimeEngineFactory(deploymentId, instanceUrl, user, password);
// Create KieSession instance
RemoteRuntimeEngine engine = restSessionFactory.newRuntimeEngine();
KieSession ksession = engine.getKieSession();
TaskService taskService = engine.getTaskService();
taskService.getTasksAssignedAsPotentialOwner("krisv", "en-UK");
服务器日志:
2015-09-09 09:26:10,516 WARN [org.jboss.resteasy.core.ExceptionHandler] (default task-46) failed to execute: javax.ws.rs.NotFoundException: Could not find resource for full path: http://localhost:8080/jbpm-console/rest/task/execute
这甚至不是应该调用的 REST 端点,似乎它是在内部执行的并且失败了??我完全不知道哪里出了问题。
我正在使用演示评估项目,因此它可以很容易地重现。
一如既往,您在 post 上找到解决方案..
问题是我正在阅读 JBPM 6.1.0 的文档,但我使用的是 JBPM 6.2.0。我在 pom.xml 中包含了 kie-service-client 6.1.0,但我应该拥有的是 kie-remote-client 6.2.0。然后,按照略有不同的 6.2.0 示例:https://docs.jboss.org/jbpm/v6.2/userguide/jBPMRemoteAPI.html 它开始工作。
我正在尝试对 JBPM REST 进行简单调用 API。通过 Postman 执行 GET 请求按预期工作,例如:
http://localhost:8080/jbpm-console/rest/task/query?potentialOwner=krisv&language=en-UK
returns 返回 3 个任务。
然后我尝试使用 JBPM Remote Java API 做一个简单的 java 客户端,但服务器返回 NotFoundException(客户端抛出 NullPointer 异常)。代码几乎是从 JBPM 文档复制粘贴的:
URL instanceUrl = new URL("http://localhost:8080/jbpm-console/");
String deploymentId = "org.jbpm:Evaluation:1.0";
String processDefId = "evaluation";
String user = "krisv";
String password = "krisv";
// Setup the factory class with the necessarry information to communicate with the REST services
RemoteRuntimeEngineFactory restSessionFactory =
new RemoteRestRuntimeEngineFactory(deploymentId, instanceUrl, user, password);
// Create KieSession instance
RemoteRuntimeEngine engine = restSessionFactory.newRuntimeEngine();
KieSession ksession = engine.getKieSession();
TaskService taskService = engine.getTaskService();
taskService.getTasksAssignedAsPotentialOwner("krisv", "en-UK");
服务器日志:
2015-09-09 09:26:10,516 WARN [org.jboss.resteasy.core.ExceptionHandler] (default task-46) failed to execute: javax.ws.rs.NotFoundException: Could not find resource for full path: http://localhost:8080/jbpm-console/rest/task/execute
这甚至不是应该调用的 REST 端点,似乎它是在内部执行的并且失败了??我完全不知道哪里出了问题。
我正在使用演示评估项目,因此它可以很容易地重现。
一如既往,您在 post 上找到解决方案..
问题是我正在阅读 JBPM 6.1.0 的文档,但我使用的是 JBPM 6.2.0。我在 pom.xml 中包含了 kie-service-client 6.1.0,但我应该拥有的是 kie-remote-client 6.2.0。然后,按照略有不同的 6.2.0 示例:https://docs.jboss.org/jbpm/v6.2/userguide/jBPMRemoteAPI.html 它开始工作。