wei1044 liu [
http://community.jboss.org/people/raul.liu] created the discussion
"Re: javax.persistence.EntityNotFoundException: No Task with ID 26 was found!"
To view the discussion, visit:
http://community.jboss.org/message/639056#639056
--------------------------------------------------------------
I have transplanted REST interface of jbpm-gwt-console into my project, but when I call
this interface /gwt-console-server/rs/task/{taskId}/close/{outcome}, the problem turns
up(occasionally). I have tried to resolve this problem,so I download the source code of
HumanTask 5.1final and try to modify the getTask method, but it failed on first getting,
but I can get task after inserting a sleep thread for 1000ms before getTask. Sorry, I do
not read the source code carefully, and not so sure what is the reason of this, but the
problem is resolved temporarily.
public Task getTask(final long taskId) {
String sql = "select t from Task t where t.id = ?1";
Query query = em.createQuery(sql);
query.setParameter(1, taskId);
Task task = null;
try{
task = (Task)query.getSingleResult();
System.out.println("Task with ID " + taskId + " was found!");
}catch(Exception ex){
System.out.println("Error---------->No task["+taskId+"] with
found!");
try {
System.out.println("Sleep 1000ms,try again.");
Thread.sleep(1000);
} catch (InterruptedException e) {
e.printStackTrace();
}
try{
task = (Task)query.getSingleResult();
}catch(Exception e){
throw new EntityNotFoundException("No Task with ID " + taskId + " was
found!");
}
}
return task;
}
by the way, I have created BPMN file manually (not by Guvnor),and put it into
"jbpm.console.directory" directory, does my project can load it automatically
rather than restart TaskService and the project? And how does it make it ? Does it have
REST interface which can support that?Thank you.
--------------------------------------------------------------
Reply to this message by going to Community
[
http://community.jboss.org/message/639056#639056]
Start a new discussion in jBPM at Community
[
http://community.jboss.org/choose-container!input.jspa?contentType=1&...]