I am getting an exception when upgrading from 5.0 to 5.1 using the exact code.
Entrypoint:
test.ds.xml:
TestDMI:
Correct logs using smartgwt 5.0p 5.0-p20150919: (The important part is bold)
Logs using 5.1-p20151218 (important part is bold)
As you see in the bold part of the logs, the InputStream is null when using the 5.1 library.
Entrypoint:
Code:
public void onModuleLoad() {
final VLayout vlayout = new VLayout();
IButton button = new IButton("go!");
button.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
DataSource.get("test")
.performCustomOperation("execute", new Record(),
new DSCallback() {
@Override
public void execute(
DSResponse dsResponse,
Object data, DSRequest dsRequest) {
SC.say("ok");
}
});
}
});
vlayout.addMember(button);
vlayout.draw();
}
Code:
<DataSource ID="test" serverType="sql" tableName="t_rel_schueler_eltern">
<fields>
<field name="f_id" type="sequence" primaryKey="true" />
</fields>
<operationBindings>
<operationBinding operationType="custom" operationId="execute">
<serverObject className="de.mks_infofabrik.kids.server.test.TestingDMI"
methodName="doExecute" />
</operationBinding>
</operationBindings>
</DataSource>
Code:
public DSResponse doExecute(DSRequest dsRequest) throws Exception {
DSRequest dynDatasourcesRequest = new DSRequest("dynDatasources",
DataSource.OP_FETCH);
Map<String, Object> criteria = new HashMap<>();
criteria.put("f_id", 1);
dynDatasourcesRequest.setCriteria(criteria);
InputStream datasourceInputStream = null;
try {
DSResponse dynDatasourcesResponse = dynDatasourcesRequest.execute();
datasourceInputStream = (InputStream) dynDatasourcesResponse.getDataMap().get("f_ds");
LOG.info("DataSource input stream: " + datasourceInputStream);
} catch (Exception e) {
e.printStackTrace();
return null;
}
return new DSResponse();
}
Code:
=== 2015-12-29 14:52:02,418 [c-12] DEBUG PoolableDataSourceFactory - Activated DataSource 586 of type 'test'
=== 2015-12-29 14:52:02,418 [c-12] DEBUG DSRequest - Caching instance 586 of DS 'test' from DSRequest.getDataSource()
=== 2015-12-29 14:52:02,418 [c-12] DEBUG DSRequest - Caching instance 586 of DS test
=== 2015-12-29 14:52:02,418 [c-12] DEBUG RPCManager - Request #1 (DSRequest) payload: {
values:{
},
operationConfig:{
dataSource:"test",
repo:null,
operationType:"custom",
textMatchStyle:"exact"
},
appID:"builtinApplication",
operation:"execute",
oldValues:{
},
criteria:{
}
}
=== 2015-12-29 14:52:02,418 [c-12] INFO IDACall - Key[type=com.isomorphic.servlet.IDACall, annotation=[none]] - Performing 1 operation(s)
=== 2015-12-29 14:52:02,418 [c-12] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
=== 2015-12-29 14:52:02,419 [c-12] DEBUG DeclarativeSecurity - DataSource test is not in the pre-checked list, processing...
=== 2015-12-29 14:52:02,423 [c-12] DEBUG ISCKeyedObjectPool - Borrowing object for 'dynDatasources'
=== 2015-12-29 14:52:02,424 [c-12] DEBUG PoolableDataSourceFactory - Created DataSource 590 of type 'dynDatasources' and assigned it to thread http-nio-8080-exec-12
=== 2015-12-29 14:52:02,424 [c-12] DEBUG PoolableDataSourceFactory - Created DataSource 590 of type 'dynDatasources' in the pooling flow
=== 2015-12-29 14:52:02,424 [c-12] DEBUG PoolableDataSourceFactory - Activated DataSource 590 of type 'dynDatasources'
=== 2015-12-29 14:52:02,424 [c-12] DEBUG DSRequest - Caching instance 590 of DS 'dynDatasources' from DSRequest.getDataSource()
=== 2015-12-29 14:52:02,424 [c-12] DEBUG DSRequest - Caching instance 590 of DS dynDatasources
=== 2015-12-29 14:52:02,424 [c-12] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
=== 2015-12-29 14:52:02,424 [c-12] DEBUG AppBase - [builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
=== 2015-12-29 14:52:02,424 [c-12] DEBUG AppBase - [builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
=== 2015-12-29 14:52:02,424 [c-12] INFO SQLDataSource - [builtinApplication.null] Performing fetch operation with
criteria: {f_id:1} values: {f_id:1}
=== 2015-12-29 14:52:02,425 [c-12] INFO SQLDataSource - [builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
=== 2015-12-29 14:52:02,425 [c-12] INFO SQLDataSource - [builtinApplication.null] 590: Executing SQL query on 'SQLSERVER': SELECT t_dyn_datasources.f_id, t_dyn_datasources.f_ds, t_dyn_datasources.f_ds_filename, t_dyn_datasources.f_ds_filesize, t_dyn_datasources.f_ds_date_created FROM t_dyn_datasources WHERE (t_dyn_datasources.f_id=1)
=== 2015-12-29 14:52:02,425 [c-12] DEBUG PoolableSQLConnectionFactory - [builtinApplication.null] Passing JDBC URL only to getConnection
=== 2015-12-29 14:52:02,439 [c-12] DEBUG PoolableSQLConnectionFactory - [builtinApplication.null] makeObject() created a pooled Connection '148278705'
=== 2015-12-29 14:52:02,439 [c-12] DEBUG SQLConnectionManager - [builtinApplication.null] Borrowed connection '148278705'
=== 2015-12-29 14:52:02,439 [c-12] DEBUG SQLDriver - [builtinApplication.null] About to execute SQL query in 'SQLSERVER' using connection '148278705'
=== 2015-12-29 14:52:02,439 [c-12] INFO SQLDriver - [builtinApplication.null] Executing SQL query on 'SQLSERVER': SELECT t_dyn_datasources.f_id, t_dyn_datasources.f_ds, t_dyn_datasources.f_ds_filename, t_dyn_datasources.f_ds_filesize, t_dyn_datasources.f_ds_date_created FROM t_dyn_datasources WHERE (t_dyn_datasources.f_id=1)
=== 2015-12-29 14:52:02,443 [c-12] INFO DSResponse - [builtinApplication.null] DSResponse: List with 1 items
=== 2015-12-29 14:52:02,443 [c-12] DEBUG DSRequest - freeOnExecute is false for request of type fetch on DataSource dynDatasources - not freeing resources!
[B]=== 2015-12-29 14:52:02,443 [c-12] INFO TestingDMI - DataSource input stream: java.io.ByteArrayInputStream@7bfff264[/B]
=== 2015-12-29 14:52:02,443 [c-12] DEBUG DSRequest - About to free up resources for request of type custom on DataSource test
=== 2015-12-29 14:52:02,443 [c-12] DEBUG DSRequest - Ignoring freeResources call because this is not a primary request!
=== 2015-12-29 14:52:02,443 [c-12] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
=== 2015-12-29 14:52:02,444 [c-12] DEBUG RPCManager - DMI response, dropExtraFields: false
=== 2015-12-29 14:52:02,445 [c-12] DEBUG DSRequest - Ignoring freeQueueResources call because this is not a primary request!
=== 2015-12-29 14:52:02,445 [c-12] INFO Compression - /kids-dev/V010403SNAPSHOT/sc/IDACall: 159 -> 142 bytes
Code:
=== 2015-12-29 15:00:44,065 [ec-7] DEBUG DSRequest - Caching instance 578 of DS 'test' from DSRequest.getDataSource()
=== 2015-12-29 15:00:44,065 [ec-7] DEBUG DSRequest - Caching instance 578 of DS test
=== 2015-12-29 15:00:44,065 [ec-7] DEBUG RPCManager - Request #1 (DSRequest) payload: {
values:{
},
operationConfig:{
dataSource:"test",
repo:null,
operationType:"custom",
textMatchStyle:"exact"
},
appID:"builtinApplication",
operation:"execute",
oldValues:{
},
criteria:{
}
}
=== 2015-12-29 15:00:44,066 [ec-7] INFO IDACall - Key[type=com.isomorphic.servlet.IDACall, annotation=[none]] - Performing 1 operation(s)
=== 2015-12-29 15:00:44,066 [ec-7] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
=== 2015-12-29 15:00:44,066 [ec-7] DEBUG DeclarativeSecurity - DataSource test is not in the pre-checked list, processing...
=== 2015-12-29 15:00:44,072 [ec-7] DEBUG ISCKeyedObjectPool - Borrowing object for 'dynDatasources'
=== 2015-12-29 15:00:44,073 [ec-7] DEBUG XML - Parsed XML from /Users/eduardo/Documents/git/kids/kids/target/kids-1.4.3-SNAPSHOT/ds/dynDatasources.ds.xml: 1ms
=== 2015-12-29 15:00:44,073 [ec-7] DEBUG ISCKeyedObjectPool - Borrowing object for 'DataSource'
=== 2015-12-29 15:00:44,073 [ec-7] DEBUG PoolableDataSourceFactory - Created DataSource 582 of type 'DataSource' and assigned it to thread http-nio-8080-exec-7
=== 2015-12-29 15:00:44,073 [ec-7] DEBUG PoolableDataSourceFactory - Created DataSource 582 of type 'DataSource' in the pooling flow
=== 2015-12-29 15:00:44,073 [ec-7] DEBUG PoolableDataSourceFactory - Activated DataSource 582 of type 'DataSource'
=== 2015-12-29 15:00:44,073 [ec-7] DEBUG ISCKeyedObjectPool - Borrowing object for 'DataSourceField'
=== 2015-12-29 15:00:44,074 [ec-7] DEBUG PoolableDataSourceFactory - Created DataSource 583 of type 'DataSourceField' and assigned it to thread http-nio-8080-exec-7
=== 2015-12-29 15:00:44,074 [ec-7] DEBUG PoolableDataSourceFactory - Created DataSource 583 of type 'DataSourceField' in the pooling flow
=== 2015-12-29 15:00:44,074 [ec-7] DEBUG PoolableDataSourceFactory - Activated DataSource 583 of type 'DataSourceField'
=== 2015-12-29 15:00:44,074 [ec-7] DEBUG ISCKeyedObjectPool - Borrowing object for 'field'
=== 2015-12-29 15:00:44,074 [ec-7] DEBUG PoolableDataSourceFactory - Tried to create DataSource of type 'field' but null was returned
=== 2015-12-29 15:00:44,074 [ec-7] DEBUG PoolableDataSourceFactory - Created DataSource null of type 'field' in the pooling flow
=== 2015-12-29 15:00:44,075 [ec-7] DEBUG SQLDataSource - DataSource 584 acquired SQLDriver instance 702829240 during initialization
=== 2015-12-29 15:00:44,075 [ec-7] DEBUG PoolableDataSourceFactory - Created DataSource 584 of type 'dynDatasources' and assigned it to thread http-nio-8080-exec-7
=== 2015-12-29 15:00:44,075 [ec-7] DEBUG PoolableDataSourceFactory - Created DataSource 584 of type 'dynDatasources' in the pooling flow
=== 2015-12-29 15:00:44,075 [ec-7] DEBUG PoolableDataSourceFactory - Activated DataSource 584 of type 'dynDatasources'
=== 2015-12-29 15:00:44,075 [ec-7] DEBUG DSRequest - Caching instance 584 of DS 'dynDatasources' from DSRequest.getDataSource()
=== 2015-12-29 15:00:44,075 [ec-7] DEBUG DSRequest - Caching instance 584 of DS dynDatasources
=== 2015-12-29 15:00:44,075 [ec-7] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
=== 2015-12-29 15:00:44,075 [ec-7] DEBUG DeclarativeSecurity - Request is not a client request, ignoring security checks.
=== 2015-12-29 15:00:44,075 [ec-7] DEBUG AppBase - [builtinApplication.null] No userTypes defined, allowing anyone access to all operations for this application
=== 2015-12-29 15:00:44,075 [ec-7] DEBUG AppBase - [builtinApplication.null] No public zero-argument method named '_null' found, performing generic datasource operation
=== 2015-12-29 15:00:44,076 [ec-7] INFO SQLDataSource - [builtinApplication.null] Performing fetch operation with
criteria: {f_id:1} values: {f_id:1}
=== 2015-12-29 15:00:44,076 [ec-7] INFO SQLDataSource - [builtinApplication.null] derived query: SELECT $defaultSelectClause FROM $defaultTableClause WHERE $defaultWhereClause
=== 2015-12-29 15:00:44,076 [ec-7] INFO SQLDataSource - [builtinApplication.null] 584: Executing SQL query on 'SQLSERVER': SELECT t_dyn_datasources.f_id, t_dyn_datasources.f_ds_filename, t_dyn_datasources.f_ds_filesize, t_dyn_datasources.f_ds_date_created FROM t_dyn_datasources WHERE (t_dyn_datasources.f_id=1)
=== 2015-12-29 15:00:44,076 [ec-7] DEBUG SQLConnectionManager - [builtinApplication.null] Borrowed connection '1616390358'
=== 2015-12-29 15:00:44,076 [ec-7] INFO SQLDriver - [builtinApplication.null] Executing SQL query on 'SQLSERVER' using connection '1616390358': SELECT t_dyn_datasources.f_id, t_dyn_datasources.f_ds_filename, t_dyn_datasources.f_ds_filesize, t_dyn_datasources.f_ds_date_created FROM t_dyn_datasources WHERE (t_dyn_datasources.f_id=1)
=== 2015-12-29 15:00:44,079 [ec-7] INFO DSResponse - DSResponse: List with 1 items
=== 2015-12-29 15:00:44,080 [ec-7] DEBUG DSRequest - About to free up resources for request of type fetch on DataSource dynDatasources
=== 2015-12-29 15:00:44,080 [ec-7] DEBUG SQLDataSource - About to clear SQLDriver state for DS instance 584
=== 2015-12-29 15:00:44,080 [ec-7] DEBUG SQLDriver - Freeing SQLDriver dbConnection 1616390358 for SQLDriver instance 702829240
=== 2015-12-29 15:00:44,080 [ec-7] DEBUG SQLConnectionManager - About to close connection with hashcode "1616390358"
=== 2015-12-29 15:00:44,080 [ec-7] DEBUG PoolableSQLConnectionFactory - Passivating connection '1616390358
=== 2015-12-29 15:00:44,080 [ec-7] DEBUG SQLDataSource - About to clear SQLDriver state for DS instance 584
=== 2015-12-29 15:00:44,080 [ec-7] DEBUG SQLDataSource - About to clear SQLDriver state for DS instance 584
=== 2015-12-29 15:00:44,080 [ec-7] DEBUG PoolableDataSourceFactory - Cleared and passivated DataSource 584 of type 'dynDatasources'
[B]=== 2015-12-29 15:00:44,080 [ec-7] INFO TestingDMI - DataSource input stream: null[/B]
=== 2015-12-29 15:00:44,080 [ec-7] DEBUG DSRequest - About to free up resources for request of type custom on DataSource test
Comment