cancel
Showing results for 
Search instead for 
Did you mean: 

Internal server error while calling sender rest service

Former Member
0 Kudos

Hi Experts,

I am working on an interface where sender is calling rest rest adapter and passing the  values through URL . We have set the  end point as "/MAM/" and the URL pattern as {Param} . Now the sender is calling using below two URLs.

http://host:5XX00/RESTAdapter/MAM/Notification/ABCD

http://host:5XX00/RESTAdapter/MAM/Notification(NotificationNumber=’ABCD’,sortField=’1234’)

When I call the second URL from rest client , I am able to make call to the channel successfully and able to read the value "Notification(NotificationNumber=’ABCD’,sortField=’1234’)" as parameter .

But , When I call using the first URL, I am getting below error . I am unable to understand what could cause array out of bound exception in calling this URL.

Having a "/" in parameter value "Notification/ABCD" will cause problem?

500 Internal Server Error is returned for HTTP request [http://host:5XX00/RESTAdapter/MAM/Notification/ABCD]:

  component [RESTServlet],

  web module [RESTAdapter],

  application [sap.com/com.sap.aii.adapter.rest.app],

  DC name [sap.com/com.sap.aii.adapter.rest.app],

  CSN component[BC-XI-CON],

  problem categorization [com.sap.ASJ.web.000137],

  internal categorization [-1036812344].

[EXCEPTION]

javax.servlet.ServletException: java.lang.RuntimeException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1

at com.sap.aii.adapter.rest.web.RESTServlet.service(RESTServlet.java:59)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:152)

at com.sap.engine.services.servlets_jsp.server.Invokable.invoke(Invokable.java:38)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:466)

at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:210)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:441)

at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:430)

at com.sap.engine.services.servlets_jsp.filters.DSRWebContainerFilter.process(DSRWebContainerFilter.java:38)

at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

at com.sap.engine.services.servlets_jsp.filters.ServletSelector.process(ServletSelector.java:81)

at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

at com.sap.engine.services.servlets_jsp.filters.ApplicationSelector.process(ApplicationSelector.java:278)

at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

at com.sap.engine.services.httpserver.filters.WebContainerInvoker.process(WebContainerInvoker.java:81)

at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)

at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

at com.sap.engine.services.httpserver.filters.ResponseLogWriter.process(ResponseLogWriter.java:60)

at com.sap.engine.services.httpserver.chain.HostFilter.process(HostFilter.java:9)

at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

at com.sap.engine.services.httpserver.filters.DefineHostFilter.process(DefineHostFilter.java:27)

at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)

at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

at com.sap.engine.services.httpserver.filters.MonitoringFilter.process(MonitoringFilter.java:29)

at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)

at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

at com.sap.engine.services.httpserver.filters.SessionSizeFilter.process(SessionSizeFilter.java:26)

at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)

at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

at com.sap.engine.services.httpserver.filters.MemoryStatisticFilter.process(MemoryStatisticFilter.java:57)

at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)

at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

at com.sap.engine.services.httpserver.filters.DSRHttpFilter.process(DSRHttpFilter.java:43)

at com.sap.engine.services.httpserver.chain.ServerFilter.process(ServerFilter.java:12)

at com.sap.engine.services.httpserver.chain.AbstractChain.process(AbstractChain.java:78)

at com.sap.engine.services.httpserver.server.Processor.chainedRequest(Processor.java:475)

at com.sap.engine.services.httpserver.server.Processor$FCAProcessorThread.process(Processor.java:269)

at com.sap.engine.services.httpserver.server.rcm.RequestProcessorThread.run(RequestProcessorThread.java:56)

at com.sap.engine.core.thread.execution.Executable.run(Executable.java:122)

at com.sap.engine.core.thread.execution.Executable.run(Executable.java:101)

at com.sap.engine.core.thread.execution.CentralExecutor$SingleThread.run(CentralExecutor.java:328)

Caused by: java.lang.RuntimeException: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1

at com.sap.aii.adapter.rest.ejb.RESTAdapter.service(RESTAdapter.java:137)

at com.sap.aii.adapter.rest.web.RESTServlet.service(RESTServlet.java:55)

... 40 more

Caused by: java.lang.IndexOutOfBoundsException: Index: 1, Size: 1

at java.util.ArrayList.RangeCheck(ArrayList.java:547)

at java.util.ArrayList.get(ArrayList.java:322)

at com.sap.aii.adapter.rest.ejb.parse.NewURLParser.parseURL(NewURLParser.java:162)

at com.sap.aii.adapter.rest.ejb.sender.RESTSenderChannel.canHandle(RESTSenderChannel.java:350)

at com.sap.aii.adapter.rest.ejb.RESTChannelManager.routeCall(RESTChannelManager.java:30)

at com.sap.aii.adapter.rest.ejb.RESTAdapter.routeInbound(RESTAdapter.java:159)

at com.sap.aii.adapter.rest.ejb.RESTAdapter.service(RESTAdapter.java:75)

Please help.

Thanks,

Reyaz

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Hi Reyaz,

The exception that you have had could be raised for wrong URL format, internal server error should be caused when the endpoint can't process the request, sometimes throws an internal exception like the page can't be found. You can test with an external tool like vRest and you probably will get the same exception.

Regards.

Former Member
0 Kudos

Thanks for the quick response Iñaki Vila . I am getting same error when I test with vREST client as well . Even I assumed that it could be due to malformed URL . But, which character in this URL "http://host:5XX00/RESTAdapter/MAM/Notification/ABCD"  is causing this issue exactly. I am suspecting that "/" is causing the URL to be malformed.and searching the confirmation or any reference regarding the same. If "/" in the value of the parameter in the URL pattern is causing the issue, I can request the sender side application to update the URL to send the parameter value as in another URL in above first post.

Thanks,

Reyaz

iaki_vila
Active Contributor
0 Kudos

Hi Reyaz,

AFAIK your query request is totally right but this doesn't mean that the endpoint developers had prepared the two options access and the have only one option to access avoiding the direct access. Check this link to know more http://stackoverflow.com/questions/4024271/rest-api-best-practices-where-to-put-parameters

Regards.

Former Member
0 Kudos

Thanks

Answers (0)