Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Replace AbstractContainerRequestValueFactory in Jersey 2.26

Hi all I´m struggling migrating from Jersey 2.25 to 2.26 since, it has a break change in a internal class of the library AbstractContainerRequestValueFactory

They claim in the issue sections that since the package is internal it should not be used. But they dont offer a solution or workaround.

Any idea how can I replace the use of that class for something else to continue using the provide implementation as I´ve been doing so far?

class MyOwnFactory extends AbstractContainerRequestValueFactory[Future[Object]] {
  override def provide: Future[Object] = getContainerRequest.getProperty(Constants.individual).asInstanceOf[Future[Object]]
}
like image 309
paul Avatar asked Apr 11 '26 23:04

paul


1 Answers

The equivalent would be to use a Supplier and inject the ContainerRequest, as the Supplier replaces the HK2 Factory and all AbstractContainerRequestValueFactory is is an HK2 Factory that injects the Provider<ContainerRequest>. Just look at the source

See also:

  • Jersey 2.26: register @Inject in ResourceConfig bindFactory cannot convert Factory to Supplier
  • Registering a custom ValueParamProvider in Jersey 2.27
like image 186
Paul Samsotha Avatar answered Apr 13 '26 13:04

Paul Samsotha



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!