|
#261
|
|||
|
|||
|
SmartGWT: 2.4 (simple, I'm just a hobbist).
Google Chrome: 17.0.963.46 (the latest version) I have a ListGrid with custom DataSource (based on this topic). On loading the page with this grid - it tries to fetch data. It creates service, runs executeFetch and recieves an error. Caught: Code:
17:16:00.143 [INFO] [app] [ERROR] caught: com.google.gwt.user.client.rpc.StatusCodeException: 500 The call failed on the server; see server log for details Code:
17:16:00.029 [ERROR] [app] 17:16:00.027:WARN:RPCManager:Error performing rpcRequest: error: FAILURE, response: {__gwt_ObjectId: 893, clientContext: Obj, status: -1, context: undef, startRow: 0, endRow: 0, totalRows: 0}
com.smartgwt.client.core.JsObject$SGWT_WARN: 17:16:00.027:WARN:RPCManager:Error performing rpcRequest: error: FAILURE, response: {__gwt_ObjectId: 893, clientContext: Obj, status: -1, context: undef, startRow: 0, endRow: 0, totalRows: 0}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
at com.smartgwt.client.data.DataSource.processResponse(DataSource.java)
at ru.app.client.ui.data.datasources.ProjectInfoDS$1.onFailure(ProjectInfoDS.java:82)
at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:237)
at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
at sun.reflect.GeneratedMethodAccessor75.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
at java.lang.Thread.run(Unknown Source)
Tried to make it with gilead and without - doesn't matter. Simple RPC service (just recieve a String from server) works fine. "Extends", "implements", "web.xml", "appContext.xml" - are checked - everyting is done the same way as on simple (working) RPC service. I saw, that in code examples from this topic, response have the following style: response: Code:
{clientContext: Obj, status: -1, context: undef, startRow: 0, endRow: 0, totalRows: 0}
Code:
{__gwt_ObjectId: 893, clientContext: Obj, status: -1, context: undef, startRow: 0, endRow: 0, totalRows: 0}
Can it be a reason of my errors? How I can remove it from response? Update: I've tried to run dev mode on Firefox - it resolves __gwt_ObjectId problem, but the error remains the same :(: Code:
22:22:47.712 [ERROR] [app] 22:22:47.707:WARN:RPCManager:Error performing rpcRequest: error: FAILURE, response: {clientContext: Obj, status: -1, context: undef, startRow: 0, endRow: 0, totalRows: 0}
com.smartgwt.client.core.JsObject$SGWT_WARN: 22:22:47.707:WARN:RPCManager:Error performing rpcRequest: error: FAILURE, response: {clientContext: Obj, status: -1, context: undef, startRow: 0, endRow: 0, totalRows: 0}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:105)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeVoid(ModuleSpace.java:289)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeVoid(JavaScriptHost.java:107)
at com.smartgwt.client.data.DataSource.processResponse(DataSource.java)
at ru.app.client.ui.data.datasources.ProjectInfoDS$1.onFailure(ProjectInfoDS.java:82)
at com.google.gwt.user.client.rpc.impl.RequestCallbackAdapter.onResponseReceived(RequestCallbackAdapter.java:237)
at com.google.gwt.http.client.Request.fireOnResponseReceived(Request.java:287)
at com.google.gwt.http.client.RequestBuilder$1.onReadyStateChange(RequestBuilder.java:395)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForReturn(BrowserChannelServer.java:337)
at com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelServer.java:218)
at com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136)
at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:561)
at com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:269)
at com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:91)
at com.google.gwt.core.client.impl.Impl.apply(Impl.java)
at com.google.gwt.core.client.impl.Impl.entry0(Impl.java:213)
at sun.reflect.GeneratedMethodAccessor36.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)
at com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)
at com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172)
at com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServer.java:292)
at com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelServer.java:546)
at com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:363)
at java.lang.Thread.run(Unknown Source)
Last edited by Tasmit; 11th Feb 2012 at 09:27.. |
|
#262
|
|||
|
|||
|
Do not use google chrome for development, use firefox. Those strange ids are coming from google chrome in dev mode. In production it will be ok.
Br Marije |
|
#263
|
|||
|
|||
|
There were serialization problems due to Date's field (though it was java.util.Date, not java.sql.Date).
Has anybody bitblaster's filter's example? Files on rapidshare have been expired and deleted :(. I need to realize server-filtering via FilterBuilder on client-side and Hibernate on server-side, but a little bit confused with sending/transforming AdvancedCriterias. |
|
#264
|
|||
|
|||
|
Hi guys I search a lot but can't find a understandable solution till yet.
Problem i have a Hierarchical object with associations. Customer (firstname,lastname,age,gender ...) -- Adress (street,housno,postcode,city,)(one to many ) I have a CustomerDataSource that fetch all the data related to customer in one request. so I get one Object CustomerData. This object holdes many objects of Class Adress inside it. I donot want to use the nested Datasource for adress since i have the data. How do I use this to bind it to a ListGrid and Form. so user can create a Customer with many adresses. thanks in advance for a simple example. Best Regards |
|
#265
|
|||
|
|||
|
Has any body answers for the following question from earlierpost. a sample will be nice
Quote:
|
|
#266
|
|||
|
|||
|
This was an excellent example but I'm new to SmartGWT and am not sure how to implement a TreeGrid using your example. I would like to load on demand so when a folder is expanded I fetch the children at that time. I am able to successfully fetch the parent nodes but when I click to expand the folder I want to use a different datasource to fetch the children. I've tried looking at the information passed into the executeFetch() method to determine which parent node I"m on so I can fetch the children instead but apparently I"m not looking at the right variables. The parent nodes are "Manager" type nodes and the children nodes are "Training" nodes. So they aren't the same type of objects returned from the server.
I'm using SmartGWT 3.0 with FireFox 3.6.3 Basically what I've tried so far is as follows: Code:
onModuleLoad() {
DataSource dataSource = ManagerDS.getInstance();
TreeGrid treeGrid = new TreeGrid();
treeGrid.setLoadDataOnDemand(true);
treeGrid.setWidth(500);
treeGrid.setHeight(400);
treeGrid.setAutoFetchData(true);
treeGrid.setDataSource(datasource);
TreeGridField field = new TreeGridField("manager", "Managers");
treeGrid.setFields(field);
treeGrid.fetchData();
treeGrid.draw();
}
public class ManagerDS extends GwtRPTDataSource {
private static ManagerDS instance = null;
public static ManagerDS getInstance() {
if (instance == null) {
instance = new ManagerDS();
}
return instance;
}
public ManagerDS() {
DataSourceTextField username = new DataSourceTextField("username", "Username");
username.setPrimaryKey(true);
setFields(username);
}
@Override
protected void executeFetch(final String requestId, final DSRequest request, final DSResponse response) {
/// in this method I would like to determine which ManagerNode is selected
// or is the first time called and we are getting all managers. If a
// managerNode is selected and the tree is to be expanded I will call the
// TrainingService.class instead of the ManagerService.class so I can fetch //all the training classes this manager has taken
ManagerServiceAsync mgrService = GWT.create(ManagerService.class);
mgrService.fetch(new AsyncCallback<List<ManagerRecord>> () {
@Override
public void onSuccess(List<ManagerRecord> result) {
ListGridRecord[] list = new ListGridRecord[result.size()];
for (int i=0; i<list.length; i++) {
ListGridRecord record = new ListGridRecord();
copyValues(result.get(i), record);
list[i] = record;
}
response.setData(list);
processResponse(requestId, response);
}
@Override
public void onFailure(Throwable caught) {
}
}
private static Boolean copyValues(ListGridRecord from, ManagerRecord to) {
to.setUsername(from.getAttributeAsString("username");
}
private static Boolean copyValues(ManagerRecord from, ListGridRecord to) {
to.setAttribute("username", from.getUsername());
}
}
public class ManagerRecord {
private String username;
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
}
public class TrainingRecord {
private String trainingName;
public String getTrainingName() {
return trainingName;
}
public void setTrainingName(String trainingName) {
this.trainingName = trainingName;
}
}
|
|
#267
|
|||
|
|||
|
Since you're new, please note that we now strongly recommend against using GWT-RPC, for reasons listed in the FAQ.
|
|
#268
|
|||
|
|||
|
Quote:
In my previous code example I modified the DataSource to add the parentId field. Yet when I try to get the attribute using the following code example nothing is returned for 'parentId'. On loadDataOnDemand how do I get the selected parent node's parentId passed into the executeFetch? Code:
the executeFetch(final String requestId, final DSRequest request, final DSResponse response) {
String parentId = request.getCriteria().getAttribute("parentId");
}
Code:
onModuleLoad() {
DataSource dataSource = ManagerDS.getInstance();
TreeGrid treeGrid = new TreeGrid();
treeGrid.setLoadDataOnDemand(true);
treeGrid.setWidth(500);
treeGrid.setHeight(400);
treeGrid.setAutoFetchData(true);
treeGrid.setDataSource(datasource);
TreeGridField field = new TreeGridField("manager", "Managers");
treeGrid.setFields(field);
treeGrid.fetchData();
treeGrid.draw();
}
public class ManagerDS extends GwtRPTDataSource {
private static ManagerDS instance = null;
public static ManagerDS getInstance() {
if (instance == null) {
instance = new ManagerDS();
}
return instance;
}
public ManagerDS() {
DataSourceTextField username = new DataSourceTextField("username", "Username");
username.setPrimaryKey(true);
addField(username);
DataSourceIntegerField id = new DataSourceIntegerField("parentId", "parentId");
parentIdField.setRequired(true);
parentIdField.setHidden(true);
addField(parentIdField);
}
@Override
protected void executeFetch(final String requestId, final DSRequest request, final DSResponse response) {
/// in this method I would like to determine which ManagerNode is selected
// or is the first time called and we are getting all managers. If a
// managerNode is selected and the tree is to be expanded I will call the
// TrainingService.class instead of the ManagerService.class so I can fetch //all the training classes this manager has taken
// I get null for parentId below
String parentId = request.getCriteria().getAttribute("parentId");
ManagerServiceAsync mgrService = GWT.create(ManagerService.class);
mgrService.fetch(new AsyncCallback<List<ManagerRecord>> () {
@Override
public void onSuccess(List<ManagerRecord> result) {
ListGridRecord[] list = new ListGridRecord[result.size()];
for (int i=0; i<list.length; i++) {
ListGridRecord record = new ListGridRecord();
copyValues(result.get(i), record);
list[i] = record;
}
response.setData(list);
processResponse(requestId, response);
}
@Override
public void onFailure(Throwable caught) {
}
}
private static Boolean copyValues(ListGridRecord from, ManagerRecord to) {
to.setUsername(from.getAttributeAsString("username");
to.setId(from.getAttributeAsInt("parentId");
}
private static Boolean copyValues(ManagerRecord from, ListGridRecord to) {
to.setAttribute("username", from.getUsername());
to.setAttribute("parentId", from.getId());
}
}
|
|
#269
|
|||
|
|||
|
Quote:
[Code] onModuleLoad() { DataSource dataSource = new DataSource() { @Override protected Object transformRequest(DSRequest dsRequest) { Criteria criteria = dsRequest.getCriteria(); String parentId = criteria.getAttribute("parentId"); Window.alert("parentId="+parentId); } } DataSourceTextField username = new DataSourceTextField("username", "Username"); username.setPrimaryKey(true); DataSourceIntegerField id = new DataSourceIntegerField("parentId", "parentId"); parentIdField.setRequired(true); parentIdField.setHidden(true); dataSource.setFields(username, id); dataSource.setDataURL("/context/my.jsp"); dataSource.setDataFormat(DSDataFormat.JSON); TreeGrid treeGrid = new TreeGrid(); treeGrid.setLoadDataOnDemand(true); treeGrid.setWidth(500); treeGrid.setHeight(400); treeGrid.setAutoFetchData(true); treeGrid.setDataSource(datasource); TreeGridField field = new TreeGridField("manager", "Managers"); treeGrid.setFields(field); treeGrid.fetchData(); treeGrid.draw(); } |
|
#270
|
|||
|
|||
|
Read the Tree Databinding overview - one obvious problem is that you have no foreignKey declaration at all.
|