wso2 / product-ei

An open source, a high-performance hybrid integration platform that allows developers quick integration with any application, data, or system.
https://wso2.com/integration/
Apache License 2.0
375 stars 280 forks source link

Error in data services for Excel datasource #2074

Closed nilminiwso2 closed 6 years ago

nilminiwso2 commented 6 years ago

Description: When using data services in EI 6.2.0, it is no longer possible to add data to Excel datasource. As discussed with the team, this is because of a changed library in EI 6.2.0.

In EI 6.2.0, the libraries are as follows ( note poi_3.17.0.wso2v1)

`osgi> p poi No exported packages osgi> ss poi "Framework is launched."

id State Bundle 177 ACTIVE org.eclipse.equinox.p2.touchpoint.eclipse_2.1.0.v20110511-wso2v1 178 ACTIVE org.eclipse.equinox.p2.touchpoint.natives_1.1.100.v20130327-2119 236 ACTIVE org.wso2.carbon.dataservices.odata.endpoint_4.4.43 248 ACTIVE org.wso2.carbon.endpoint_4.6.67 249 ACTIVE org.wso2.carbon.endpoint.stub_4.6.67 250 ACTIVE org.wso2.carbon.endpoint.ui_4.6.67 320 RESOLVED org.wso2.carbon.inbound.endpoint_4.6.67 Master=608 321 ACTIVE org.wso2.carbon.inbound.endpoint.osgi_4.6.67 322 ACTIVE org.wso2.carbon.inbound.endpoint.persistence_4.6.67 575 ACTIVE poi_3.9.0.wso2v1 Fragments=577 576 ACTIVE poi_3.17.0.wso2v1 Fragments=578, 579 577 RESOLVED poi-ooxml_3.9.0.wso2v3 Master=575 578 RESOLVED poi-ooxml_3.17.0.wso2v1 Master=576 579 RESOLVED poi-scratchpad_3.17.0.wso2v1 Master=576 osgi> `

In EI 6.1.1, the libraries are as follows (note poi_3.14.0.wso2v1): `osgi> p poi No exported packages osgi> ss poi "Framework is launched."

id State Bundle 172 ACTIVE org.eclipse.equinox.p2.touchpoint.eclipse_2.1.0.v20110511-wso2v1 173 ACTIVE org.eclipse.equinox.p2.touchpoint.natives_1.1.100.v20130327-2119 224 ACTIVE org.wso2.carbon.dataservices.odata.endpoint_4.4.10 236 ACTIVE org.wso2.carbon.endpoint_4.6.19 237 ACTIVE org.wso2.carbon.endpoint.stub_4.6.19 238 ACTIVE org.wso2.carbon.endpoint.ui_4.6.19 307 RESOLVED org.wso2.carbon.inbound.endpoint_4.6.19 Master=589 308 ACTIVE org.wso2.carbon.inbound.endpoint.osgi_4.6.19 309 ACTIVE org.wso2.carbon.inbound.endpoint.persistence_4.6.19 560 ACTIVE poi_3.9.0.wso2v1 Fragments=562 561 ACTIVE poi_3.14.0.wso2v1 Fragments=563, 564 562 RESOLVED poi-ooxml_3.9.0.wso2v3 Master=560 563 RESOLVED poi-ooxml_3.14.0.wso2v1 Master=561 564 RESOLVED poi-scratchpad_3.14.0.wso2v1 Master=561 osgi> `

Given below is the error message:

