Highlighted
Absent Member.. Absent Member..
Absent Member..
1012 views

OO 10.60 REST Upload Deploy File causes 500 error

Jump to solution

I'm using the OO docker  container to test automated deployments .

I am able to successfully deploy an individual content pack using:

Request: PUT /content-packs/{name}

Now I'm trying to deploy a group of content packs. I first generate a deployment ID using:

Request: POST /deployments

Then attempt to upload the content pack using the command below which results in a 500 error

Request: POST /deployments/{deploymentProcessId}/files  (and the newly generated deploymentProcessId is placed in)

2016-12-08 16:12:55,139 [http-nio-8080-exec-1] (DeploymentController.java:384) ERROR - net.bull.javamelody.JspWrapper$HttpRequestWrapper3 cannot be cast to org.springframework.web.multipart.MultipartHttpServletRequest
java.lang.ClassCastException: net.bull.javamelody.JspWrapper$HttpRequestWrapper3 cannot be cast to org.springframework.web.multipart.MultipartHttpServletRequest
at com.hp.oo.deployment.controllers.DeploymentController.upload(DeploymentController.java:264)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869)

.....

 

 

Any insight to why this command is causing a 500 error?

Labels (1)
0 Likes
1 Solution

Accepted Solutions
Highlighted
New Member.

Hi,

It is possible that your request is not formated according to the multipart/form-data standard, described in RFC 2388.

I reccomand that you check this forst. I think it may also be halpeful to search for some examples of multipart/form-data requests.

Hope this helps,

Ligia

View solution in original post

3 Replies
Highlighted
New Member.

Hi,

It is possible that your request is not formated according to the multipart/form-data standard, described in RFC 2388.

I reccomand that you check this forst. I think it may also be halpeful to search for some examples of multipart/form-data requests.

Hope this helps,

Ligia

View solution in original post

Highlighted
Outstanding Contributor.
Outstanding Contributor.

As Ligia mentioned it is important to make sure the headers and body are correct.

Below is a screen from DHC rest client

Screenshot_2.png

Andrei Vasile Truta
Absent Member.. Absent Member..
Absent Member..

Thank you for your replies!  This set me in the right direction.. I was sending the binary data for a single file as the body rather then multipart/form-data

 

I was able to upload with curl like this:

curl --request POST -F "basecontent=@oo10-base-cp-1.9.0.jar" http://<host>/oo/rest/v2/deployments/164400001/files

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.