cancel
Showing results for 
Search instead for 
Did you mean: 

couldn't instantiate class xy although .jar in the classpath

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

I am currently having a problem with deploying processes with service tasks. Whenever I start my process with a service task, it runs into an error: "Warning! couldn't instantiate class xy."

I read about it in the "Activiti in action", in user guide and also in this forum.

The solutions I tried out were:
————————
1) stopping tomcat, putting the .jar (generated through "create deployment artifacts"), where my simple class resides into the ..\Tomcat\webapps\activiti-rest\WEB-INF\lib folder, starting tomcat, deploying .bar file
2) creating a new .jar file with eclipse, doing the same as in the 1)

My class is very simple, all the external dependencies are in activiti-engine-5.12.1.jar:

import org.activiti.engine.delegate.DelegateExecution;
import org.activiti.engine.delegate.JavaDelegate;

public class xy implements JavaDelegate {
   @Override
   public void execute(DelegateExecution execution) {
      System.out.println("execution id " + execution.getId());
      Long myVar = (Long) execution.getVariable("myVar");
      System.out.println("received variable " + myVar);
   }
}


I am currently using the default package, therefore the .class files are in the .jar on the uppermost level. The name of the .jar file is identical to the .bar and .bpmn files. In the .bpmn I reference the .class so:
<serviceTask id="servicetask1" name="Service task" activiti:class="xy"></serviceTask>

I am running out of ideas, what more I could try. All the tips I have read from different sources are somehow not working for me.

Thank you in advance.
1 REPLY 1

peemot210
Champ in-the-making
Champ in-the-making
ok, solved now. I copied the .jar files into  ..\Tomcat\webapps\activiti-rest\WEB-INF\lib and not into webapps/activiti-explorer/WEB-INF/lib. Stupid mistake, but took a while to figure out.