uploadcare / uploadcare-java

Java API client that handles uploads and further operations with files by wrapping Uploadcare Upload and REST APIs.
https://uploadcare.com
Apache License 2.0
5 stars 13 forks source link

Provide support for Jakarta EE #50

Open sleepo581 opened 1 year ago

sleepo581 commented 1 year ago

Describe the bug

I'm migrating an application from old javax to new jakarta EE packages, however I got a few issues with Uploadcare Java client. I suppose that Uploadcare uses javax.activation which is conflicting with jakarta.activation package.

The error can be reproduced like this:

Expected behavior

File is uploaded without exceptions

Code / screenshots

java.lang.IllegalAccessError: failed to access class com.sun.activation.registries.LogSupport from class javax.activation.MimetypesFileTypeMap (com.sun.activation.registries.LogSupport and javax.activation.MimetypesFileTypeMap are in unnamed module of loader 'app')
    at javax.activation.MimetypesFileTypeMap.<init>(MimetypesFileTypeMap.java:130)
    at com.uploadcare.api.RequestHelper.getMimeType(RequestHelper.java:80)
    at com.uploadcare.upload.FileUploader.upload(FileUploader.java:127)

Environment