jBPM 6.5 java.lang.ClassNotFoundException

276 views
Skip to first unread message

mtr...@msn.com

unread,
Mar 8, 2017, 10:58:26 AM3/8/17
to jBPM Setup
I have a process model that is using custom workitems and within the workitem is using jackson for parsing json payloads. (parsing objects in another jar)
When I trigger the model it gets into the workitem then get

Caused by: java.lang.ClassNotFoundException: com.llnw.esb.models.canonical.sih.ComponentStatus from [Module "deployment.jbpm-console.war:main" from Service Module Loader]
at org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:198)
at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:363)
at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:351)
at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:93)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.fasterxml.jackson.databind.util.ClassUtil.findClass(ClassUtil.java:225)
at com.fasterxml.jackson.databind.DeserializationContext.findClass(DeserializationContext.java:520)
at com.fasterxml.jackson.databind.deser.std.FromStringDeserializer$Std._deserialize(FromStringDeserializer.java:216)

I have both jar file as dependencies in the project pom.xml file.

All works (of course) when I put the jar file under wildfly-10.0.0.Final/standalone/deployments/jbpm-console.war/WEB-INF/lib

I don't understand why it is not working when I have both jar's as dependencies. 

Any ideas? Or what I am missing?

Thanks
Mark

Maciej Swiderski

unread,
Mar 17, 2017, 8:32:08 AM3/17/17
to mtr...@msn.com, jBPM Setup
looks like your classes (that should be parsed from json) are on kjar class loader but Jackson ObjectMapper is not configured to use that class loader. It was in very recent version of Jackson (like 2.6.8 or so) that they enabled to set class loader. For other cases your only choice is to set the context classloder before you read use jackson and then set it back to original one after you’re done. Make sure you use the ProjectCLassLoader that will access to your classes. You can pass its reference via deployment descriptor mvel resolver:
new com.name.MyWorkItemHandler(classLoader) and jbpm will inject the project class loader into that handler.

Maciej
--
You received this message because you are subscribed to the Google Groups "jBPM Setup" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jbpm-setup+...@googlegroups.com.
To post to this group, send email to jbpm-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jbpm-setup/cc09d44f-3a1b-4213-99b6-dfdc966b81d6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

mtr...@msn.com

unread,
Mar 28, 2017, 12:20:06 PM3/28/17
to jBPM Setup, mtr...@msn.com
Works like a charm.

Thanks for the help.
Reply all
Reply to author
Forward
0 new messages