`osgi> [2018-03-30 14:58:49,990] [EI-Core] ERROR - DBInOnlyMessageReceiver Error in in-only message receiver DS Fault Message: Error in DS non result invoke. DS Code: DATABASE_ERROR Nested Exception:- javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'SQLQuery.processPreNormalQuery': org/apache/commons/collections4/bidimap/TreeBidiMap DS Code: DATABASE_ERROR Source Data Service:- Name: Excel Location: /Excel.dbs Description: N/A Default Namespace: http://ws.wso2.org/dataservice Current Request Name: addop Current Params: {Classification=dsds, Model=sdsds, ID=ssds} Nested Exception:- java.lang.NoClassDefFoundError: org/apache/commons/collections4/bidimap/TreeBidiMap

at org.wso2.carbon.dataservices.core.dispatch.SingleDataServiceRequest.processSingleRequest(SingleDataServiceRequest.java:118)
at org.wso2.carbon.dataservices.core.dispatch.SingleDataServiceRequest.processRequest(SingleDataServiceRequest.java:67)
at org.wso2.carbon.dataservices.core.dispatch.DataServiceRequest.dispatch(DataServiceRequest.java:357)
at org.wso2.carbon.dataservices.core.DataServiceProcessor.dispatch(DataServiceProcessor.java:41)
at org.wso2.carbon.dataservices.core.DBInOnlyMessageReceiver.invokeBusinessLogic(DBInOnlyMessageReceiver.java:53)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:415)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:151)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Caused by: javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'SQLQuery.processPreNormalQuery': org/apache/commons/collections4/bidimap/TreeBidiMap DS Code: DATABASE_ERROR Source Data Service:- Name: Excel Location: /Excel.dbs Description: N/A Default Namespace: http://ws.wso2.org/dataservice Current Request Name: addop Current Params: {Classification=dsds, Model=sdsds, ID=ssds} Nested Exception:- java.lang.NoClassDefFoundError: org/apache/commons/collections4/bidimap/TreeBidiMap

at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.execute(DSOMDataSource.java:102)
at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.serialize(DSOMDataSource.java:107)
at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.executeInOnly(DSOMDataSource.java:80)
at org.wso2.carbon.dataservices.core.dispatch.SingleDataServiceRequest.processSingleRequest(SingleDataServiceRequest.java:116)
... 12 more

[2018-03-30 14:58:49,997] [EI-Core] ERROR - ServerWorker Error processing POST request for : /services/Excel.SOAP12Endpoint/addop org.apache.axis2.AxisFault: DS Fault Message: Error in DS non result invoke. DS Code: DATABASE_ERROR Nested Exception:- javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'SQLQuery.processPreNormalQuery': org/apache/commons/collections4/bidimap/TreeBidiMap DS Code: DATABASE_ERROR Source Data Service:- Name: Excel Location: /Excel.dbs Description: N/A Default Namespace: http://ws.wso2.org/dataservice Current Request Name: addop Current Params: {Classification=dsds, Model=sdsds, ID=ssds} Nested Exception:- java.lang.NoClassDefFoundError: org/apache/commons/collections4/bidimap/TreeBidiMap

at org.wso2.carbon.dataservices.core.DBUtils.createAxisFault(DBUtils.java:801)
at org.wso2.carbon.dataservices.core.DBInOnlyMessageReceiver.invokeBusinessLogic(DBInOnlyMessageReceiver.java:58)
at org.apache.axis2.receivers.AbstractMessageReceiver.receive(AbstractMessageReceiver.java:110)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
at org.apache.synapse.transport.passthru.ServerWorker.processEntityEnclosingRequest(ServerWorker.java:415)
at org.apache.synapse.transport.passthru.ServerWorker.run(ServerWorker.java:151)
at org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

Caused by: javax.xml.stream.XMLStreamException: DS Fault Message: Error in 'SQLQuery.processPreNormalQuery': org/apache/commons/collections4/bidimap/TreeBidiMap DS Code: DATABASE_ERROR Source Data Service:- Name: Excel Location: /Excel.dbs Description: N/A Default Namespace: http://ws.wso2.org/dataservice Current Request Name: addop Current Params: {Classification=dsds, Model=sdsds, ID=ssds} Nested Exception:- java.lang.NoClassDefFoundError: org/apache/commons/collections4/bidimap/TreeBidiMap

at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.execute(DSOMDataSource.java:102)
at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.serialize(DSOMDataSource.java:107)
at org.wso2.carbon.dataservices.core.engine.DSOMDataSource.executeInOnly(DSOMDataSource.java:80)
at org.wso2.carbon.dataservices.core.dispatch.SingleDataServiceRequest.processSingleRequest(SingleDataServiceRequest.java:116)
at org.wso2.carbon.dataservices.core.dispatch.SingleDataServiceRequest.processRequest(SingleDataServiceRequest.java:67)
at org.wso2.carbon.dataservices.core.dispatch.DataServiceRequest.dispatch(DataServiceRequest.java:357)
at org.wso2.carbon.dataservices.core.DataServiceProcessor.dispatch(DataServiceProcessor.java:41)
at org.wso2.carbon.dataservices.core.DBInOnlyMessageReceiver.invokeBusinessLogic(DBInOnlyMessageReceiver.java:53)
... 8 more`

Affected Product Version: EI 6.2.0.

OS, DB, other environment details and versions: Tried on MAC OS

Steps to reproduce: Reproduced this while trying to add data to the excel sheet as given in this tutorial [1].

[1] https://docs.wso2.com/display/EI6xx/Exposing+Excel+Data+as+a+Data+Service#ExposingExcelDataasaDataService-CreatingaquerytoPOSTdata

chanikag commented 6 years ago

Fixed with https://github.com/wso2/carbon-data/pull/183