wso2 / product-iots

Welcome to the WSO2 IoT Server source code! For info on working with the WSO2 IoT Server repository and contributing code, click the link below.
http://wso2.github.io/
Apache License 2.0
184 stars 181 forks source link

WSO2 IoT Server 3.1.0 : Error Mysql: SQL String can not be NULL #1410

Open progimax opened 7 years ago

progimax commented 7 years ago

Hello,

I have configured WSO2 IoT Server 3.1.0 to use Mysql:

https://docs.wso2.com/display/IoTS310/Changing+to+MySQL

Mysql version: 5.6.36

I have an error message:

TID: [-1234] [] [2017-09-15 11:15:00,068] ERROR {org.wso2.carbon.analytics.spark.core.sources.AnalyticsRelationProvider} -  Error while merging the schema for the table : IOT_PER_DEVICE_STREAM_ANDROID_SMS_STATS : Error in setting provided schema: Error in adding records: SQL String can not be NULL {org.wso2.carbon.analytics.spark.core.sources.AnalyticsRelationProvider}
org.wso2.carbon.analytics.spark.core.exception.AnalyticsExecutionException: Error in setting provided schema: Error in adding records: SQL String can not be NULL
    at org.wso2.carbon.analytics.spark.core.sources.AnalyticsRelationProvider.setSchemaIfProvided(AnalyticsRelationProvider.java:191)
    at org.wso2.carbon.analytics.spark.core.sources.AnalyticsRelationProvider.doTableActions(AnalyticsRelationProvider.java:92)
    at org.wso2.carbon.analytics.spark.core.sources.AnalyticsRelationProvider.createRelation(AnalyticsRelationProvider.java:77)
    at org.wso2.carbon.analytics.spark.core.sources.AnalyticsRelationProvider.createRelation(AnalyticsRelationProvider.java:45)
    at org.apache.spark.sql.execution.datasources.ResolvedDataSource$.apply(ResolvedDataSource.scala:158)
    at org.apache.spark.sql.execution.datasources.CreateTempTableUsing.run(ddl.scala:92)
    at org.apache.spark.sql.execution.ExecutedCommand.sideEffectResult$lzycompute(commands.scala:58)
    at org.apache.spark.sql.execution.ExecutedCommand.sideEffectResult(commands.scala:56)
    at org.apache.spark.sql.execution.ExecutedCommand.doExecute(commands.scala:70)
    at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:132)
    at org.apache.spark.sql.execution.SparkPlan$$anonfun$execute$5.apply(SparkPlan.scala:130)
    at org.apache.spark.rdd.RDDOperationScope$.withScope(RDDOperationScope.scala:150)
    at org.apache.spark.sql.execution.SparkPlan.execute(SparkPlan.scala:130)
    at org.apache.spark.sql.execution.QueryExecution.toRdd$lzycompute(QueryExecution.scala:55)
    at org.apache.spark.sql.execution.QueryExecution.toRdd(QueryExecution.scala:55)
    at org.apache.spark.sql.DataFrame.<init>(DataFrame.scala:145)
    at org.apache.spark.sql.DataFrame.<init>(DataFrame.scala:130)
    at org.apache.spark.sql.DataFrame$.apply(DataFrame.scala:52)
    at org.apache.spark.sql.SQLContext.sql(SQLContext.scala:817)
    at org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor.executeQueryLocal(SparkAnalyticsExecutor.java:768)
    at org.wso2.carbon.analytics.spark.core.internal.SparkAnalyticsExecutor.executeQuery(SparkAnalyticsExecutor.java:729)
    at org.wso2.carbon.analytics.spark.core.CarbonAnalyticsProcessorService.executeQuery(CarbonAnalyticsProcessorService.java:201)
    at org.wso2.carbon.analytics.spark.core.CarbonAnalyticsProcessorService.executeScript(CarbonAnalyticsProcessorService.java:151)
    at org.wso2.carbon.analytics.spark.core.AnalyticsTask.execute(AnalyticsTask.java:60)
    at org.wso2.carbon.ntask.core.impl.TaskQuartzJobAdapter.execute(TaskQuartzJobAdapter.java:67)
    at org.quartz.core.JobRunShell.run(JobRunShell.java:213)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)
Caused by: org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException: Error in adding records: SQL String can not be NULL
    at org.wso2.carbon.analytics.datasource.rdbms.RDBMSAnalyticsRecordStore.put(RDBMSAnalyticsRecordStore.java:152)
    at org.wso2.carbon.analytics.dataservice.core.AnalyticsDataServiceImpl.writeTableInfo(AnalyticsDataServiceImpl.java:512)
    at org.wso2.carbon.analytics.dataservice.core.AnalyticsDataServiceImpl.setTableSchemaFinal(AnalyticsDataServiceImpl.java:599)
    at org.wso2.carbon.analytics.dataservice.core.AnalyticsDataServiceImpl.setTableSchema(AnalyticsDataServiceImpl.java:588)
    at org.wso2.carbon.analytics.spark.core.sources.AnalyticsRelationProvider.setSchemaIfProvided(AnalyticsRelationProvider.java:186)
    ... 30 more
Caused by: java.sql.SQLException: SQL String can not be NULL
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:964)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:897)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:886)
    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:860)
    at com.mysql.jdbc.PreparedStatement.<init>(PreparedStatement.java:819)
    at com.mysql.jdbc.JDBC4PreparedStatement.<init>(JDBC4PreparedStatement.java:45)
    at com.mysql.jdbc.JDBC42PreparedStatement.<init>(JDBC42PreparedStatement.java:39)
    at sun.reflect.GeneratedConstructorAccessor78.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
    at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
    at com.mysql.jdbc.PreparedStatement.getInstance(PreparedStatement.java:761)
    at com.mysql.jdbc.ConnectionImpl.clientPrepareStatement(ConnectionImpl.java:1405)
    at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4137)
    at com.mysql.jdbc.ConnectionImpl.prepareStatement(ConnectionImpl.java:4040)
    at sun.reflect.GeneratedMethodAccessor31.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
    at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
    at org.wso2.carbon.ndatasource.rdbms.ConnectionRollbackOnReturnInterceptor.invoke(ConnectionRollbackOnReturnInterceptor.java:51)
    at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
    at org.apache.tomcat.jdbc.pool.interceptor.AbstractCreateStatementInterceptor.invoke(AbstractCreateStatementInterceptor.java:67)
    at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
    at org.apache.tomcat.jdbc.pool.interceptor.ConnectionState.invoke(ConnectionState.java:153)
    at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
    at org.apache.tomcat.jdbc.pool.TrapException.invoke(TrapException.java:41)
    at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:109)
    at org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:80)
    at com.sun.proxy.$Proxy18.prepareStatement(Unknown Source)
    at org.wso2.carbon.analytics.datasource.rdbms.RDBMSAnalyticsRecordStore.insertAndUpdateRecordsSimilarSequentially(RDBMSAnalyticsRecordStore.java:302)
    at org.wso2.carbon.analytics.datasource.rdbms.RDBMSAnalyticsRecordStore.insertAndUpdateRecordsSimilar(RDBMSAnalyticsRecordStore.java:290)
    at org.wso2.carbon.analytics.datasource.rdbms.RDBMSAnalyticsRecordStore.addRecordsSimilar(RDBMSAnalyticsRecordStore.java:174)
    at org.wso2.carbon.analytics.datasource.rdbms.RDBMSAnalyticsRecordStore.put(RDBMSAnalyticsRecordStore.java:147)
    ... 34 more

Thanks for your reply

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity.