|
#1
|
|||
|
|||
|
Hi,
Sometimes I dont't get notifications about failed DSRequests. Here is an example: I. The client is sending the DSRequest like this: Code:
form.submit(saveReturned, new DSRequest() {{
setOperationId("registerUser");
}});
II. The client sends this request: Code:
{
"dataSource":"app_users_auto",
"operationType":"add",
"operationId":"registerUser",
"componentId":"isc_DynamicForm_0",
"data":{
"USER_LOGIN":"cs2",
"USER_NAME":"Cs 3 ",
"USER_EMAIL":"cs3@a.com"
},
"callback":{
"target":[DynamicForm ID:isc_DynamicForm_0],
"methodName":"saveEditorReply"
},
"showPrompt":true,
"prompt":"Saving form...",
"oldValues":{
},
"clientContext":{
},
"requestId":"app_users_auto$6272"
}
Code:
return new DSResponse(DSResponse.STATUS_FAILURE); Code:
[
{
queueStatus:-1,
isDSResponse:true,
invalidateCache:false,
status:-1,
data:null
}
]
Code:
14:53:18.266:XRP1:WARN:RPCManager:Error performing operation: 'registerUser': error: FAILURE, response: {operationId: "registerUser",
clientContext: Obj,
context: Obj,
transactionNum: 5,
httpResponseCode: 200,
httpResponseText: "//isc_RPCResponseStart-->[{queueStatus:-..."[123],
xmlHttpRequest: [object XMLHttpRequest],
transport: "xmlHttpRequest",
status: -1,
clientOnly: undef,
httpHeaders: Obj,
isStructured: true,
callbackArgs: null,
results: Obj,
queueStatus: -1,
isDSResponse: true,
invalidateCache: false,
data: null,
startRow: 0,
endRow: 0,
totalRows: 0}
* * * If I understand this right, I can choose from two error handling modes: - By default, the central framework will handle errors. This means that in case of errors, RPCManager is supposed to show an error message for me, and my DSCallback is not called. This works fine when there is an error message, but when there is none (like in the example), it just swallows the error. - The other option is to specify willHandleError="true" on my request. In this case I will get no error message, but my DSCallback will be called in case of errors, too. This option works fine. So, to wrap this up, the problem here seems to be the RPCManager does not show any error message when there is no message returned with the failed DSResponse. Is that intended? Thank you for your help: Csillag |
|
#2
|
|||
|
|||
|
We'll go ahead and add a generic error message for completeness, however, recommended practice is to always include an error message. Otherwise the user is going to see something useless like "Unknown error with code -1".
|
|
#3
|
|||
|
|||
|
Quote:
Quote:
Quote:
Thank you for your help: Csillag |
|
#4
|
|||
|
|||
|
This change has now been made - you should see it in the next nightly build.
|
|
#5
|
|||
|
|||
|
Yes, I've tested with the nightly build from 02.23, and it's now working correctly.
Thank you. Csillag |
|
#6
|
|||
|
|||
|
Quote:
I have an operation binding which contains a CustomSQL tag. The SQL code is calling a stored procedure. If the stored procedure does not generate any output, then I get this on the server side: Code:
=== 2011-02-26 23:05:49,575 [0-22] WARN RequestContext - dsRequest.execute() failed: java.lang.NullPointerException at com.mysql.jdbc.ResultSetImpl.getRow(ResultSetImpl.java:5291) at org.apache.commons.dbcp.DelegatingResultSet.getRow(DelegatingResultSet.java:332) at com.isomorphic.sql.SQLTransform.toListOfMapsOrBeans(SQLTransform.java:486) at com.isomorphic.sql.SQLTransform.toListOfMapsOrBeans(SQLTransform.java:397) at com.isomorphic.sql.SQLDriver.getTransformedResults(SQLDriver.java:310) at com.isomorphic.sql.SQLDriver.executeQuery(SQLDriver.java:551) at com.isomorphic.sql.SQLDataSource.executeNativeQuery(SQLDataSource.java:376) at com.isomorphic.sql.SQLDataSource.executeNativeQuery(SQLDataSource.java:371) at com.isomorphic.sql.SQLDataSource.SQLExecute(SQLDataSource.java:1289) at com.isomorphic.sql.SQLDataSource.processRequest(SQLDataSource.java:280) at com.isomorphic.sql.SQLDataSource.executeCustom(SQLDataSource.java:240) at com.isomorphic.datasource.DataSource.execute(DataSource.java:1083) at com.isomorphic.application.AppBase.executeDefaultDSOperation(AppBase.java:721) at com.isomorphic.application.AppBase.executeAppOperation(AppBase.java:658) at com.isomorphic.application.AppBase.execute(AppBase.java:491) at com.isomorphic.datasource.DSRequest.execute(DSRequest.java:1465) at com.isomorphic.servlet.IDACall.handleDSRequest(IDACall.java:173) at com.isomorphic.servlet.IDACall.processRPCTransaction(IDACall.java:130) at com.nolmecolindor.sgweet.server.auth.SecureIDACall.processRequest(SecureIDACall.java:27) at com.isomorphic.servlet.IDACall.doPost(IDACall.java:54) at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) at com.isomorphic.servlet.BaseServlet.service(BaseServlet.java:152) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488) Code:
[
{
queueStatus:-1,
isDSResponse:true,
invalidateCache:false,
status:-1,
data:null
}
]
However, I think SmartGWT could capture the NPE from JDBC, and return (to the client side) with an error message (something like "Database operation failed"). Thank you: Csillag |
|
#7
|
|||
|
|||
|
We're returning exception.getMessage() (which appears to be null here).
For now at least, it's up to MySQL to provide better error reporting here. One day we may push our exception handling closer to the source so we can add context where a bug in third-party code doesn't, but this has very little value: the exception is already well-reported in the log and the end user is unlikely to be able to do much with a database error vs general error (and again, this is only due to a MySQL bug - they *would* be able to tell the difference if MySQL reported it properly). |
|
#8
|
|||
|
|||
|
Quote:
Thank you again: Csillag |
![]() |
| Thread Tools | Search this Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| WARN Validation - Validation errors validating a 'DataSource' | jay.l.fisher | Smart GWT Technical Q&A | 0 | 21st Jan 2011 05:36 |
| listgrid fetchdata doesn't populate grid when there are errors in dsresponse | mathias | Smart GWT Technical Q&A | 1 | 29th Dec 2010 15:10 |
| ListGrid errors subsequent row errors don't display. | sirhallt | Smart GWT Technical Q&A | 3 | 17th Nov 2010 16:45 |
| Criteria missing from one DSRequest but not the next? | jay.l.fisher | Smart GWT Technical Q&A | 2 | 6th Jul 2010 16:29 |
| RPCManager - java.lang.Exception: Response has already been committed | jwpartners | Technical Q&A | 17 | 13th Dec 2009 08:26 |