我想要做一個簡單的調用JBPM REST API。通過郵差進行GET請求按預期工作,例如: http://localhost:8080/jbpm-console/rest/task/query?potentialOwner=krisv&language=en-UK
返回3個任務。NotFoundException當做一個簡單的調用JBPM REST API
然後我試圖做一個簡單的Java客戶端使用JBPM遠程Java API但服務器返回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端點應該叫,好像它在內部執行和失敗?我完全不知道什麼是錯的。
我使用演示評估項目,因此它可以很容易重現。
請分享整個堆棧軌跡 –