ENGINE-09017 Cannot load class. How can I create war file for wildfly deployment?

I am trying to test a delegate class and I am getting an error describe in the header.

I am trying to create a war. file with maven install. I am using the camunda archetype to implement the delegate class.

Snippet:

package com.camunda.supportGroup17.ServiceTasks;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.logging.Logger;

import org.camunda.bpm.engine.delegate.DelegateExecution;
import org.camunda.bpm.engine.delegate.JavaDelegate;
import org.camunda.bpm.engine.variable.Variables;
import org.camunda.bpm.engine.variable.value.ObjectValue;

public class SetPriorityDelegate implements JavaDelegate {
	
	private final static Logger LOGGER = Logger.getLogger(SetPriorityDelegate.class.getName());
	
	
	@Override
	public void execute(DelegateExecution execution) throws Exception {
		
		String anfrage = (String) execution.getVariable("anfrage");
		String email = (String) execution.getVariable("email");
		String name = (String) execution.getVariable("name");
		Long userid = (Long) execution.getVariable("userid");
		
		int anfrageLength = 0;

		

		int longRequest = 20;

		int mediumsRequest = 10;
		
		if (anfrage == null) {
			anfrage = "init";
			LOGGER.info("length of anfrage: " + anfrage);
			anfrageLength = anfrage.length();
		} else {
			LOGGER.info("length of anfrage: " + anfrage);
		}


		List<Integer> priorityScore = new ArrayList<>(Arrays.asList(1, 2, 3));
		
		// 1 = high priority
		// 2 = medium priority
		// 3 = low priority
		
		ObjectValue priorityScoreObject = Variables.objectValue(execution).create();
		

		if (anfrageLength >= longRequest) {
			priorityScoreObject = Variables.objectValue(priorityScore.get(0)).create();
			LOGGER.info("log has been created of process with regarded inquery: " + anfrage + " "
					+ "with user info: " + email + "-" + name + "with high priority: "+ priorityScoreObject.getValue());
			execution.setVariable("priority", priorityScoreObject.getValue());
		} else if (anfrageLength < longRequest && anfrageLength >= mediumsRequest) {
			priorityScoreObject = Variables.objectValue(priorityScore.get(1)).create();
			LOGGER.info("log has been created of process with regarded inquery: " + anfrage + " "
					+ "with user info: " + email + "-" + name + "with medium priority: "+ priorityScoreObject.getValue());
			execution.setVariable("priority", priorityScoreObject.getValue());
		} else if (anfrageLength < mediumsRequest) {
			priorityScoreObject = Variables.objectValue(priorityScore.get(2)).create();
			LOGGER.info("log has been created of process with regarded inquery: " + anfrage + " "
					+ "with user info: " + email + "-" + name + "with low priority: "+ priorityScoreObject.getValue());
			execution.setVariable("priority", priorityScoreObject.getValue());
		}
		

	}

}

Model:

process.bpmn (2.7 KB)

Error msg:

Tests in error:
testHappyPath(com.camunda.supportGroup17.ServiceTasks.ProcessUnitTest): ENGINE-09008 Exception while instantiating class ‘/ServiceTasks/src/main/java/com/camunda/supportGroup17/ServiceTasks/SetPriorityDelegate.java’: ENGINE-09017 Cannot load class ‘/ServiceTasks/src/main/java/com/camunda/supportGroup17/ServiceTasks/SetPriorityDelegate.java’: /ServiceTasks/src/main/java/com/camunda/supportGroup17/ServiceTasks/SetPriorityDelegate.java

What am I missing here?

You’ve added the class incorrectly.
If you’ve got /'s in your class path it’s not the correct path. You need you use the qualified name, which should have . in it. In your case:

com.camunda.supportGroup17.ServiceTasks.SetPriorityDelegate 

Thanks and I’ve set the correct path in the model, but I am still getting the same error when trying to run a maven install on the project.

Did you save the model?
If you removed the originally class you but in there, it shouldn’t show up.

Problem solved. Some stinky code and as you mentioned, wrong path in service task correctPath in the bpmn model. Thanks again!

1 Like