Cannot instantiate process definition testing:1:85607f56-6306-11ec-a7fe-080027e0c096: couldn't execute activity <serviceTask id="say-hello" ...>: com.mysql.jdbc.Driver

Hi Team,
I am getting this error - Cannot instantiate process definition testing:1:85607f56-6306-11ec-a7fe-080027e0c096: couldn’t execute activity <serviceTask id=“say-hello” …>: com.mysql.jdbc.Driver

Please help me
process.bpmn (4.8 KB)

Source Inventory code is also here-

package anishinventory.testing;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;

public class SourceInventory implements JavaDelegate {
private List inv1 = new ArrayList();
public void execute(DelegateExecution execution) throws Exception {
// TODO Auto-generated method stub
String url = “jdbc:mysql://localhost/inv”;
String user = “root”;
String pass = “37May@2154”;

	Connection con = DriverManager.getConnection(url, user, pass);
	Statement st = con.createStatement();
	ResultSet rs = st.executeQuery("Select * from port where ProvisionStatus = 'Available'");
	int rollno = (int) execution.getVariable("RollNo");

		System.out.println("Inventory found from source inventory");
		execution.setVariable("inventoryfound", true);
		execution.setVariable("inventoryfound", false);


Hey @AnishYadav ,

have you copied the qualified name of the Java class to link it to your process model? It could be the reason that the class can’t be located in runtime.

You could also use for the Servicetask the Implementation Delegate Expression with #{className}
In your class you have to use the @Named Annotation to avoid links to direct locations.

I hope that helps
Kind regards

I have given Java class to process model and it has accepted because they are showing [com.mysql.jdbc.Driver . and [com.mysql.jdbc.Driver is within the java class.