|
我在baas的private sql字段写了以下语句:SELECT fBuild FROM view_build WHERE fVillage=:village ORDER BY fBuild ASC
在前端页面使用以下代码调用相应的baas:
Model.prototype.baasData3BeforeRefresh = function(event){
var param123 = this.getElementByXid("select1234").value;
debugger;
var data = event.source;
if(param123!==""){
data.filters.setVar("village", param123);
}
};
跟踪到后台CRUD.java,发现执行了语句JSONObject variables = getVariables(params);以后的结果和例子程序不一致。例子程序在此处可以看到Variables.map.table的内容,但是我的程序显示的是com.sun.jdi.InvocationException occurred invoking method.
在监视窗口看到的不同情况如下图。
例子程序正确的是这样的:
我的错误信息是这样的:
错误信息为:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Query was empty
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:400)
at com.mysql.jdbc.Util.getInstance(Util.java:383)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:980)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3847)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3783)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2447)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2594)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2545)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1901)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2002)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at com.justep.baas.data.DataUtils.getValueBySQL(DataUtils.java:171)
at com.justep.baas.action.CRUD.sqlQuery(CRUD.java:61)
at wygs.Housechoice_action__do.queryBuild(Housechoice_action__do.java:139)
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 com.justep.baas.action.Engine.execAction(Engine.java:82)
at com.justep.baas.action.Engine.execAction(Engine.java:69)
at com.justep.baas.servlet.BaasServlet.execService(BaasServlet.java:86)
at com.justep.baas.servlet.BaasServlet.service(BaasServlet.java:55)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:861)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:606)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Thread.java:745)
2016-09-07 14:43:31 Action[wygs/housechoice_action/queryBuild]执行失败,SQL执行失败,SQL:, params:[]
java.lang.reflect.InvocationTargetException
请问是什么原因?
|
-
-
|