Hi Lakshman, Thanks for the reply. But I do so the parser may parse the xml file without any error. Does it mean that the spark engine will be executing the spark query correctly?
Thanks, Sajith. On 19 May 2017 at 12:13, Lakshman Udayakantha <lakshm...@wso2.com> wrote: > Hi Sajith, > > I suspect that It is because of greater than sign and lesser than sign in > insert queries. Did you try out using CDATA between those queries because > text between CDATA will be considered as text, not as tags. If that is the > case there should be a way to escaping those characters. > > Thanks, > Lakshman. > > On Fri, May 19, 2017 at 11:48 AM, Sajith Abeywardhana < > sabeywardh...@mitrai.com> wrote: > >> Hi DAS Team, >> >> I'm using wso2das-3.1.0 and here[1] is my spark script. When I bundle >> this script to a capp, and when I'm deploying that capp, the capp >> deployment fails. Error log printed as this[2]. >> I can deploy the capp if I build the capp without two insert queries in >> the script. But I can edit and save the script using carbon console with >> two insert scripts. Am I missing anything when I deploying the capp? >> >> >> >> [1] >> CREATE TEMPORARY TABLE device_update_notification USING >> org.wso2.carbon.analytics.spark.event.EventStreamProvider OPTIONS >> (receiverURL "tcp://localhost:7611", username "admin", password "admin", >> streamName "generated_notifications_stream", version "1.0.0", payload >> "bs_id string, alert string"); >> >> CREATE TEMPORARY TABLE sensor_data USING CarbonAnalytics OPTIONS >> (tableName "PROCESSED_GRAMPA_EVENTS_STREAM", >> schema "BS_ID STRING, PIR INT, A_T DOUBLE, SOUND INT, LIGHT INT, >> EVENT_TIME LONG, FROM_TIME LONG, TO_TIME LONG, _timestamp LONG"); >> >> INSERT OVERWRITE TABLE device_update_notification >> SELECT bs_id, alert FROM ( >> SELECT BS_ID AS bs_id, 'offline' as alert, MAX(_timestamp) as event_time >> FROM sensor_data >> GROUP BY BS_ID >> ) as max_time_table >> WHERE (unix_timestamp() - event_time) > 900; >> >> INSERT OVERWRITE TABLE device_update_notification >> SELECT bs_id, alert FROM ( >> SELECT BS_ID AS bs_id, 'connected' as alert, MAX(_timestamp) as >> event_time >> FROM sensor_data >> GROUP BY BS_ID >> ) as max_time_table >> WHERE (unix_timestamp() - event_time) < 900; >> >> >> [2] >> TID: [-1234] [] [2017-05-19 05:57:01,683] ERROR >> {org.wso2.carbon.analytics.spark.core.SparkScriptCAppDeployer} - Error >> while reading the analytics script : /mnt/wso2/wso2das-3.1.0/tmp/ca >> rbonapps/-1234/1495173421409kraydel-das-artifacts.car/device_update_spark_script >> _1.0.0/device_update_spark_script.xml {org.wso2.carbon.analytics.spa >> rk.core.SparkScriptCAppDeployer} >> javax.xml.bind.UnmarshalException >> - with linked exception: >> [org.xml.sax.SAXParseException: The content of elements must consist of >> well-formed character data or markup.] >> at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmars >> halException(AbstractUnmarshallerImpl.java:335) >> at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Unmarshall >> erImpl.createUnmarshalException(UnmarshallerImpl.java:563) >> at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Unmarshall >> erImpl.unmarshal0(UnmarshallerImpl.java:249) >> at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Unmarshall >> erImpl.unmarshal(UnmarshallerImpl.java:214) >> at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Ab >> stractUnmarshallerImpl.java:157) >> at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Ab >> stractUnmarshallerImpl.java:162) >> at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Ab >> stractUnmarshallerImpl.java:171) >> at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Ab >> stractUnmarshallerImpl.java:189) >> at org.wso2.carbon.analytics.spark.core.SparkScriptCAppDeployer >> .deploy(SparkScriptCAppDeployer.java:97) >> at org.wso2.carbon.analytics.spark.core.SparkScriptCAppDeployer >> .deployArtifacts(SparkScriptCAppDeployer.java:76) >> at org.wso2.carbon.application.deployer.internal.ApplicationMan >> ager.deployCarbonApp(ApplicationManager.java:263) >> at org.wso2.carbon.application.deployer.CappAxis2Deployer.deplo >> y(CappAxis2Deployer.java:72) >> at org.apache.axis2.deployment.repository.util.DeploymentFileDa >> ta.deploy(DeploymentFileData.java:136) >> at org.apache.axis2.deployment.DeploymentEngine.doDeploy(Deploy >> mentEngine.java:807) >> at org.apache.axis2.deployment.repository.util.WSInfoList.updat >> e(WSInfoList.java:144) >> at org.apache.axis2.deployment.RepositoryListener.update(Reposi >> toryListener.java:377) >> at org.apache.axis2.deployment.RepositoryListener.checkServices >> (RepositoryListener.java:254) >> at org.apache.axis2.deployment.RepositoryListener.startListener >> (RepositoryListener.java:371) >> at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRep >> ository(SchedulerTask.java:59) >> at org.apache.axis2.deployment.scheduler.SchedulerTask.run(Sche >> dulerTask.java:67) >> at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTas >> k.runAxisDeployment(CarbonDeploymentSchedulerTask.java:93) >> at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTas >> k.run(CarbonDeploymentSchedulerTask.java:138) >> at java.util.concurrent.Executors$RunnableAdapter.call( >> Executors.java:511) >> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java: >> 308) >> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFu >> tureTask.access$301(ScheduledThreadPoolExecutor.java:180) >> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFu >> tureTask.run(ScheduledThreadPoolExecutor.java:294) >> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool >> Executor.java:1142) >> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo >> lExecutor.java:617) >> at java.lang.Thread.run(Thread.java:745) >> Caused by: org.xml.sax.SAXParseException: The content of elements must >> consist of well-formed character data or markup. >> at >> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown >> Source) >> at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown >> Source) >> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown >> Source) >> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown >> Source) >> at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown >> Source) >> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$ >> FragmentContentDispatcher.dispatch(Unknown Source) >> at >> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown >> Source) >> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown >> Source) >> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown >> Source) >> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) >> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown >> Source) >> at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown >> Source) >> at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Unmarshall >> erImpl.unmarshal0(UnmarshallerImpl.java:243) >> ... 26 more >> TID: [-1234] [] [2017-05-19 05:57:01,684] ERROR >> {org.wso2.carbon.application.deployer.internal.ApplicationManager} - >> Error occurred while deploying Carbon Application >> {org.wso2.carbon.application.deployer.internal.ApplicationManager} >> org.wso2.carbon.analytics.spark.core.exception.SparkScriptDeploymentException: >> Error while reading the analytics script : /mnt/wso2/wso2das-3.1.0/tmp/ca >> rbonapps/-1234/1495173421409kraydel-das-artifacts.car/device_update_spark_script >> _1.0.0/device_update_spark_script.xml >> at org.wso2.carbon.analytics.spark.core.SparkScriptCAppDeployer >> .deploy(SparkScriptCAppDeployer.java:105) >> at org.wso2.carbon.analytics.spark.core.SparkScriptCAppDeployer >> .deployArtifacts(SparkScriptCAppDeployer.java:76) >> at org.wso2.carbon.application.deployer.internal.ApplicationMan >> ager.deployCarbonApp(ApplicationManager.java:263) >> at org.wso2.carbon.application.deployer.CappAxis2Deployer.deplo >> y(CappAxis2Deployer.java:72) >> at org.apache.axis2.deployment.repository.util.DeploymentFileDa >> ta.deploy(DeploymentFileData.java:136) >> at org.apache.axis2.deployment.DeploymentEngine.doDeploy(Deploy >> mentEngine.java:807) >> at org.apache.axis2.deployment.repository.util.WSInfoList.updat >> e(WSInfoList.java:144) >> at org.apache.axis2.deployment.RepositoryListener.update(Reposi >> toryListener.java:377) >> at org.apache.axis2.deployment.RepositoryListener.checkServices >> (RepositoryListener.java:254) >> at org.apache.axis2.deployment.RepositoryListener.startListener >> (RepositoryListener.java:371) >> at org.apache.axis2.deployment.scheduler.SchedulerTask.checkRep >> ository(SchedulerTask.java:59) >> at org.apache.axis2.deployment.scheduler.SchedulerTask.run(Sche >> dulerTask.java:67) >> at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTas >> k.runAxisDeployment(CarbonDeploymentSchedulerTask.java:93) >> at org.wso2.carbon.core.deployment.CarbonDeploymentSchedulerTas >> k.run(CarbonDeploymentSchedulerTask.java:138) >> at java.util.concurrent.Executors$RunnableAdapter.call( >> Executors.java:511) >> at java.util.concurrent.FutureTask.runAndReset(FutureTask.java: >> 308) >> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFu >> tureTask.access$301(ScheduledThreadPoolExecutor.java:180) >> at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFu >> tureTask.run(ScheduledThreadPoolExecutor.java:294) >> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPool >> Executor.java:1142) >> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoo >> lExecutor.java:617) >> at java.lang.Thread.run(Thread.java:745) >> Caused by: javax.xml.bind.UnmarshalException >> - with linked exception: >> [org.xml.sax.SAXParseException: The content of elements must consist of >> well-formed character data or markup.] >> at javax.xml.bind.helpers.AbstractUnmarshallerImpl.createUnmars >> halException(AbstractUnmarshallerImpl.java:335) >> at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Unmarshall >> erImpl.createUnmarshalException(UnmarshallerImpl.java:563) >> at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Unmarshall >> erImpl.unmarshal0(UnmarshallerImpl.java:249) >> at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Unmarshall >> erImpl.unmarshal(UnmarshallerImpl.java:214) >> at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Ab >> stractUnmarshallerImpl.java:157) >> at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Ab >> stractUnmarshallerImpl.java:162) >> at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Ab >> stractUnmarshallerImpl.java:171) >> at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(Ab >> stractUnmarshallerImpl.java:189) >> at org.wso2.carbon.analytics.spark.core.SparkScriptCAppDeployer >> .deploy(SparkScriptCAppDeployer.java:97) >> ... 20 more >> Caused by: org.xml.sax.SAXParseException: The content of elements must >> consist of well-formed character data or markup. >> at >> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown >> Source) >> at org.apache.xerces.util.ErrorHandlerWrapper.fatalError(Unknown >> Source) >> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown >> Source) >> at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown >> Source) >> at org.apache.xerces.impl.XMLScanner.reportFatalError(Unknown >> Source) >> at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$ >> FragmentContentDispatcher.dispatch(Unknown Source) >> at >> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown >> Source) >> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown >> Source) >> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown >> Source) >> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) >> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown >> Source) >> at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown >> Source) >> at com.sun.xml.internal.bind.v2.runtime.unmarshaller.Unmarshall >> erImpl.unmarshal0(UnmarshallerImpl.java:243) >> ... 26 more >> >> Thanks, >> Sajith. >> >> _______________________________________________ >> Dev mailing list >> Dev@wso2.org >> http://wso2.org/cgi-bin/mailman/listinfo/dev >> >> > > > -- > Lakshman Udayakantha > WSO2 Inc. www.wso2.com > lean.enterprise.middleware > Mobile: *0717429601* > >
_______________________________________________ Dev mailing list Dev@wso2.org http://wso2.org/cgi-bin/mailman/listinfo/dev