[LF7.1GA4] JAX RS API register error

Tinfo Tinfo, modified 3 Years ago. New Member Posts: 14 Join Date: 5/14/20 Recent Posts

Hi,

we are trying to develop some API that

@Consumes(MediaType.MULTIPART_FORM_DATA)

using

@FormDataParam

but if we add these dependencies to gradle:

compileInclude group: 'org.glassfish.jersey.media', name: 'jersey-media-multipart', version: '2.27'
compileInclude group: 'org.glassfish.jersey.core', name: 'jersey-server', version: '2.27'

we have the following error:

2022-08-03 16:12:01.941 INFO  [pipe-start 1019][BundleStartStopLogger:39] STARTED it.tinfo.test.api_1.0.0 [1019]
2022-08-03 16:12:01.982 INFO  [pipe-start 1019][TestAPI:64] Test API Rest service activated
2022-08-03 16:12:01.994 WARN  [pipe-start 1019][AriesJaxrsServiceRuntime:227] Application CachingServiceReference {__cachedProperties={component.name=it.tinfo.test.api.api.TestAPI, service.id=9635, objectClass=[javax.ws.rs.core.Application], oauth2.scopechecker.type=none, osgi.jaxrs.name=testAPI, osgi.jaxrs.extension.select=null (cached), osgi.http.whiteboard.context.select=null (cached), osgi.jaxrs.whiteboard.target=null (cached), service.pid=it.tinfo.test.api.api.TestAPI, osgi.jaxrs.application.select=null (cached), osgi.jaxrs.application.base=/testAPI, component.id=4057, auth.verifier.guest.allowed=true, service.scope=bundle, service.bundleid=1019}__serviceReference={javax.ws.rs.core.Application}={osgi.jaxrs.application.base=/testAPI, service.id=9635, service.bundleid=1019, service.scope=bundle, auth.verifier.guest.allowed=true, oauth2.scopechecker.type=none, osgi.jaxrs.name=testAPI, service.pid=it.tinfo.test.api.api.TestAPI, component.name=it.tinfo.test.api.api.TestAPI, component.id=4057}__} is registered with error [Sanitized]

without these dependencies using @FormParam for text data there aren't registration problems.

Which could be the problem?

There are other working solution in Liferay to create API that receive file data correctly?

Thanks.