addPlugInSingleRowFunction中的问题将Esper版本从5.3升级到8.3

问题描述 投票:0回答:1

在我们现有的应用程序中,我们使用的是Esper版本5.3。我们添加了一些addPlugInSingleRowFunction()以便在EPL中使用它,如下所示-

最终配置cepConfiguration = new Configuration();cepConfiguration.addPlugInSingleRowFunction(“ toNumber”,Double.class.getName(),“ parseDouble”);cepConfiguration.addPlugInSingleRowFunction(“ toBoolean”,Boolean.class.getName(),“ parseBoolean”);

这在5.3版本中工作正常。

升级后的代码已根据Esper文档更改为上述8.3-

cepConfiguration.getCompiler()。addPlugInSingleRowFunction(“ toNumber”,Double.class.getName(),“ parseDouble”);cepConfiguration.getCompiler()。addPlugInSingleRowFunction(“ toBoolean”,Boolean.class.getName(),“ parseBoolean”);

但是一旦调用sendEventBean()方法将事件发送到运行时,我们每次都会看到以下异常。

令人惊讶的是,即使即将出现以下异常,事件也会根据运行时中存在的语句进行匹配。尽管我们不确定某些事件是否不匹配。

有人可以帮忙吗?

applog.cls=com.espertech.esper.common.internal.epl.expression.dot.core.ExprDotNodeForgeStaticMethodEval,applog.mthd=staticMethodEvalHandleInvocationException,applog.line=228,applog.msg=Invocation exception when invoking method 'parseDouble' of class 'java.lang.Double' passing parameters [null] for statement 'stmt-0': NullPointerException : null,exc.stack=java.lang.NullPointerException\n\tat sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1838)\n\tat sun.misc.FloatingDecimal.parseDouble(FloatingDecimal.java:110)\n\tat java.lang.Double.parseDouble(Double.java:538)\n\tat generated.StatementAIFactoryProvider_a4bd241445010f45474e4598e34521ca1b2836db_stmt450.m8(StatementAIFactoryProvider_a4bd241445010f45474e4598e34521ca1b2836db_stmt450.java:161)\n\tat generated.StatementAIFactoryProvider_a4bd241445010f45474e4598e34521ca1b2836db_stmt450$2.get(ANONYMOUS.java:148)\n\tat com.espertech.esper.runtime.internal.filtersvcimpl.FilterParamIndexEquals.matchEvent(FilterParamIndexEquals.java:32)\n\tat com.espertech.esper.runtime.internal.filtersvcimpl.FilterHandleSetNode.matchEvent(FilterHandleSetNode.java:100)\n\tat com.espertech.esper.runtime.internal.filtersvcimpl.EventTypeIndex.matchType(EventTypeIndex.java:178)\n\tat com.espertech.esper.runtime.internal.filtersvcimpl.EventTypeIndex.matchEvent(EventTypeIndex.java:124)\n\tat com.espertech.esper.runtime.internal.filtersvcimpl.FilterServiceBase.retryableMatchEvent(FilterServiceBase.java:179)\n\tat com.espertech.esper.runtime.internal.filtersvcimpl.FilterServiceBase.evaluateInternal(FilterServiceBase.java:96)\n\tat com.espertech.esper.runtime.internal.filtersvcimpl.FilterServiceLockCoarse.evaluate(FilterServiceLockCoarse.java:52)\n\tat com.espertech.esper.runtime.internal.kernel.service.EPEventServiceImpl.processMatches(EPEventServiceImpl.java:610)\n\tat com.espertech.esper.runtime.internal.kernel.service.EPEventServiceImpl.processWrappedEvent(EPEventServiceImpl.java:450)\n\tat com.espertech.esper.runtime.internal.kernel.thread.InboundUnitSendEvent.run(InboundUnitSendEvent.java:43)\n\tat java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)\n\tat java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)\n\tat java.lang.Thread.run(Thread.java:748)

java complex-event-processing esper
1个回答
0
投票

您可以打开编译器日志记录(config.getCompiler()。getLogging()。setEnableCode(true);),并确保您具有INFO级别的日志记录。您可以在第161行检查“ StatementAIFactoryProvider_a4bd241445010f45474e4598e34521ca1b2836db_stmt450.m8”以查看问题所在。听起来像是将空值传递给Double.parseDouble。但是由于我没有完整的代码,因此很难说。

© www.soinside.com 2019 - 2024. All rights reserved.