problem to find JavaDelegate class

8 posts / 0 new
Last post
ridottiAstozze
Offline
Last seen: 1 year 11 months ago
Joined: 11/22/2011 - 12:15
Posts: 11
problem to find JavaDelegate class

Hi everyone,
I'm not able to link my java class in execution. I would like to use a simple JavaDelegate class but Tomcat launches the exception:
caused by: org.activiti.engine.ActivitiClass LoadingException: class not found: packageprovajar.recuperaValori

I write the code:

package packageprovajar;
import org.activiti.engine.delegate.DelegateExecution;

public class recuperaValori implements JavaDelegate {

public void execute(DelegateExecution execution) throws Exception {
System.out.println("sono in recupera valori");
}
}

Hello World

I have inserted the .jar in the path C:\activiti-5.8\apps\apache-tomcat-6.0.32\webapps\activiti-rest\WEB-INF\lib
and in the path C:\activiti-5.8\apps\apache-tomcat-6.0.32\lib but Tomcat launches always the same exception.
Probably i have inserted the .jar file in the wrong path but i'm not able to find the correct one.
Anyone can help me? thank you.

trademak
Offline
Last seen: 3 days 17 hours ago
Joined: 08/20/2010 - 21:12
Posts: 2887

Hi,

Are you using the process definition from the Activiti Explorer? Because then you need to add the JAR there as well.

Best regards,

Tijs Rademakers
Project lead Activiti
Manning book website --> Activiti in Action
Follow me on Twitter (@tijsrademakers)

ridottiAstozze
Offline
Last seen: 1 year 11 months ago
Joined: 11/22/2011 - 12:15
Posts: 11

Thank you for your answer. I upload the bar file (my bpmn20.xml file) through the webapp user interface. Are you referring to the path: C:\activiti-5.8\apps\apache-tomcat-6.0.32\webapps\activiti-explorer\WEB-INF\lib ? I have tryed to insert the .jar there, but tomcat gives me the same exception. Do you think that I have to set a classpath variable?
ps: Eclipse gives me this the report in the bpmn20.xml file : - cvc-attribute.3: The value 'packageprovajar.recuperaValori' of attribute 'activiti:class' on element 'serviceTask' is not valid with respect to its type, 'null'. It can be related to my problem?
Best regards

trademak
Offline
Last seen: 3 days 17 hours ago
Joined: 08/20/2010 - 21:12
Posts: 2887

Hi,

When you copy the JAR to the activiti-explorer/WEB-INF/lib folder the classes in the JAR file are available in the Activiti Explorer.
Please validate of the contents of the JAR file are correct.

Best regards,

Tijs Rademakers
Project lead Activiti
Manning book website --> Activiti in Action
Follow me on Twitter (@tijsrademakers)

ridottiAstozze
Offline
Last seen: 1 year 11 months ago
Joined: 11/22/2011 - 12:15
Posts: 11

hi,
when I validate the eclipse project the compiler doesn't give me any problems or warnings. I have solved the report in the bpmn20.xml file but I'm not able to solve the exception in the Activiti Explorer. I have inserted the .jar file in different directories: C:\activiti-5.8\apps\apache-tomcat-6.0.32\webapps\activiti-explorer\WEB-INF\lib , C:\activiti-5.8\apps\apache-tomcat-6.0.32\webapps\activiti-rest\WEB-INF\lib ,
C:\activiti-5.8\apps\apache-tomcat-6.0.32\lib . I have the same problem when i use the listeners.
I attach the modified code:





activiti:class="org.activiti.examples.bpmn.servicetask.BackwardsCompatibleExpressionDelegate" name="javaCode">








public class BackwardsCompatibleExpressionDelegate implements JavaDelegate {
public void execute(DelegateExecution execution) throws Exception {
System.out.println(" I am in BackwardsCompatibleExpressionDelegate....");
}
}

and a screen shot of my project

I'm sorry for the numerous messages but I need to solve this problem form my thesis.
best regards,

attachment: 
LisaMa
Offline
Last seen: 2 years 10 months ago
Joined: 08/19/2011 - 09:56
Posts: 27

How are you creating the jar file? With the "create deployment artefacts" menuitem? That thing has a bug in it as far as I know, it creats jars without a MANIFEST in it. Try the ecplise export option instead.

ridottiAstozze
Offline
Last seen: 1 year 11 months ago
Joined: 11/22/2011 - 12:15
Posts: 11

Great,
now it works. I used "the create deployment artefacts" options. Using the export funtionality I'm able to link to java classes. Thank you for your helpfulness.

Valarmathi
Offline
Last seen: 2 years 1 month ago
Joined: 09/14/2012 - 07:17
Posts: 41

can u help me.
I have export the jar from the eclipse,then where can i put the file and how can i run it.
Please help me.

Thanks,
Valarmathi P