2015-09-09 20 views
1

我想要做一個簡單的調用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端點應該叫,好像它在內部執行和失敗?我完全不知道什麼是錯的。

我使用演示評估項目,因此它可以很容易重現。

+0

請分享整個堆棧軌跡 –

回答

1

與往常一樣,你只要您發佈在SO找到一個解決辦法..

的問題是,我在讀文檔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它開始工作。