cancel
Showing results for 
Search instead for 
Did you mean: 

Class not found exception in java service task

kavi
Champ in-the-making
Champ in-the-making
Hi ,

To use java service task i have create my own java class in "\activiti\workspace\activiti-engine-examples\target\classes\org\activiti\examples\bpmn\servicetask" named "mails.class"

My bpm.xml files are in "activiti\workspace\activiti-modeler-examples".

So how can i refer my class in my bpm.xml file?

I just copied the org\activiti\examples\bpmn\servicetask folder in my file path "activiti\workspace\activiti-modeler-examples". and in bpm.xml file i referred
      
<serviceTask completionQuantity="1" activiti:class="org.activiti.examples.bpmn.servicetask.mails"  id="sid-78176AC6-C1E4-43FB-BB8F-48550589A89B" name="Send notification email to admin on status &quot;Applied&quot;" startQuantity="1">
         <extensionElements>
            <signavio:signavioMetaData metaKey="bgcolor" metaValue="#ffffcc"/>
          
         </extensionElements>
         <incoming>sid-515BC8FA-F8B0-4CB2-A818-BCDD3AA2FAED</incoming>
      </serviceTask>

How should i refer the class?
I get the exception as "06040005 Wrapped Exception (with status template): couldn't instantiate class mails"
The error was ClassNotFoundException

Why is it so? How should i refer my class?

Help me

Thanks,
kavi
8 REPLIES 8

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Kavi,

Class files normally start with a Capital, so maybe, just maybe use made an error here

vaibhavmaniar
Champ in-the-making
Champ in-the-making
Hi guys,
I'm getting the same problem.
I'm deploying the .bar file on activiti explorer and i had used service task in my process and attached a class with it.
But the bar file which is getting generated does not contains the java class so after deploying it when i'm running its throwing "Class Not Found Exception".
So please help me in deploying java classes with it.

frederikherema1
Star Contributor
Star Contributor
Please do not ask the same question twice. Asking the same question won't get it answered any sooner…

bram
Champ in-the-making
Champ in-the-making
Why not answer the question or provide an update then?

jbarrez
Star Contributor
Star Contributor
A bar will *never* contains Java classes. You need to add them to the classpath yourself.

cavdar
Champ in-the-making
Champ in-the-making
why is it necessay to deploy the bar file and copy the jars manually? What is when i use an activiti installation which is not accesible except the explorer?
I would expect that the deployment file contains all needed resources and the deployment process does the rest, including deploy bar file and adds jars/classes into class path of the engine.
Can anyone explain me how to copy the jars my process needs to …/tomcat/webapps/activiti-explorer/META-INF/libs, when tomcat is running on a remote mashine and i don't have file-access to it?
thanks a lot in advance
Kemal CAVDAR

trademak
Star Contributor
Star Contributor
Hi Kemal,

We don't want to implement class loading logic in the Activiti Engine to keep the Engine simple and focused on BPMN execution. JBoss and other application servers, and for example Apache Karaf provide class loading mechanisms that we can utilize in Activiti. If you deploy on Tomcat then yes you need to copy the JARs to the WEB-INF/lib folder.

Best regards,

cavdar
Champ in-the-making
Champ in-the-making
Hi Tijs,

thank you verry much replaying so rapidly!