我的数据源在查询中需要?
,但这不是参数。
但是在使用?
的情况下,DSS会将NullPointerException作为错误消息返回。
我可以使用内部H2数据的简单sql查询重现错误。
查询:
select '?' as c1 from dual
结果在日志中:
DS Code: DATABASE_ERROR
Source Data Service:-
Name: ttttt
Location: \ttttt.dbs
Description: N/A
Default Namespace: http://ws.wso2.org/dataservice
Current Request Name: q1
Current Params: {}
Nested Exception:-
java.lang.NullPointerException
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.processPreNormalQuery(SQLQuery.java:832)
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.runPreQuery(SQLQuery.java:2301)
at org.wso2.carbon.dataservices.core.description.query.Query.execute(Query.java:275)
at org.wso2.carbon.dataservices.core.engine.CallQuery.executeElement(CallQuery.java:188)
at org.wso2.carbon.dataservices.core.engine.OutputElement.execute(OutputElement.java:89)
at org.wso2.carbon.dataservices.core.description.operation.Operation.execute(Operation.java:61)
at org.wso2.carbon.dataservices.core.engine.DataService.invoke(DataService.java:474)
at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.execute(DSOMDataSource.java:96)
... 43 more
Caused by: java.lang.NullPointerException
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.processDynamicQuery(SQLQuery.java:1395)
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.createProcessedPreparedStatement(SQLQuery.java:1506)
at org.wso2.carbon.dataservices.core.description.query.SQLQuery.processPreNormalQuery(SQLQuery.java:806)
... 50 more
也许有一些特殊的参数可以强制wso2dss不要自己解析查询并使用数据库引擎进行解析?