xealous [
https://community.jboss.org/people/xealous] created the discussion
"How to use jar files in guvnor?"
To view the discussion, visit:
https://community.jboss.org/message/743961#743961
--------------------------------------------------------------
Hi everyone,
I've been searching for days and still couldn't find good tutorials on jbpm5. I
have a hard time using external jars in my project. Any help is appreciated :)
Here are the steps I took;
I have a CreateProject.jar file that I need to use with my process so that I can write
stuff to the database via a web service.
I have com.deneme.CreateProject class in it that I import and use in my script task.
I've uploaded it as POJO model jar
Package validation and build is successful but I don't see my process in jbpm-console
and jboss server log has the following:
15:08:21,612 ERROR [stderr] (Thread-43) java.lang.RuntimeException:
KnowledgeAgent exception while trying to deserialize KnowledgeDefinitionsPackage
15:08:21,612 ERROR [stderr] (Thread-43) at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:776)
15:08:21,612 ERROR [stderr] (Thread-43) at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:706)
15:08:21,612 ERROR [stderr] (Thread-43) at
org.drools.agent.impl.KnowledgeAgentImpl.incrementalBuildResources(KnowledgeAgentImpl.java:892)
15:08:21,612 ERROR [stderr] (Thread-43) at
org.drools.agent.impl.KnowledgeAgentImpl.buildKnowledgeBase(KnowledgeAgentImpl.java:675)
15:08:21,612 ERROR [stderr] (Thread-43) at
org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:203)
15:08:21,612 ERROR [stderr] (Thread-43) at
org.drools.agent.impl.KnowledgeAgentImpl$ChangeSetNotificationDetector.run(KnowledgeAgentImpl.java:1270)
15:08:21,612 ERROR [stderr] (Thread-43) at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
15:08:21,613 ERROR [stderr] (Thread-43) at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
15:08:21,613 ERROR [stderr] (Thread-43) at
java.util.concurrent.FutureTask.run(FutureTask.java:138)
15:08:21,613 ERROR [stderr] (Thread-43) at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
15:08:21,613 ERROR [stderr] (Thread-43) at
java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
15:08:21,613 ERROR [stderr] (Thread-43) at
java.util.concurrent.FutureTask.run(FutureTask.java:138)
15:08:21,613 ERROR [stderr] (Thread-43) at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
15:08:21,613 ERROR [stderr] (Thread-43) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
15:08:21,613 ERROR [stderr] (Thread-43) at java.lang.Thread.run(Thread.java:662)
15:08:21,614 ERROR [stderr] (Thread-43) Caused by: java.lang.ClassNotFoundException:
com.deneme.CreateProject from [Module
"deployment.jbpm-gwt-console-server.war:main" from Service Module Loader]
15:08:21,614 ERROR [stderr] (Thread-43) at
org.jboss.modules.ModuleClassLoader.findClass(ModuleClassLoader.java:191)
15:08:21,614 ERROR [stderr] (Thread-43) at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:361)
15:08:21,614 ERROR [stderr] (Thread-43) at
org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:333)
15:08:21,614 ERROR [stderr] (Thread-43) at
org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:310)
15:08:21,614 ERROR [stderr] (Thread-43) at
org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:103)
15:08:21,614 ERROR [stderr] (Thread-43) at java.lang.Class.forName0(Native Method)
15:08:21,614 ERROR [stderr] (Thread-43) at java.lang.Class.forName(Class.java:247)
15:08:21,615 ERROR [stderr] (Thread-43) at
org.drools.common.DroolsObjectInputStream.resolveClass(DroolsObjectInputStream.java:85)
15:08:21,615 ERROR [stderr] (Thread-43) at
org.drools.common.DroolsObjectInputStream.resolveClass(DroolsObjectInputStream.java:97)
15:08:21,615 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1574)
15:08:21,615 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1495)
15:08:21,615 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readClass(ObjectInputStream.java:1461)
15:08:21,615 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1311)
15:08:21,615 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
15:08:21,615 ERROR [stderr] (Thread-43) at
java.util.HashMap.readObject(HashMap.java:1030)
15:08:21,616 ERROR [stderr] (Thread-43) at
sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
15:08:21,616 ERROR [stderr] (Thread-43) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
15:08:21,616 ERROR [stderr] (Thread-43) at
java.lang.reflect.Method.invoke(Method.java:597)
15:08:21,616 ERROR [stderr] (Thread-43) at
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:969)
15:08:21,616 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848)
15:08:21,616 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
15:08:21,616 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
15:08:21,616 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
15:08:21,616 ERROR [stderr] (Thread-43) at
org.drools.rule.MVELDialectRuntimeData.readExternal(MVELDialectRuntimeData.java:85)
15:08:21,617 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1791)
15:08:21,617 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)
15:08:21,617 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
15:08:21,617 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
15:08:21,617 ERROR [stderr] (Thread-43) at
java.util.HashMap.readObject(HashMap.java:1030)
15:08:21,617 ERROR [stderr] (Thread-43) at
sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
15:08:21,617 ERROR [stderr] (Thread-43) at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
15:08:21,617 ERROR [stderr] (Thread-43) at
java.lang.reflect.Method.invoke(Method.java:597)
15:08:21,617 ERROR [stderr] (Thread-43) at
java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:969)
15:08:21,618 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1848)
15:08:21,618 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1752)
15:08:21,618 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
15:08:21,618 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
15:08:21,618 ERROR [stderr] (Thread-43) at
org.drools.rule.DialectRuntimeRegistry.readExternal(DialectRuntimeRegistry.java:59)
15:08:21,618 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1791)
15:08:21,618 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)
15:08:21,618 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
15:08:21,619 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
15:08:21,619 ERROR [stderr] (Thread-43) at
org.drools.rule.Package.readExternal(Package.java:208)
15:08:21,619 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1791)
15:08:21,619 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1750)
15:08:21,619 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
15:08:21,619 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readArray(ObjectInputStream.java:1666)
15:08:21,619 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1322)
15:08:21,619 ERROR [stderr] (Thread-43) at
java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
15:08:21,619 ERROR [stderr] (Thread-43) at
org.drools.core.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:205)
15:08:21,620 ERROR [stderr] (Thread-43) at
org.drools.core.util.DroolsStreamUtils.streamIn(DroolsStreamUtils.java:174)
15:08:21,620 ERROR [stderr] (Thread-43) at
org.drools.agent.impl.KnowledgeAgentImpl.createPackageFromResource(KnowledgeAgentImpl.java:749)
15:08:21,620 ERROR [stderr] (Thread-43) ... 14 more
Moreover, is using script
task is fine or should I use another approach?
Thanks in advence
--------------------------------------------------------------
Reply to this message by going to Community
[
https://community.jboss.org/message/743961#743961]
Start a new discussion in jBPM at Community
[
https://community.jboss.org/choose-container!input.jspa?contentType=1&...]