My Oracle Support Banner

OdiInvokeRESTfulService Fails with the Following Error: '415 MediaType Is Not Supported' or 'File not found' (Doc ID 2585720.1)

Last updated on JUNE 16, 2022

Applies to:

Oracle Data Integrator - Version 12.2.1.3.0 and later
Information in this document applies to any platform.

Symptoms

Attempting to use the Oracle Commerce Cloud (OCC) endpoint doFileUploadMultipart (/ccadmin/v1/files) to upload a file with the Oracle Data Integrator (ODI) tool OdiInvokeRESTfulService, ODI is returning a "415 Unsupported Media Type”. The ODI OdiInvokeRESTfulService has been configured with setting similar to the following:

OdiInvokeRESTfulService
  "-CONTEXT=GLOBAL"
  "-LSCHEMA=ZEBOCC_REST_IMPORT"
  "-OPERATION=Import"
  "-HEADER.Origin=https://<HOST_NAME>"
  "-HEADER.Content-Type=multipart/form-data"
  "-HEADER.Authorization=Bearer <AUTH_TOKEN >"
  "-REQUEST_BODY_PART_NAME=fileUpload"
  "-REQUEST_BODY_PART_NAME=filename"
  "-REQUEST_BODY_PART_VALUE=<FILE_LOCATION_AND_NAME>"
  "-REQUEST_BODY_PART_VALUE=<FILE_NAME>"
  "-REQUEST_BODY_PART_CONTENT_TYPE=thirdPartyFile"
  "-REQUEST_BODY_PART_CONTENT_TYPE=text"
  "-REQUEST_BODY_PART_CONTENT_TYPE=text"

The resulting error:

oracle.odi.runtime.rest.SnpsRSInvocationException: ODI-30170: Multipart bodypart creation failed.
  at oracle.odi.runtime.rest.InvokeRESTfulServiceSupport.createMultiPartEntity(InvokeRESTfulServiceSupport.java:502)
  at com.sunopsis.dwg.tools.InvokeRESTfulService.invokeMainOperation(InvokeRESTfulService.java:581)
  at com.sunopsis.dwg.tools.InvokeRESTfulService.actionExecute(InvokeRESTfulService.java:523)
  at com.sunopsis.dwg.function.SnpsFunctionBaseRepositoryConnected.execute(SnpsFunctionBaseRepositoryConnected.java:235)
  at oracle.odi.runtime.agent.execution.SessionTask.execIntegratedFunction(SessionTask.java:949)
  at oracle.odi.runtime.agent.execution.SessionTask.executeOdiCommand(SessionTask.java:607)
  at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:32)
  at oracle.odi.runtime.agent.execution.cmd.OdiCommandExecutor.execute(OdiCommandExecutor.java:18)
  at oracle.odi.runtime.agent.execution.TaskExecutionHandler.handleTask(TaskExecutionHandler.java:52)
  ...
Caused by: java.lang.IllegalArgumentException: Error parsing media type 'thirdPartyFile'
  at org.glassfish.jersey.message.internal.MediaTypeProvider.fromString(MediaTypeProvider.java:92)
  at org.glassfish.jersey.message.internal.MediaTypeProvider.fromString(MediaTypeProvider.java:60)
  at javax.ws.rs.core.MediaType.valueOf(MediaType.java:179)
  at oracle.odi.runtime.rest.InvokeRESTfulServiceSupport.createMultiPartEntity(InvokeRESTfulServiceSupport.java:473)
  ... 22 more
Caused by: java.text.ParseException: End of header.
  at org.glassfish.jersey.message.internal.HttpHeaderReaderImpl.getNextCharacter(HttpHeaderReaderImpl.java:178)
  at org.glassfish.jersey.message.internal.HttpHeaderReaderImpl.next(HttpHeaderReaderImpl.java:139)
  at org.glassfish.jersey.message.internal.HttpHeaderReaderImpl.next(HttpHeaderReaderImpl.java:134)
  at org.glassfish.jersey.message.internal.HttpHeaderReader.nextSeparator(HttpHeaderReader.java:139)
  at org.glassfish.jersey.message.internal.MediaTypeProvider.valueOf(MediaTypeProvider.java:111)
  at org.glassfish.jersey.message.internal.MediaTypeProvider.fromString(MediaTypeProvider.java:90)
  ... 25 more

A third-party REST client or CURL is successful when uploading the file using the same endpoint. It is only through the ODI OdiInvokeRESTfulService that the upload is failing.

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.