Casting Issue with StreamingFileUpload in Generated Controller Methods #11101
-
Hello everyone, We are encountering issues with the usage of io.micronaut.http.multipart.StreamingFileUpload.
Recently, we decided to add support for StreamingFileUpload and are facing a casting issue that we have not yet identified the cause of, especially since io.micronaut.http.multipart.CompletedFileUpload works fine. I am posting this question here to seek help. Here is a simple example of the method signature generated for our controller adapter:
And here is the error we are receiving:
One of the problems is that since the object is shown as a memory address, we are unable to identify the type. We are using Micronaut parent version 3.10.3, which includes the version of the HTTP server Netty. Any help or guidance on this issue would be greatly appreciated. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
We are currently migrating a test project to use Micronaut parent version 4.4.2 and have encountered a ClassCastException when using StreamingFileUpload. java.lang.ClassCastException: class reactor.core.publisher.MonoOnAssembly cannot be cast to class io.micronaut.http.multipart.StreamingFileUpload (reactor.core.publisher.MonoOnAssembly and io.micronaut.http.multipart.StreamingFileUpload are in unnamed module of loader 'app') |
Beta Was this translation helpful? Give feedback.
-
To address this, we created our own custom class for the file uploader and used delegate to manage the functionality. |
Beta Was this translation helpful? Give feedback.
Please provide a sample app that reproduces it