SAP / olingo-jpa-processor-v4

The JPA Processor fills the gap between Olingo V4 and the database, by providing a mapping between JPA metadata and OData metadata, generating queries and supporting the entity manipulations.
Apache License 2.0
122 stars 76 forks source link

Batch request is not working. (Library version: 1.1.1) #232

Closed Vivaswan13 closed 8 months ago

Vivaswan13 commented 9 months ago

I tried to perform a batch request but gives an error saying

org.apache.tomcat.util.http.fileupload.MultipartStream$MalformedStreamException: Stream ended unexpectedly at org.apache.tomcat.util.http.fileupload.MultipartStream.readHeaders(MultipartStream.java:520) ~[tomcat-embed-core-9.0.79.jar:9.0.79] at org.apache.tomcat.util.http.fileupload.impl.FileItemIteratorImpl.findNextItem(FileItemIteratorImpl.java:243) ~[tomcat-embed-core-9.0.79.jar:9.0.79] at org.apache.tomcat.util.http.fileupload.impl.FileItemIteratorImpl.(FileItemIteratorImpl.java:142) ~[tomcat-embed-core-9.0.79.jar:9.0.79] at org.apache.tomcat.util.http.fileupload.FileUploadBase.getItemIterator(FileUploadBase.java:277) ~[tomcat-embed-core-9.0.79.jar:9.0.79] at org.apache.tomcat.util.http.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:301) ~[tomcat-embed-core-9.0.79.jar:9.0.79] at org.apache.catalina.connector.Request.parseParts(Request.java:2850) ~[tomcat-embed-core-9.0.79.jar:9.0.79] at org.apache.catalina.connector.Request.getParts(Request.java:2751) ~[tomcat-embed-core-9.0.79.jar:9.0.79] at org.apache.catalina.connector.RequestFacade.getParts(RequestFacade.java:796) ~[tomcat-embed-core-9.0.79.jar:9.0.79]


The issue looks to be in Class "org.apache.olingo.server.core.deserializer.batch.BatchParser" where returns an empty message list . com.sap.olingo.jpa.processor.core.api.JPAODataBatchProcessor #processBatch , is not able to deserialise input stream.

private List<List<Line>> splitBodyParts(final InputStream in, final String boundary) throws IOException,
      BatchDeserializerException {
    final BatchLineReader reader = new BatchLineReader(in);
    **final List<Line> message = reader.toLineList();**
    reader.close();
   return BatchParserCommon.splitMessageByBoundary(message, boundary);
  }

Here is version of pom.

4.9.0 com.sap.olingo odata-jpa-metadata 1.1.1 The body is: Screenshot 2023-10-18 at 11 37 55 AM Which version do you advise with odata-jpa-metadata
wog48 commented 8 months ago

Unfortunately I was not able to reproduce this problem. Furthermore, I did not reached org.apache.tomcat.util.http.fileupload.MultipartStream.readHeaders. So I'm not able to give more advice.

In case you think that org.apache.olingo.server.core.deserializer.batch.BatchParser has a problem please create an issue in the Olingo Jira.

Vivaswan13 commented 7 months ago

I am facing the same issue as mentioned above. I changed the version to 2.0.0 . But still the issue is coming.

Vivaswan13 commented 6 months ago

The issue is fixed now.

akaFood commented 3 days ago

The issue is fixed now.

how did you fix this error? I am seeing the same error and couldn't find a solution