cancel
Showing results for 
Search instead for 
Did you mean: 

Error at Web Service Invocation at Service Task Activity

rajendiran
Champ in-the-making
Champ in-the-making
Hi,

I built web service client in JAVA and trying to call this web service client java method from Service task. My java class implements "JavaDelegate" interface and implements "execute()" method. I copied web service client code below.

public class CheckLeaveWSClient implements JavaDelegate {
         public void execute(DelegateExecution execution) throws Exception {
      GetNoOfDaysProxy daysProcxy = new GetNoOfDaysProxy();
      StringHolder cname = new StringHolder("Ram");
      try{
         String result = daysProcxy.processLeave(cname);
         System.out.println(result);
      }
      catch(Exception e){
         e.printStackTrace();
   }
   }
}

I deployed the activiti process into activiti explorer. I am getting "couldn't instantiate class CheckLeaveWSClient" message in Activiti Explorer. This message is coming when Activiti engine tries to execute Service task. Please help me to fix this issue. Also I attched the bpmn file and log file (taken from tomcat) for your kind reference.

Thanks and Regards,
Rajendiran R
5 REPLIES 5

frederikherema1
Star Contributor
Star Contributor
Did you package the classes needed in a jar and added it to the tomcat class path? Including all dependencies the jar needs…

rajendiran
Champ in-the-making
Champ in-the-making
Dear Mr. Frederikheremans,

I packaged all dependency classes and executed. In Activiti Process Definition, I changed configuration from "Java Class" to "Expression" in Service Task. I created a bean at "activiti-context.xml" to invokde the method "activiti:expression="${callLeaveService.execute(execution)}". Now I am getting the below Exception.
"Caused by: java.lang.UnsupportedClassVersionError: com/nomura/activiti/service/CheckLeaveWSClient : Unsupported major.minor version 51.0 (unable to load class com.nomura.activiti.service.CheckLeaveWSClient)".

I am stuck in this from the past 3 days. Please help me to fix this issue.

I also attached activiti-context xml file, error log files from Tomcat and my bpmn file for your reference.

Thanks and Regards,
Rajendiran R

frederikherema1
Star Contributor
Star Contributor
Caused by: java.lang.UnsupportedClassVersionError
With all due respect: Are you kidding me? You compiled the classes in a more recent Java version than the one you're running the engine on. Please use google/common sense before asking questions on activiti-forum…

rajendiran
Champ in-the-making
Champ in-the-making
Dear Mr. Frederikheremans,

I suspected the same. I changed the java version which is now common between the eclipse and Tomcat (where I have Activiti Engine). But this error still persists.

Moreover people will not shoot any questions with no common sense and I am not kidding also. My apologies if this question is irrelevant to what for Activiti Forum. I will double-check once again and will come back with update.

Thanks a lot for the support.

Regards,
Rajendiran R

frederikherema1
Star Contributor
Star Contributor
Rajendiran, I didn't mean to offend you but we try really hard to answer people's question about Activiti. We're not a java-forum - java.lang.UnsupportedClassVersionError's is a basic Java exception, totally unrelated to Activiti. So best to first check if the error is related specifically to activiti…