ruleflow and bpmn files issues with drools and guvnor 5.2 final

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

ruleflow and bpmn files issues with drools and guvnor 5.2 final

style.x7
Hi all,

I've tried drools 5.2 final version with much excitement but the default create new drools project is already giving problems:

Issue 1. Exceptions when running default created .rf and .bpmn files.
When I ran ProcessTest.java with .rf file, I get:
java.lang.NullPointerException
        at org.drools.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:516)
        at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:556)
        at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
        at com.sample.ProcessTest.readKnowledgeBase(ProcessTest.java:36)
        at com.sample.ProcessTest.main(ProcessTest.java:23)

When I ran ProcessTest.java with .bpmn file, I get:
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:559)
        at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)
        at com.sample.ProcessTest.readKnowledgeBase(ProcessTest.java:33)
        at com.sample.ProcessTest.main(ProcessTest.java:20)
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)
        ... 7 more
Caused by: java.lang.ClassNotFoundException: org.jbpm.bpmn2.BPMN2ProcessProviderImpl
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Unknown Source)
        at org.drools.util.ServiceRegistryImpl$ReflectionInstantiator.newInstance(ServiceRegistryImpl.java:207)
        ... 9 more

Issue 2: Guvnor 5.2 final unable to display .rf and .bpmn files

No error message was given when guvnor is unable to display .rf files. The popup shows blank diagrams.

For .bpmn files, guvnor with designer-1.0.0.052-jboss.war shows the oryx editor with blank diagrams, error message:

SEVERE [JbpmProfileImpl] Could not find BPMNDI information
java.lang.IllegalArgumentException: Could not find BPMNDI information
        at com.intalio.bpmn2.impl.Bpmn2JsonMarshaller.marshallProcess(Bpmn2JsonMarshaller.java:347)
        at com.intalio.bpmn2.impl.Bpmn2JsonMarshaller.marshallDefinitions(Bpmn2JsonMarshaller.java:255)
        at com.intalio.bpmn2.impl.Bpmn2JsonMarshaller.marshall(Bpmn2JsonMarshaller.java:138)
        at com.intalio.web.profile.impl.JbpmProfileImpl$2.parseModel(JbpmProfileImpl.java:197)
        at com.intalio.web.repository.impl.UUIDBasedJbpmRepository.load(UUIDBasedJbpmRepository.java:38)
        at com.intalio.web.server.UUIDBasedRepositoryServlet.doGet(UUIDBasedRepositoryServlet.java:123)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.intalio.web.filter.impl.PluggableFilter.doFilter(PluggableFilter.java:75)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
        at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
        at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
        at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
        at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
        at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
        at java.lang.Thread.run(Unknown Source)

My development environment is eclipse 3.6, drools plugin 5.2 final, java 6, windows 7, jboss as 5.1 jdk 6.

Any help would be greatly appreciated.

Reply | Threaded
Open this post in threaded view
|

Re: ruleflow and bpmn files issues with drools and guvnor 5.2 final

marlele
Hi,
I had the same problem and with debug I discover that the new approch to create a ProcessBuilder is to use a "org.jbpm.process.builder.ProcessBuilderFactoryServiceImpl" (row 26 of ProcessBuilderFactory).

Searching on all the parents pom.xml of knoledge-api I see that drools project is composed by drools api and jbpm api and if i tried to include this dependency:
<groupId>org.jbpm</groupId>
<artifactId>jbpm-bpmn2</artifactId>
<version>5.1.0.Final</version>
With this inclusion the ProcessBuilderFactory find the ProcessBuilderFactoryServiceImpl on the classpath and all work correctly.

So, I suppose that is only a problem of not proper dependency management.

I hope I helped you
Bye
Reply | Threaded
Open this post in threaded view
|

Re: ruleflow and bpmn files issues with drools and guvnor 5.2 final

womuji
We are upgrading from 5.1 to 5.3 and we had some rule flow files with .rf extension, but the new jBPM in 5.2 and after is creating bpmn files instead for process.

 Can we still use the old rf file? or we have to recreate them as bpmn file?

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: ruleflow and bpmn files issues with drools and guvnor 5.2 final

womuji
Also, as part of our build process, we used org.drools.contrib.DroolsCompilerAntTask in our maven file to compiled all .rf file into a single ruleflow.flow file , which in turn was added to our RuleBase in the following fashion:

                      DroolsObjectInputStream ruleFlowStream = new DroolsObjectInputStream(
                                new BufferedInputStream(
                                        resourceLoader.getResource(
                                                "classpath:ruleflow.flow"
                                        ).getInputStream()
                                )
                        );
                        org.drools.rule.Package ruleFlow = (org.drools.rule.Package)ruleFlowStream.readObject();
                        ruleBase.addPackage(ruleFlow);

How do we add it to KnowledgeBase in the new 5.3 API? Do we need to make any changes for our Maven task?