例外:无法使用严格模式解析方法:kie-server容器中的com.realtech.flight.FlightStatus.speed()

时间:2016-07-19 09:42:48

标签: java drools fusion kie-workbench kie-server

我是drools中的新手,我正在尝试在Drools kie服务器6.4.0上执行一个简单的CEP规则.Final在Tomcat7上运行,但是当我尝试启动kie容器时出现以下错误。

[localhost-startStop-1] DEBUG KieModule Lookup. ReleaseId com.realtech:stdout:1.0-SNAPSHOT was not in cache, checking classpath
[localhost-startStop-1] DEBUG KieModule Lookup. ReleaseId com.realtech:stdout:1.0-SNAPSHOT was not in cache, checking maven repository
[localhost-startStop-1] ERROR Unable to build KieBaseModel:kbase1
Unable to Analyse Expression speed == 200:
[Error: unable to resolve method using strict-mode: com.realtech.flight.FlightStatus.speed()]
[Near : {... speed == 200 ....}]
             ^
[Line: 15, Column: 4] : [Rule name='flight print']

我的代码就像:

FlightStatus.drl

package com.realtech.flight;
//import com.realtech.flight.FlightStatus;

declare FlightStatus
    @role(event)
end

rule "flight print"
no-loop true

when
    $flight : FlightStatus( speed == 200 ) // over window:time(1m)  
then
    System.out.println("test");     
end

FlightStatus.java

package com.realtech.flight;

/**
 * This class was automatically generated by the data modeler tool.
 */

public class FlightStatus implements java.io.Serializable
{

   static final long serialVersionUID = 1L;

   public java.lang.Float speed;

   public FlightStatus()
   {
   }

   public java.lang.Float getSpeed()
   {
      return this.speed;
   }

   public void setSpeed(java.lang.Float speed)
   {
      this.speed = speed;
   }

   public FlightStatus(java.lang.Float speed)
   {
      this.speed = speed;
   }

}

kie-workbench中的知识库设置: enter image description here

然后在kie-server中启动containter时出现异常。

但是当我删除声明时它会成功:

declare FlightStatus
    @role(event)
end

或删除speed == 200

抱歉我的英语不好。

0 个答案:

没有答案