Drools mvel方言drl断点调试方法
开发环境:myeclipse2014, jdk1.8.0.91,drools6.4.0.Final, drools-eclipse-plugin,mvel2-2.2.6.Final
问题描述:drl使用Java方言的设置断点调试没有问题,但是用mvel方言出现异常:
java.lang.RuntimeException: no debugger registered to handle breakpoint
at org.mvel2.debug.DebuggerContext.checkBreak(DebuggerContext.java:)
at org.mvel2.MVELRuntime.execute(MVELRuntime.java:)
at org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:)
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:)
at org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:)
at org.mvel2.MVEL.executeExpression(MVEL.java:)
at org.drools.core.util.MVELSafeHelper$RawMVELEvaluator.executeExpression(MVELSafeHelper.java:)
at org.drools.core.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:)
at org.drools.core.rule.constraint.MvelConditionEvaluator.evaluate(MvelConditionEvaluator.java:)
at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:)
at org.drools.core.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:)
at org.drools.core.reteoo.AlphaNode.assertObject(AlphaNode.java:)
at org.drools.core.reteoo.CompositeObjectSinkAdapter.doPropagateAssertObject(CompositeObjectSinkAdapter.java:)
at org.drools.core.reteoo.CompositeObjectSinkAdapter.propagateAssertObject(CompositeObjectSinkAdapter.java:)
at org.drools.core.reteoo.ObjectTypeNode.propagateAssert(ObjectTypeNode.java:)
at org.drools.core.phreak.PropagationEntry$Insert.execute(PropagationEntry.java:)
at org.drools.core.phreak.SynchronizedPropagationList.flush(SynchronizedPropagationList.java:)
at org.drools.core.phreak.SynchronizedPropagationList.flush(SynchronizedPropagationList.java:)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.flushPropagations(StatefulKnowledgeSessionImpl.java:)
at org.drools.core.common.DefaultAgenda.fireAllRules(DefaultAgenda.java:)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.internalFireAllRules(StatefulKnowledgeSessionImpl.java:)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:)
at org.drools.core.impl.StatefulKnowledgeSessionImpl.fireAllRules(StatefulKnowledgeSessionImpl.java:)
at org.drools.impl.adapters.StatefulKnowledgeSessionAdapter.fireAllRules(StatefulKnowledgeSessionAdapter.java:)
at step1.TestFibonacci.main(TestFibonacci.java:)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.junit.runners.model.FrameworkMethod$.runReflectiveCall(FrameworkMethod.java:)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:)
at org.junit.runners.ParentRunner$.run(ParentRunner.java:)
at org.junit.runners.ParentRunner$.schedule(ParentRunner.java:)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:)
at org.junit.runners.ParentRunner.access$(ParentRunner.java:)
at org.junit.runners.ParentRunner$.evaluate(ParentRunner.java:)
at org.junit.runners.ParentRunner.run(ParentRunner.java:)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:)
使用“no debugger registered to handle breakpoint”作为关键字google,有两篇提出同样问题的,但是没有答案,后陆续变换关键字,终于找到一篇神贴:
http://www.programcreek.com/java-api-examples/index.php?api=org.mvel2.debug.Debugger
关键在这段:
final List<String> knownVariables = new ArrayList<String>();
MVELRuntime.resetDebugger();
MVELDebugHandler.setDebugMode(true);
MVELRuntime.setThreadDebugger(new Debugger() {
public int onBreak(Frame frame) {
System.out.println("onBreak");
for (String var: frame.getFactory().getKnownVariables()) {
System.out.println(" " + var);
knownVariables.add(var);
}
return ;
}
});
MVELRuntime.setThreadDebugger将Debugger赋值,单元测试就能实现断点调试了。
Drools mvel方言drl断点调试方法的更多相关文章
- MyEclipse断点调试方法
MyEclipse断点调试方法 最基本的操作是: 1, 首先在一个java文件中设断点,然后运行,当程序走到断点处就会转到debug视图下, 2, F5键与F6键均为单步调试,F5是step into ...
- Eclipse断点调试方法
1. 条件断点 断点大家都比较熟悉,在Eclipse Java 编辑区的行头双击就会得到一个断点,代码会运行到此处时停止. 条件断点,顾名思义就是一个有一定条件的断点,只有满足了用户设置的条件,代码才 ...
- 不依赖浏览器控制台的JavaScript断点调试方法
随着浏览器的逐渐强大,绝大多数情况下的代码调试都是可以通过浏览器自带的一些调试工具进行解决.然而对于一些特殊情况仍然无法享受到浏览器的强大 调试能力,比如QQ客户端内嵌web的调试(虽然说QQ目前已经 ...
- c语音 dll断点调试方法
转自:https://blog.csdn.net/qingzai_/article/details/45348613 dll调试方法: 1.把最新生成的dll和pdb放到 启动这个dll 的进程目录下 ...
- vscode中php断点调试方法!
一.PHP的代码断点调试 1.打开vscode的首选项设置,添加"php.validate.executablePath": "D:\\newXampp\\php\\ph ...
- eclipse 断点调试方法
1 Debug视图 1.1 线程堆栈视图 线程堆栈视图表示当前线程的堆栈,从中可以看出在运行哪些代码,并且整个调用过程,以及代码行号.分别介绍一下这几个按钮的含义.从左至右分别为: 1.表示当前实现继 ...
- [转]Pycharm 断点调试方法
转自: https://blog.csdn.net/u013088062/article/details/50216015
- 工具使用——MATLAB基本调试方法
作者:桂. 时间:2017-02-28 07:06:30 链接:http://www.cnblogs.com/xingshansi/articles/6477185.html 声明:转载请注明出处, ...
- MATLAB(1)——基本调试方法(Debug)
作者:桂. 时间:2017-02-28 07:06:30 链接:http://www.cnblogs.com/xingshansi/articles/6477185.html 声明:转载请注明出处, ...
随机推荐
- HSV与RGB颜色空间的转换
一.本质上,H的取值范围:0~360 S的取值范围:0~1 V的取值范围:0~255 但是,当图像为32F型的时候,各 ...
- JDBC中连接MySQL数据库
package qddx.JDBC; import java.sql.*; public class JDBC_Connection { static String driverName = &quo ...
- Binary Tree Preorder Traversal
Given a binary tree, return the preorder traversal of its nodes' values. For example:Given binary tr ...
- mysql 与 mycat集成读写分离
1,先说下同步数据库原理,其实很简单.就是在主库做数据库操作的时候,会生成一个本地日志,日志会在my.ini当中配置看图一,读库会实时去扫描日志,如果有更新就直接在读库执行. 这个是主库my.ini配 ...
- 如何将自己的windows设置为mysql服务器
1.安装mysql 服务器 2.创建超级用户,即 用户管理 mysql>use mysql; 查看 mysql> select host,user,password from user ; ...
- PostgreSQL的权限查询
查看哪些用户对表sns_log_member_b_aciton有哪些权限: sns_log=> \z sns_log_member_b_aciton Access privileges Sche ...
- VS中Debug和Realease、及静态库和动态库的区别整理(转)
原文出自:http://www.cnblogs.com/chensu/p/5632486.html 一.Debug和Realease区别产生的原因 Debug 通常称为调试版本,它包含调试信息,并且不 ...
- PHP foreach使用
<?php $arr = array("1"=>"100","2"=>"200","3&qu ...
- Buffalo最佳实践
本文将介绍Buffalo AJAX的两种配置的最佳实践,这个AJAX框架还是中国大师开发的,用起来估计是最方便.最简单的一个 准备工作:官网下载buffalo-2.0-bin,也可以下载buffalo ...
- Nginx快速入门菜鸟笔记
Nginx快速入门-菜鸟笔记 1.编译安装nginx 编译安装nginx 必须先安装pcre库. (1)uname -a 确定环境 Linux localhost.localdomain 2.6. ...