cancel
Showing results for 
Search instead for 
Did you mean: 

NoSuchMethodError when using HistoryService

amy11
Champ in-the-making
Champ in-the-making
Hi everybody,

working with Activiti 5.19.0.2 OSX, Tomcat 8.0.32 - I am trying to retrieve previous task informations using "HistoryService" resp. "HistoricTaskInstance" inside a TaskListener. My Unit test works fine but as soon as I run the process an interesting error msg. occurs which I apparently cannot get rid of:

 
Caused by: java.lang.NoSuchMethodError: org.activiti.engine.history.HistoricTaskInstanceQuery.processInstanceId(Ljava/lang/String;)Lorg/activiti/engine/history/HistoricTaskInstanceQuery;


AFAIK there seems to be a version related problem which I have also encountered while testing in Eclipse - those errors are all cleaned up in the eclipse environment. Still having the same error when running the process.

This is the code snippet that causes the trouble as if this is an out-of-date-way to query historic data…:

HistoricTaskInstance historicTask = historyService.createHistoricTaskInstanceQuery()
               .processInstanceId(delegateTask.getProcessInstanceId())
               .taskDefinitionKey(otherTaskId.getExpressionText())
               .singleResult();


Am I possibly using "historyService.createHistoricTaskInstanceQuery()" the wrong way?
If its all about the libraries that are not present in the right version, how and where can I find out about this? I have checked the lib-folder of tomcat, the projects lib-folder, activiti-explorer - but I almost believe i am looking into the wrong direction… :sorry:

Any help your be very much appreciated Smiley Happy
Kind Regards!



2 REPLIES 2

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

You have to search for HistoricTaskInstanceQuery class in your classpath to check which class is loaded by class loader.

Regards
Martin

amy11
Champ in-the-making
Champ in-the-making
Hi Martin,
thank you for your reply.
While searching for the class and gaining infos concerning the classpath (do i have to explicitly set the classpath in .bash_profile??) I realized my projects maven dependencies showed an older version of the activiti engine. Updating that one and some more other things I also stumbled across that other post: https://forums.activiti.org/content/error-createhistorictaskinstancequery - I dropped all tables as well…

And now it works like a charm Smiley Happy