MATCH RECOGNIZE Query
842489Mar 8 2011 — edited Apr 6 2011Hello,
I am trying to run a MATCH RECOGNIZE query on the engine, but kept getting the following error:
<Mar 8, 2011 11:30:17 AM CET> <Error> <CQLProcessor> <BEA-000000> <CQLProcessor internal error for DDL [alter query ResultConst start] = null
java.sql.SQLException
at oracle.cep.jdbc.CEPStatement.evaluateAndSend(CEPStatement.java:322)
at oracle.cep.jdbc.CEPStatement.executeUpdate(CEPStatement.java:301)
at com.oracle.cep.processor.cql.impl.CEPServerInstance.executeDDL(CEPServerInstance.java:256)
at com.oracle.cep.processor.cql.impl.CQLProcessorImpl.executeDDL(CQLProcessorImpl.java:3027)
at com.oracle.cep.processor.cql.impl.CQLQuery.start(CQLQuery.java:48)
at com.oracle.cep.processor.cql.impl.CQLProcessorImpl.activateRules(CQLProcessorImpl.java:810)
at com.oracle.cep.processor.cql.impl.CQLProcessorImpl.activate(CQLProcessorImpl.java:870)
at com.oracle.cep.processor.cql.impl.CQLProcessorImpl.afterConfigurationActive(CQLProcessorImpl.java:2549)
at com.bea.wlevs.spring.ActivationBeanPostProcessor.postProcessAfterContextInitialization(ActivationBeanPostProcessor.java:20)
at com.bea.wlevs.spring.DeferredBeanPostProcessor.afterConfigurationActive(DeferredBeanPostProcessor.java:27)
at com.bea.wlevs.spring.ApplicationContextLifecycle.onApplicationEvent(ApplicationContextLifecycle.java:112)
at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:136)
at org.springframework.scheduling.commonj.DelegatingWork.run(DelegatingWork.java:61)
at weblogic.work.commonj.CommonjWorkManagerImpl$WorkWithListener.run(CommonjWorkManagerImpl.java:203)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
Caused By: java.lang.NullPointerException
at oracle.cep.planmgr.codegen.StreamSourceFactory.setupExecOpt(StreamSourceFactory.java:201)
at oracle.cep.planmgr.codegen.ExecOptFactory.instantiate(ExecOptFactory.java:198)
at oracle.cep.planmgr.codegen.OptInst.instOp(OptInst.java:128)
at oracle.cep.planmgr.codegen.CodeGenHelper.instantiate(CodeGenHelper.java:91)
at oracle.cep.planmgr.PlanManager.instantiate(PlanManager.java:1062)
at oracle.cep.metadata.QueryManager.instantiate(QueryManager.java:840)
at oracle.cep.metadata.QueryManager.startQuery(QueryManager.java:476)
at oracle.cep.metadata.QueryManager.startNamedQuery(QueryManager.java:268)
at oracle.cep.server.CommandDriver.QueryRefNodeDriver.execute(QueryRefNodeDriver.java:55)
at oracle.cep.server.CommandInterpreter.execute(CommandInterpreter.java:264)
at oracle.cep.server.CEPServer.executeDDL(CEPServer.java:186)
at oracle.cep.jdbc.CEPStatement.evaluateAndSend(CEPStatement.java:319)
at oracle.cep.jdbc.CEPStatement.executeUpdate(CEPStatement.java:301)
at com.oracle.cep.processor.cql.impl.CEPServerInstance.executeDDL(CEPServerInstance.java:256)
at com.oracle.cep.processor.cql.impl.CQLProcessorImpl.executeDDL(CQLProcessorImpl.java:3027)
at com.oracle.cep.processor.cql.impl.CQLQuery.start(CQLQuery.java:48)
at com.oracle.cep.processor.cql.impl.CQLProcessorImpl.activateRules(CQLProcessorImpl.java:810)
at com.oracle.cep.processor.cql.impl.CQLProcessorImpl.activate(CQLProcessorImpl.java:870)
at com.oracle.cep.processor.cql.impl.CQLProcessorImpl.afterConfigurationActive(CQLProcessorImpl.java:2549)
at com.bea.wlevs.spring.ActivationBeanPostProcessor.postProcessAfterContextInitialization(ActivationBeanPostProcessor.java:20)
at com.bea.wlevs.spring.DeferredBeanPostProcessor.afterConfigurationActive(DeferredBeanPostProcessor.java:27)
at com.bea.wlevs.spring.ApplicationContextLifecycle.onApplicationEvent(ApplicationContextLifecycle.java:112)
at org.springframework.context.event.SimpleApplicationEventMulticaster$1.run(SimpleApplicationEventMulticaster.java:78)
at org.springframework.core.task.SyncTaskExecutor.execute(SyncTaskExecutor.java:49)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:76)
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:274)
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:736)
at org.springframework.osgi.context.support.AbstractOsgiBundleApplicationContext.finishRefresh(AbstractOsgiBundleApplicationContext.java:235)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$4.run(AbstractDelegatedExecutionApplicationContext.java:358)
at org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.completeRefresh(AbstractDelegatedExecutionApplicationContext.java:320)
at org.springframework.osgi.extender.internal.dependencies.startup.DependencyWaiterApplicationContextExecutor$CompleteRefreshTask.run(DependencyWaiterApplicationContextExecutor.java:136)
at org.springframework.scheduling.commonj.DelegatingWork.run(DelegatingWork.java:61)
at weblogic.work.commonj.CommonjWorkManagerImpl$WorkWithListener.run(CommonjWorkManagerImpl.java:203)
at weblogic.work.SelfTuningWorkManagerImpl$WorkAdapterImpl.run(SelfTuningWorkManagerImpl.java:528)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
>
<Mar 8, 2011 11:30:17 AM CET> <Error> <Deployment> <BEA-2045016> <The application context "test_cep" could not be started. Could not initialize component "<unknown>": CQLProcessor internal error for DDL [alter query ResultConst start] = null>
Query and the configuration files are as follows:
Query:
<?xml version="1.0" encoding="UTF-8"?>
<n1:config xmlns:n1="http://www.bea.com/ns/wlevs/config/application">
<processor>
<name>AggrOverWindow</name>
<rules>
<query id="ResultConst"><![CDATA[
SELECT itemId AS SumPrice
FROM StreamS MATCH_RECOGNIZE (
MEASURES A.lastPrice as itemId
PATTERN (A B)
DEFINE
A AS (A.lastPrice >= 25),
B AS (B.lastPrice >= 25)
) as its
]]></query>
</rules>
</processor>
</n1:config>
-------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:osgi="http://www.springframework.org/schema/osgi"
xmlns:wlevs="http://www.bea.com/ns/wlevs/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/osgi
http://www.springframework.org/schema/osgi/spring-osgi.xsd
http://www.bea.com/ns/wlevs/spring
http://www.bea.com/ns/wlevs/spring/spring-wlevs-v11_1_1_3.xsd">
<wlevs:event-type-repository>
<wlevs:event-type type-name="StockTick">
<wlevs:properties>
<wlevs:property name="myTime" type="long"/>
<wlevs:property name="lastPrice" type="double"/>
<wlevs:property name="symbol" type="char"/>
</wlevs:properties>
</wlevs:event-type>
<wlevs:event-type type-name="AggWindowEvent">
<wlevs:properties>
<wlevs:property name="SumPrice" type="double"/>
<wlevs:property name="maxTime" type="long"/>
<wlevs:property name="minTime" type="long"/>
</wlevs:properties>
</wlevs:event-type>
</wlevs:event-type-repository>
<!-- Assemble EPN (event processing network) -->
<wlevs:adapter id="csvReader" provider="csvgen">
<wlevs:instance-property name="port" value="9011"/>
<wlevs:instance-property name="eventTypeName" value="StockTick" />
<wlevs:instance-property name="eventPropertyNames" value="myTime,symbol,lastPrice" />
<wlevs:listener ref="StreamS"/>
</wlevs:adapter>
<wlevs:channel id="StreamS" event-type="StockTick">
<wlevs:listener ref="AggrOverWindow" />
<wlevs:application-timestamped>
<wlevs:expression>myTime*1000000000</wlevs:expression>
</wlevs:application-timestamped>
</wlevs:channel>
<wlevs:processor id="AggrOverWindow" provider="cql">
<wlevs:listener ref="AggrResult"/>
</wlevs:processor>
<wlevs:adapter id="PublishSummaryResults" provider="httppub"></wlevs:adapter>
<wlevs:channel id="AggrResult"
event-type="AggWindowEvent">
<wlevs:listener>
<bean class="com.oracle.cep.sample.fx.OutputBean" autowire="byName"/>
</wlevs:listener>
<wlevs:listener ref="PublishSummaryResults"/>
</wlevs:channel>
</beans>
-------------------------------------------------------------------------------------
What am I doing wrong?
Thanks