0 Replies Latest reply on Jun 4, 2012 10:35 AM by Sueleyman Vurucu

    drools cannot be resolved

    Sueleyman Vurucu Expert

      Hi,

       

      I do an update of drools from 5.0 to 5.4.

       

      For that I do the folowing steps:

      1. download Drools and jBPM integration from http://www.jboss.org/drools/downloads.

      2. Create a module with the content:

       

      <?xml version="1.0" encoding="UTF-8" standalone="no"?>
      <module xmlns="urn:jboss:module:1.1" name="drools">
          <resources>
              <resource-root path="activation-1.1.jar" />
              <resource-root path="activeio-core-3.1.2.jar" />
              <resource-root path="activemq-core-5.3.1.jar" />
              <resource-root path="activemq-protobuf-1.0.jar" />
              <resource-root path="antlr-2.7.7.jar" />
              <resource-root path="antlr-3.3.jar" />
              <resource-root path="antlr-runtime-3.3.jar" />
              <resource-root path="aopalliance-1.0.jar" />
              <resource-root path="asm-3.3.jar" />
              <resource-root path="camel-blueprint-2.9.0.jar" />
              <resource-root path="camel-core-2.9.0.jar" />
              <resource-root path="camel-core-osgi-2.9.0.jar" />
              <resource-root path="camel-core-xml-2.9.0.jar" />
              <resource-root path="camel-cxf-2.9.0.jar" />
              <resource-root path="camel-cxf-transport-2.9.0.jar" />
              <resource-root path="camel-jaxb-2.9.0.jar" />
              <resource-root path="camel-spring-2.9.0.jar" />
              <resource-root path="camel-test-2.9.0.jar" />
              <resource-root path="camel-xstream-2.9.0.jar" />
              <resource-root path="commons-beanutils-1.7.0.jar" />
              <resource-root path="commons-collections-3.2.1.jar" />
              <resource-root path="commons-compress-1.0.jar" />
              <resource-root path="commons-digester-1.8.jar" />
              <resource-root path="commons-exec-1.0.1.jar" />
              <resource-root path="commons-io-1.4.jar" />
              <resource-root path="commons-jexl-1.1.jar" />
              <resource-root path="commons-lang-2.4.jar" />
              <resource-root path="commons-logging-1.1.1.jar" />
              <resource-root path="commons-logging-api-1.1.jar" />
              <resource-root path="commons-net-2.0.jar" />
              <resource-root path="cxf-api-2.4.4.jar" />
              <resource-root path="cxf-bundle-jaxrs-2.4.4.jar" />
              <resource-root path="cxf-common-utilities-2.4.4.jar" />
              <resource-root path="cxf-rt-bindings-soap-2.4.4.jar" />
              <resource-root path="cxf-rt-bindings-xml-2.4.4.jar" />
              <resource-root path="cxf-rt-core-2.4.4.jar" />
              <resource-root path="cxf-rt-databinding-jaxb-2.4.4.jar" />
              <resource-root path="cxf-rt-frontend-jaxrs-2.4.4.jar" />
              <resource-root path="cxf-rt-frontend-jaxws-2.4.4.jar" />
              <resource-root path="cxf-rt-frontend-simple-2.4.4.jar" />
              <resource-root path="cxf-rt-transports-common-2.4.4.jar" />
              <resource-root path="cxf-rt-transports-http-2.4.4.jar" />
              <resource-root path="cxf-rt-ws-addr-2.4.4.jar" />
              <resource-root path="cxf-tools-common-2.4.4.jar" />
              <resource-root path="dom4j-1.6.1.jar" />
              <resource-root path="drools-camel-5.4.0.Final.jar" />
              <resource-root path="drools-camel-server-5.4.0.Final.war" />
              <resource-root path="drools-compiler-5.4.0.Final.jar" />
              <resource-root path="drools-core-5.4.0.Final.jar" />
              <resource-root path="drools-decisiontables-5.4.0.Final.jar" />
              <resource-root path="drools-grid-impl-5.4.0.Final.jar" />
              <resource-root path="drools-persistence-jpa-5.4.0.Final.jar" />
              <resource-root path="drools-pipeline-5.4.0.Final.jar" />
              <resource-root path="drools-simulator-5.4.0.Final.jar" />
              <resource-root path="drools-spring-5.4.0.Final.jar" />
              <resource-root path="drools-templates-5.4.0.Final.jar" />
              <resource-root path="ecj-3.5.1.jar" />
              <resource-root path="ejb3-persistence-1.0.2.GA.jar" />
              <resource-root path="freemarker-2.3.15.jar" />
              <resource-root path="geronimo-activation_1.1_spec-1.1.jar" />
              <resource-root path="geronimo-annotation_1.0_spec-1.1.1.jar" />
              <resource-root path="geronimo-j2ee-management_1.0_spec-1.0.jar" />
              <resource-root path="geronimo-j2ee-management_1.1_spec-1.0.1.jar" />
              <resource-root path="geronimo-javamail_1.4_spec-1.7.1.jar" />
              <resource-root path="geronimo-jms_1.1_spec-1.1.1.jar" />
              <resource-root path="geronimo-stax-api_1.0_spec-1.0.1.jar" />
              <resource-root path="h2-1.3.161.jar" />
              <resource-root path="hamcrest-integration-1.2.1.jar" />
              <resource-root path="hamcrest-library-1.2.1.jar" />
              <resource-root path="hazelcast-1.8.5.jar" />
              <resource-root path="hibernate-annotations-3.4.0.GA.jar" />
              <resource-root path="hibernate-commons-annotations-3.1.0.GA.jar" />
              <resource-root path="hibernate-core-3.3.2.GA.jar" />
              <resource-root path="hibernate-entitymanager-3.4.0.GA.jar" />
              <resource-root path="hibernate-jpa-2.0-api-1.0.1.Final.jar" />
              <resource-root path="javassist-3.10.0.GA.jar" />
              <resource-root path="javassist-3.14.0-GA.jar" />
              <resource-root path="jaxb-api-2.2.5.jar" />
              <resource-root path="jaxb-impl-2.2.5.jar" />
              <resource-root path="jaxb-xjc-2.2.5.jar" />
              <resource-root path="jbpm-bpmn2-5.3.0.Final.jar" />
              <resource-root path="jbpm-flow-5.3.0.Final.jar" />
              <resource-root path="jbpm-flow-builder-5.3.0.Final.jar" />
              <resource-root path="jbpm-workitems-5.3.0.Final.jar" />
              <resource-root path="jdom-1.0.jar" />
              <resource-root path="jettison-1.2.jar" />
              <resource-root path="jetty-continuation-7.4.5.v20110725.jar" />
              <resource-root path="jetty-http-7.4.5.v20110725.jar" />
              <resource-root path="jetty-io-7.4.5.v20110725.jar" />
              <resource-root path="jetty-security-7.4.5.v20110725.jar" />
              <resource-root path="jetty-server-7.4.5.v20110725.jar" />
              <resource-root path="jetty-util-7.4.5.v20110725.jar" />
              <resource-root path="joda-time-1.6.jar" />
              <resource-root path="jsr311-api-1.1.1.jar" />
              <resource-root path="jta-1.1.jar" />
              <resource-root path="jxl-2.6.10.jar" />
              <resource-root path="jxls-reader-0.9.6.jar" />
              <resource-root path="kahadb-5.3.1.jar" />
              <resource-root path="knowledge-api-5.4.0.Final.jar" />
              <resource-root path="knowledge-internal-api-5.4.0.Final.jar" />
              <resource-root path="log4j-1.2.16.jar" />
              <resource-root path="mail-1.4.jar" />
              <resource-root path="milyn-commons-1.2.jar" />
              <resource-root path="milyn-smooks-core-1.2.jar" />
              <resource-root path="milyn-smooks-javabean-1.2.jar" />
              <resource-root path="mina-core-2.0.1.jar" />
              <resource-root path="mvel2-2.1.0.drools16.jar" />
              <resource-root path="neethi-3.0.1.jar" />
              <resource-root path="org.apache.aries.blueprint-0.3.jar" />
              <resource-root path="org.apache.aries.proxy.api-0.3.jar" />
              <resource-root path="org.apache.aries.testsupport.unit-0.3.jar" />
              <resource-root path="org.apache.aries.util-0.3.jar" />
              <resource-root path="org.osgi.core-4.1.0.jar" />
              <resource-root path="persistence-api-1.0.jar" />
              <resource-root path="poi-3.0.2-FINAL.jar" />
              <resource-root path="protobuf-java-2.4.1.jar" />
              <resource-root path="rome-0.9.jar" />
              <resource-root path="serializer-2.7.1.jar" />
              <resource-root path="simple-jndi-0.11.4.jar" />
              <resource-root path="slf4j-api-1.6.4.jar" />
              <resource-root path="slf4j-log4j12-1.6.4.jar" />
              <resource-root path="smack-3.0.4.jar" />
              <resource-root path="snakeyaml-1.4.jar" />
              <resource-root path="spring-aop-3.0.6.RELEASE.jar" />
              <resource-root path="spring-asm-3.0.6.RELEASE.jar" />
              <resource-root path="spring-beans-3.0.6.RELEASE.jar" />
              <resource-root path="spring-context-3.0.6.RELEASE.jar" />
              <resource-root path="spring-core-3.0.6.RELEASE.jar" />
              <resource-root path="spring-expression-3.0.6.RELEASE.jar" />
              <resource-root path="spring-osgi-core-1.2.1.jar" />
              <resource-root path="spring-osgi-io-1.2.1.jar" />
              <resource-root path="spring-tx-3.0.6.RELEASE.jar" />
              <resource-root path="spring-web-3.0.6.RELEASE.jar" />
              <resource-root path="stax-api-1.0-2.jar" />
              <resource-root path="stax-api-1.0.1.jar" />
              <resource-root path="stax2-api-3.1.1.jar" />
              <resource-root path="stringtemplate-3.2.1.jar" />
              <resource-root path="woodstox-core-asl-4.1.1.jar" />
              <resource-root path="wsdl4j-1.6.2.jar" />
              <resource-root path="xalan-2.7.1.jar" />
              <resource-root path="xercesImpl-2.9.1.jar" />
              <resource-root path="xml-apis-1.3.04.jar" />
              <resource-root path="xml-resolver-1.2.jar" />
              <resource-root path="xmlpull-1.1.3.1.jar" />
              <resource-root path="xmlschema-core-2.0.1.jar" />
              <resource-root path="xpp3_min-1.1.4c.jar" />
              <resource-root path="xstream-1.4.1.jar" />
          </resources>
          <dependencies>
              <module export="true" name="javax.api" slot="main" />
          </dependencies>
      </module>
      

       

      3. activate that modulle via jboss-deployment-structure.xml:

       

      <jboss-deployment-structure>
      <!--
      <ear-subdeployments-isolated>true</ear-subdeployments-isolated>
       -->
      
          <deployment>
              <dependencies>
                  <module name="drools" slot="main" />
                  <module name="org.hibernate" slot="main" />
              </dependencies>
          </deployment>
      </jboss-deployment-structure>
      

       

       

      If I start drools from my app I get the waring shown below.

      KnowledgeAgent has KnowledgeBuilder errors  Process Compilation error : org.drools.lang.descr.ProcessDescr@bfeb00

          com/siemag/rules/orderprocessing/Process_com_siemag_rules_orderprocessing_Materialflow_Flow_1224653408704c6ea7b5f72fa9817a3b.java (15:700) : drools cannot be resolved

       

      My drf file:

       

      <?xml version="1.0" encoding="UTF-8"?> 
      <process xmlns="http://drools.org/drools-5.0/process"
               xmlns:xs="http://www.w3.org/2001/XMLSchema-instance"
               xs:schemaLocation="http://drools.org/drools-5.0/process drools-processes-5.0.xsd"
               type="RuleFlow" name="Materialflow Flow" id="materialflow" package-name="com.siemag.rules.orderprocessing" version="1" >
      
        <header>
          <imports>
            <import name="java.util.Set" />
          </imports>
        </header>
      
        <nodes>
      ...    <actionNode id="27" name="Clear" x="880" y="407" width="98" height="40" >
              <action type="expression" dialect="java" >((Set)drools.getWorkingMemory().getGlobal("bestPlacesAlreadyInUse")).clear();</action>
          </actionNode>
      ...  </nodes>
      
        <connections>
          ...
        </connections>
      
      </process>
      

       

       

      The refrence to drools.getWorkingMemory() worked in 5.0.

      My env:

      java 7U3

      jboss 7.1.1.Final

       

      Thanks in advance

       

      I see in the documentation that what I need is a refrence to KnowledgeHelper   http://docs.jboss.org/drools/release/5.3.0.Final/drools-expert-docs/html_single/index.html ( section 5.8.4.1. Usage).