eclipse-ee4j / eclipse-ee4j/jersey

ClassCastException in FormDataParamValueParamProvider

Open
#4,761 3 comments 0 reactions 1 assignee Claimed by @jbescos View on GitHub
Dominant language
Java
Stars
730
Forks
382
PR merge metrics
No merged PRs in 30d

Description

Hi,
I have app that accepts multipart/mixed POST request, but I am getting ClassCastException.
`java.lang.ClassCastException: class org.glassfish.jersey.media.multipart.MultiPart cannot be cast to class org.glassfish.jersey.media.multipart.FormDataMultiPart (org.glassfish.jersey.media.multipart.MultiPart and org.glassfish.jersey.media.multipart.FormDataMultiPart are in unnamed module of loader 'app')`

This seems to be cause lines 271 and 279 in FormDataParamValueParamProvider.

On line 271 there is:
`entity = request.readEntity(FormDataMultiPart.class);`
which assigns object of type Multipart and then on line 279:
`return (FormDataMultiPart)entity;`
ClassCastException is thrown.

I am not really sure if I did anything incorrectly, because noone seems to experience this issue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.