5
votes

I am new in jBPM. I am testing jBPM 7.32.0.Final.
The environment has been set up by installer (ant install.demo).

My use case:

I am trying to develop and test a custom work item handler (as shown in https://www.youtube.com/watch?v=_XIZ0KRTahE) that uses oracle jdbc driver.
In the jbpm console I have created: a new work item definition (CustomTask), new business process that uses the custom task, added work item handler to the project, created handler implementation in Eclipse, uploaded artifact to the repository, and added the artifact dependency to the project.

Problem :

Simple artifact with no transitive dependencies works fine. Problems are when I add a dependency on the jdbc driver that should be used in the work item handler.

What I did to resolve the transitive dependency:

Using jbpm console, I uploaded another artifact with jdbc driver jar (ojdbc8.jar) to the repository and added dependency to the work item handler artifact on the jdbc driver artifact. (by editing the handler's pom.xml).

Observed behavior:

  • When I try to start a new process instance in jbpm console I get

    "Error processing request" (Context Path:/kie-server, Servlet Path: /services/rest, Path Info:/server/containers/cust-mod_1.0.0-SNAPSHOT/processes/Custom_Module_Project.TEST/instances , Query String: null )

    and in the server.log I can see:

    Caused by:java.lang.ClassNotFoundException:oracle.simplefan.FanManager

    which is a class from another oracle jar file simplefan.jar.

    Note: When I do a unit test in Eclipse only the library ojdbc8.jar is needed !!

  • then when I remove transitive dependency from the pom.xml in the work item artifact and redeploy the project (without restart jbpm), surprisingly I can start a new instance and it works fine !!!

  • then when I restart jBPM and try to start new instance, a new instance is started, however, the process custom task raises an exception that I can see in server.log:

    java.lang.ClassNotFoundException: oracle.jdbc.OracleDriver

    When I repeat the above steps, I can reproduce still the same behavior.

Probably I am missing something important. Can anybody refer me to the correct steps/procedure ? Please let me know if more info is needed. Much appreciated.

1
did you find any solution to this ? i am having the same issuejmiguel77
I am getting the same problem. Create a java project with a custom work item handler, add a dependency (in my case activeMQ) and when I try to execute it, it gives me class not found exception.Samuel Torga

1 Answers

0
votes

Not sure how much of an (im)proper "fix" this is, but adding the transitive dependencies as explicit dependencies for the project allows KIE server to compile/execute the container.