Description:
Following is thrown sometimes (SP-M14)
[2017-11-02 00:32:23,889] INFO {org.wso2.carbon.transport.http.netty.listener.ServerConnectorController} - HTTP Listener stopped on listening interface http attached to host 0.0.0.0 and port 9763
[2017-11-02 00:32:23,891] INFO {org.wso2.extension.siddhi.io.http.source.HttpConnectorRegistry} - Server connector for port '9763' has successfully shutdown.
[2017-11-02 00:32:23,891] INFO {com.zaxxer.hikari.pool.HikariPool} - HikariPool-6 - is closing down.
[2017-11-02 00:32:23,902] INFO {org.wso2.carbon.siddhi.editor.core.internal.WorkspaceDeployer} - Siddhi App Sweet-Factory-Analytics successfully deployed.
^Csuho@Suhos-MacBook-Pro:~/wso2/demo/wso2con2017EU/v2/wso2sp-4.0.0-M16-SNAPSHOT$ [2017-11-02 00:32:25,438] INFO {org.wso2.extension.siddhi.io.jms.internal.ServiceComponent} - Service Component is deactivated
[2017-11-02 00:32:25,461] INFO {org.wso2.carbon.siddhi.editor.core.internal.ServiceComponent} - Service Component is deactivated
[2017-11-02 00:32:25,466] INFO {org.wso2.carbon.stream.processor.core.internal.ServiceComponent} - Service Component is deactivated
[2017-11-02 00:32:25,474] ERROR {org.wso2.carbon.stream.processor.core} - [SCR] Error while attempting to deactivate instance of component Component[
name = stream-processor-core-service
activate = start
deactivate = stop
modified =
configuration-policy = optional
factory = null
autoenable = true
immediate = true
implementation = org.wso2.carbon.stream.processor.core.internal.ServiceComponent
state = Unsatisfied
properties =
serviceFactory = false
serviceInterface = null
references = {
Reference[name = carbon.config.provider, interface = org.wso2.carbon.config.provider.ConfigProvider, policy = dynamic, cardinality = 1..1, target = null, bind = registerConfigProvider, unbind = unregisterConfigProvider]
Reference[name = carbon.runtime.service, interface = org.wso2.carbon.kernel.CarbonRuntime, policy = dynamic, cardinality = 1..1, target = null, bind = setCarbonRuntime, unbind = unsetCarbonRuntime]
Reference[name = org.wso2.carbon.cluster.coordinator.service.ClusterCoordinator, interface = org.wso2.carbon.cluster.coordinator.service.ClusterCoordinator, policy = dynamic, cardinality = 0..1, target = null, bind = registerClusterCoordinator, unbind = unregisterClusterCoordinator]
Reference[name = org.wso2.carbon.datasource.DataSourceService, interface = org.wso2.carbon.datasource.core.api.DataSourceService, policy = dynamic, cardinality = 1..1, target = null, bind = registerDataSourceListener, unbind = unregisterDataSourceListener]
Reference[name = siddhi.component.activator.service, interface = org.wso2.siddhi.core.util.SiddhiComponentActivator, policy = dynamic, cardinality = 1..1, target = null, bind = setSiddhiComponentActivator, unbind = unsetSiddhiComponentActivator]
}
located in bundle = org.wso2.carbon.stream.processor.core_2.0.107.SNAPSHOT [110]
] java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.equinox.internal.ds.model.ServiceComponent.deactivate(ServiceComponent.java:363)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.deactivate(ServiceComponentProp.java:161)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.dispose(ServiceComponentProp.java:387)
at org.eclipse.equinox.internal.ds.model.ServiceComponentProp.dispose(ServiceComponentProp.java:102)
at org.eclipse.equinox.internal.ds.InstanceProcess.disposeInstances(InstanceProcess.java:344)
at org.eclipse.equinox.internal.ds.InstanceProcess.disposeInstances(InstanceProcess.java:306)
at org.eclipse.equinox.internal.ds.Resolver.getEligible(Resolver.java:368)
at org.eclipse.equinox.internal.ds.SCRManager.serviceChanged(SCRManager.java:222)
at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)
at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:915)
at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:222)
at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.unregisterServices(ServiceRegistry.java:665)
at org.eclipse.osgi.internal.framework.BundleContextImpl.close(BundleContextImpl.java:96)
at org.eclipse.osgi.internal.framework.EquinoxBundle.stopWorker0(EquinoxBundle.java:948)
at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.stopWorker(EquinoxBundle.java:314)
at org.eclipse.osgi.container.Module.doStop(Module.java:636)
at org.eclipse.osgi.container.Module.stop(Module.java:498)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.decStartLevel(ModuleContainer.java:1661)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1580)
at org.eclipse.osgi.container.SystemModule.stopWorker(SystemModule.java:253)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.stopWorker(EquinoxBundle.java:147)
at org.eclipse.osgi.container.Module.doStop(Module.java:636)
at org.eclipse.osgi.container.Module.stop(Module.java:498)
at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:191)
at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:165)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.NullPointerException
at org.wso2.carbon.stream.processor.core.internal.ServiceComponent.stop(ServiceComponent.java:214)
... 34 more
[2017-11-02 00:32:25,501] INFO {org.wso2.carbon.event.simulator.core.api.SingleApi} - Single Event Simulator service component is deactivated
[2017-11-02 00:32:25,511] INFO {org.wso2.carbon.metrics.core.reporter.impl.AbstractReporter} - Stopped JMX reporter for Metrics
[2017-11-02 00:32:25,512] INFO {org.wso2.msf4j.analytics.metrics.MetricsComponent} - Metrics Component is deactivated
[2017-11-02 00:32:25,521] INFO {org.wso2.carbon.event.simulator.core.api.DatabaseApi} - Event Simulator database service component is deactivated
[2017-11-02 00:32:25,526] INFO {org.wso2.carbon.event.simulator.core.api.FeedApi} - Feed Event Simulator service component is deactivated
[2017-11-02 00:32:25,531] INFO {org.wso2.carbon.event.simulator.core.api.FilesApi} - Simulator service file component is deactivated
[2017-11-02 00:32:25,533] INFO {org.wso2.carbon.databridge.receiver.thrift.internal.ThriftDataReceiverDS} - Thrift server shutting down...
[2017-11-02 00:32:25,533] INFO {org.wso2.carbon.databridge.receiver.binary.internal.BinaryDataReceiverServiceComponent} - Binary Data Receiver server shutting down...
[2017-11-02 00:32:25,533] INFO {org.wso2.carbon.databridge.receiver.binary.internal.BinaryDataReceiver} - Stopping Binary Server..
The query in the editor (SP-M14)
@app:name('Sweet-Factory-Analytics')
@source(type = 'http', @Map(type = 'json' ))
--@sink(type ='log', level = 'info')
define stream RawMaterialStream(name string, amount double, factoryId int);
@source(type = 'http', @Map(type = 'json', @attributes(name = '$.item.id', amount = '$.item.amount', factoryId = '$.item.location')))
--@sink(type ='log', level = 'info')
define stream SweetProductionStream (name string, amount double, factoryId int);
--@sink(type ='log', level = 'info')
define stream LowProducitonAlertStream (factoryId int, hourlyTotal double, currentHour int);
@store(type="rdbms", jdbc.url="jdbc:mysql://localhost:3306/sp_samples",
username="root", password="root", jdbc.driver.name="com.mysql.jdbc.Driver")
define table ManagerInfoTable (factoryId int, name string, email string);
-- @sink(type ='email', to='{{email}}',
-- subject='Low Prod Alert at Factory {{factoryId}}',
-- @Map (type='text', @payload( """
-- Hi {{name}},
-- Production at Factory {{factoryId}} has gone below 5000!.
-- The current production level is {{hourlyTotal}}!
-- From Halloween Sweet Factory.""" )))
@sink(type='email', to='[email protected]', subject='Low Prod Alert at Factory {{factoryId}}',
--@sink(type ='log', level = 'info',
@Map (type='text', @payload( """
Hi {{name}},
Production at Factory {{factoryId}} has gone below 5000!.
The current production level is {{hourlyTotal}}!
From Halloween Sweet Factory.""" )))
define stream SLAAlertStream (factoryId int, name string, email string, hourlyTotal double, currentHour int);
@info(name='count-query')
from SweetProductionStream#window.time(1 min)
select factoryId, sum(amount) as hourlyTotal, time:extract(currentTimeMillis(), 'HOUR') as currentHour
group by factoryId
having hourlyTotal < 5000 and currentHour < 9 and currentHour < 17
output last every 5 sec
insert into LowProducitonAlertStream ;
from LowProducitonAlertStream as p join ManagerInfoTable as m
on p.factoryId == m.factoryId
select p.factoryId, m.name, m.email, p.hourlyTotal, p.currentHour
Insert into SLAAlertStream ;