cancel
Showing results for 
Search instead for 
Did you mean: 

Throws Exception: taskService.createTaskQuery().taskName

juacosta
Champ in-the-making
Champ in-the-making
Description
When invoking
taskService.createTaskQuery().taskName("Task Name")
, an exception is thrown indicating the method "taskName" does not exists.

Symptoms
In debug, the value of nameLike passed into
public TaskQueryImpl taskNameLike(String nameLike)
is set to
null


Conditions
Activiti v5.16.3
H2 v 1.4.181
JDK 1.8.0_20

Used sample from the Book Activiti in Action to isolate issue

The code that breaks

   List<Task> availableTaskList = taskService.createTaskQuery().taskName("Work on order").list();



  java.lang.NoSuchMethodError: org.activiti.engine.task.TaskQuery.taskName(Ljava/lang/String;)Lorg/activiti/engine/task/TaskQuery;
   at org.bpmnwithactiviti.chapter1.BookOrderTest.startBookOrder(BookOrderTest.java:46)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:483)
   at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
   at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
   at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
   at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
   at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
   at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
   at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
   at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
   at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
   at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
   at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
   at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
   at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)

4 REPLIES 4

juacosta
Champ in-the-making
Champ in-the-making
*

martin_grofcik
Confirmed Champ
Confirmed Champ
Hi,

I have found plenty of tests in activiti source which are using taksQuery.taskName…. (e.g. org.activiti.engine.test.api.task.TaskQueryTest#testQueryByName). Could you reproduce this issue in jUnit test please?
http://forums.activiti.org/content/sticky-how-write-unit-test

regards
Martin

juacosta
Champ in-the-making
Champ in-the-making
Martin,

Thanks for responding. I will put together the Unit test case and upload it

juacosta
Champ in-the-making
Champ in-the-making
Martin,

To give you an update. I have been working all day today on the repro. I am happy and sad to say that I was not able to repro the issue with the stand a lone Unit Test Project. However, I am now going over my old suite and working thru the dependencies. I imagine that there is something wrong with them and it is pulling the wrong code. Right now, the new Unit Test Project includes fewer dependencies. The only libraries I am using in the new project are:

Activiti v5.16.3
H2 v 1.4.181
Groovy All v2.3.7
JUnit v 4.11
slf4j-log4j12 v1.7.5

I will continue tracing the issue and let you know what I find