cancel
Showing results for 
Search instead for 
Did you mean: 

Error when executing Integration Gateway service

0 Kudos

Hello,

I created  a service on IGW to expose an oracle db as odata but i'm getting the following error when i call it from the browser:


<error><code/><message xml:lang="en-US">An exception occurred.</message></error>

The service itself is working. Its destination is reachable from the IGW's management cockpit test, and its url returns the service description when executed from the browser. The error happens when i try to access an entity within the service, as in:

https://smp3url:8083/gateway/odata/SIST/ODATATEST;v=1/Solicitacao/

I checked SMP's logs and found two possibly related error entries. The first is from execution of my custom script. I had to create a script to map the entity set names to actual table names in the database (their full name: schema + table name).


2015 04 07 15:41:29#0-300#ERROR#com.sap.gateway.ip.core.customdev.processor.IGWScriptProcessor##anonymous#http-bio-8083-exec-5###[Gateway][TECHNICAL][TechnicalError]:This is first log


2015 04 07 15:41:29#0-300#ERROR#com.sap.gateway.core.odata4sap.ODataErrorCallbackImpl##anonymous#http-bio-8083-exec-5###handleError(): failed to serve request for URI https://smp3url:8083/gateway/odata/SIST/ODATATEST;v=1/Solicitacao, message = An exception occurred.

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

0 Kudos

I found out what was the issue.

The type of the properties in my entity were not compatible with the type of the database columns. For one we use oracle's number for our keys, but i was using Edm.int32 in the odata model. The compatible type is acutally Edm.decimal as number is a floating point.

Before i close this discussion, do we have any document showing the compatibility between edm types with the different datasources (oracledb perhaps hehe)?

midhun_vp
Active Contributor
0 Kudos

Hi Joao,

You can find the list of data types supported by Odata here: http://www.odata.org/documentation/odata-version-2-0/overview/

Sometimes you have to choose right data-type from the list of datatypes provided by Odata.

Recently in one scenario I had to map timestamp datatype (specific to Oracle) with string to make it work. Because the format of timestamp is different from datetime of Odata.


Regards, Midhun

SAP Technology RIG

Answers (4)

Answers (4)

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

For a while forget about custom scripting. If you go with Entity odata model directly(where you have to provide entityset name as database name and entity properties as database's columns name) are you able to execute it?

Since your database table name is sist.solicitacao, you can not create an entityset with the same name as you will not be allowed.


Now in custom scripting, you are mapping the same thing (chosen entityset with sist.solicitacao), that is where you are getting an error while executing the entity set result. I hope you got my point.


Regards,

JK


0 Kudos

Thanks for the tips guys.

Jitendra, i can't connect to my database with that string format. I need to use a tns name format, such as:

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=MyHost)(PORT=MyPort))(CONNECT_DATA=(SERVICE_NAME=MyOracleSID)))


I couldn't find a way to define the schema for this. I think i've passed this issue anyway. After the implementation of the custom script i stopped receiving an "Oracle - ORA-00942 : table or view does not exist" error from the service.


Midhun, i increased the log level but i couldn't find anything interesting in SMP's server logs. Still, i found this error message on the troubleshooting session of IGW's cockpit:


com.sap.gateway.core.api.provider.data.GenericODataProcessor: readEntitySet failed: entity set = Solicitacao, content type = application/xml;charset=utf-8, message = org.apache.olingo.odata2.api.ep.EntityProviderException: An exception occurred.

Is it a problem with the service itself then? This is interesting because i'm getting these errors  when generate the integration content on my project. I was actually ingnoring them because the deploy was still successful.

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

I was referring with this guide. Can you share screenshot of the destination screen and odata model+custom script?

0 Kudos

Ah yes, i've been following these guides. They were certainly helpful.

Another thing i should add about the eclipse error is that it's happening even with new (almost blank) projects. I'm now wondering if my environment is configured correctly. My difference from Marvin's guide is that i'm using eclipse kepler and the kepler's version of the SAP Mobile Platform Tools.

Here are the screenshots you've asked:

Destination:

Odata model:

Custom script (only implemented this method):

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

About the eclipse kepler and SMP tools plugins, you can verify it Help menu >About eclipse>Installation details

You should see latest version as 1.3.1 for API toolkit for SMP and OData Modeler

I am wondering why you are giving such a long destination URL (tns name format), are you not able to ping the destination as per Marvin's blog (string format)? Do you see any error?

By looking at custom scripting, it looks like that only table name and entityset name are different otherwise properties name and column names are same. Correct? Can you try with giving entityset name as table name (remove scripting file), redeploy and check if you are getting the entityset response?

Regards,

JK

0 Kudos

1) Ok, i'm using the toolkit version 1.3.1.

2) There are no errors related to the destination. Pings from the cockpit are successful.

3) The problem with giving entityset name as table name is that i can't use special characters for the entity set name. I can't name it "sist.solicitacao" then. So i opted to go for the script implementation. But then I was forced to define the properties map even though they were the same. Seems like the function expects that i define both the table map and the property map within the scope.

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

The problem with giving entityset name as table name is that i can't use special characters for the entity set name. I can't name it "sist.solicitacao" then. So i opted to go for the script implementation. But then I was forced to define the properties map even though they were the same. Seems like the function expects that i define both the table map and the property map within the scope

I have same feeling that because of special character (ie.dot) you are encountering that error, if you underscore (_) then it may work.

I guess then you have to modify backend table name accordingly.

Regards,

JK

0 Kudos

Which error you mean? "The object type is null or not contained in a Resource"? This error happens even in a new project using the entity type default parameters.

I think i don't have any database issues right now. My destination is reachable and with the custom script i stopped getting the ORA-00942 exception (so my table is also recognized). I have a feeling that the query (say, select * from sist.solicitacao) is executed successfully, but for some reason the result fails to be mapped to the odata model object.

The exception showed in IGW's cockpit seems to confirm this:

com.sap.gateway.core.api.provider.data.GenericODataProcessor: readEntitySet failed: entity set = Solicitacao, content type = application/xml;charset=utf-8, message = org.apache.olingo.odata2.api.ep.EntityProviderException: An exception occurred.
midhun_vp
Active Contributor
0 Kudos

Hi Joao,

Increase the log level of the component Integration Gateway to debug, then enable it to find more information on the error (Admin cockpit> Logs).

Regards, Midhun

SAP Technology RIG

Jitendra_Kansal
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Joao,


I checked SMP's logs and found two possibly related error entries. The first is from execution of my custom script. I had to create a script to map the entity set names to actual table names in the database (their full name: schema + table name

If you are using custom script (for JDBC) then make sure that you map entity set name with table name and properties with respective columns.

I suggest you to go through this blog once.

Also, while setting up destination you can mention schema name in the destination URL

jdbc:oracle:thin:@oracleserver:port:schemaname

If you still have issues in execution, please share the custom script and odata model screenshot.

Regards,

JK