7 Replies Latest reply on Jun 18, 2012 5:44 AM by mutou wang

    IllegalArgumentException: Unable to instantiate service for Class 'org.drools.compiler.BPMN2ProcessProvider'

    mutou wang Newbie

      Hello, everyone!

      When I was running the java sentences:

       

           KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

           kbuilder.add(ResourceFactory.newFileResource(filename), ResourceType.BPMN2);

       

      the second line throws a IIIlegalArgumentException like this:

      java.lang.IllegalArgumentException: Unable to instantiate service for Class 'org.drools.compiler.BPMN2ProcessProvider' at org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:161)

      at org.drools.compiler.BPMN2ProcessFactory.loadProvider(BPMN2ProcessFactory.java:29)

      at org.drools.compiler.BPMN2ProcessFactory.getBPMN2ProcessProvider(BPMN2ProcessFactory.java:21)

      at org.drools.compiler.BPMN2ProcessFactory.configurePackageBuilder(BPMN2ProcessFactory.java:12)

      at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:607)

      at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)

      at org.thgrid.robinia.executor.impl.JbpmInstance.readKnowledgeBase(JbpmInstance.java:85)

      at org.thgrid.robinia.executor.impl.JbpmInstance.doIt(JbpmInstance.java:64)

      at org.thgrid.robinia.executor.impl.AbstractInstance.run(AbstractInstance.java:154)

      at org.thgrid.robinia.event.CallbackEventHandler.handle(CallbackEventHandler.java:11)

      at org.thgrid.robinia.event.EventProcessThread.handleEvent(EventCenter.java:67)

      at org.thgrid.robinia.event.EventProcessThread.run(EventCenter.java:45)

      Caused by: java.lang.IllegalArgumentException: Unable to instantiate 'org.jbpm.bpmn2.BPMN2ProcessProviderImpl' at org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.newInstance(ServiceRegistryImpl.java:210)

      at org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.call(ServiceRegistryImpl.java:202)

      at org.drools.util.ServiceRegistryImpl.get(ServiceRegistryImpl.java:159)

      ... 11 more

      Caused by: java.lang.ClassNotFoundException: org.jbpm.bpmn2.BPMN2ProcessProviderImpl at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)

      at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)

      at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Unknown Source)

      at org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.newInstance(ServiceRegistryImpl.java:207) ... 13 more

       

      I debuged this program for days and search the Internet for solutions, but in vain.

      How could this Exceptions happen?

      And What should I do to solve this problem??

      Thank you!!