question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

"no handler for data" exception via `ODataModel.read` stream (OData V2)

See original GitHub issue

OpenUI5 version: 1.84.20 - lastest Browser/version (+device/version): Chrome Any other tested browsers/devices(OK/FAIL): N/A

Steps to reproduce the problem:

  1. Prepare one gateway backend service, we can get a media entity via url /sap/opu/odata/ZTEST/TEST_NAME_SRV/TestEntitySet(guid’xxxxxxx’)/$value
  2. If we use below code to read file content
const oDataModel2 = new sap.ui.model.odata.v2.ODataModel(oDataModel.sServiceUrl)
oDataModel.read(`/TestEntitySet(guid'${eventMsgguidIn}')/$value`, {
  context: null,
  urlParameters: null,
  filters: null,
  sorters: null,
  success: (OData, response) => {
    console.log(response)
  },
  error: function (error) {
    console.log(error)
  }
})

there is one exception in console, the success function can’t be called, even the media file is already included in response
The following problem occurred: no handler for data - sap.ui.model.odata.v2.ODataModel

  1. but if we use sap.ui.model.odata.ODataModel class to create oDataModel, it can work fine

I found lots of similar questions in sap community, so is there any official solution for this issue? Thank you so much. https://answers.sap.com/questions/12197085/the-following-error-occurred-no-handler-for-data.html https://answers.sap.com/questions/343789/fiori-exception-no-handler-for-data.html?childToView=13638724

Any other information? (attach screenshot if possible) image

Regards, Hao

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
Crwingcommented, May 23, 2022

Hi @boghyon Hi @pksinsik , Thanks for your patient explanation and great solution. @pksinsik your solution looks so good, unfortunately I can’t change our backend logic easily in this project, so for my case $value is necessary.

According to this question, URLHelper.redirect("<...>/TestEntitySet(guid'${eventMsgguidIn}')/$value", true) can also help this situation.

So I can close this issue. Thanks @boghyon and @pksinsik again.

0reactions
pksinsikcommented, May 18, 2022

Hi @Crwing, when having the media resource in a property, it should be possible to not de-reference the property as it happens when using $value, e.g. https://services.odata.org/V2/Northwind/Northwind.svc/Employees(1)/Photo?$format=json gives you the resource in a JSON envelope, so you could read and interpret its value, either as JSON or XML. This should be possible using the UI5 model.

Whereas https://services.odata.org/V2/Northwind/Northwind.svc/Employees(1)/Photo/$value gives you the contents of the media resource. This however cannot be read via the ODataModel as the underlying datajs library always expects a certain format.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fiori exception "no handler for data" - SAP Community
It works in the Gateway cleint and when called from a browser. However when I call the read method of the service from...
Read more >
sap.ui.model.odata.v2.ODataModel - API Reference - Demo Kit
If the data of the context is not yet available, it can not be created, but first the entity needs to be fetched...
Read more >
How to read image using oDatamodel V2 in sapui5?
Now I want to read this image in my sapui5 application using the code below, but I just get the error "EventProvider sap.ui.model.odata.v2....
Read more >
SAP Gateway and OData
If your SAP and non-SAP systems are the stations, then SAP ... 10.6.2 Browse Services via the OData Model Editor . ... This...
Read more >
Passing OData Query Options in the Request Body
The query options part of an OData URL can be quite long, ... client's ability to request the exact set of data that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found