Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

No implementation for java.lang.Boolean (with no qualifier annotation) was bound, and could not find an injectable constructor. Injectable classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor t

124 views
Skip to first unread message

Javier Cocco

unread,
Jan 31, 2023, 9:33:57 AM1/31/23
to google-guice
Hi, I have the following issue:

I need injection for constructor a Scala case class that has fields to store different configs

This class has a Boolean attributes:

case class ConfirmConfig @Inject()(                      
                          acceptAlternativeProviders: Seq[String],
                          acceptManualAlternativeProvidersDisabled: Seq[String],
                          acceptMoveAlternativeProvidersPerProduct: Map[String, Seq[String]],
                          skipValidateFlownSegmentsGolMailbox: Boolean)

I am injecting this class in a service class (wich has busisnes logical) as follows:

@Singleton
class GenerateReissueMaskOperation @Inject()(
                                            revalidationService: RevalidationService,
                                            reservationService: ReservationService,
                                            confirmConfig: ConfirmConfig)

When I run the app I am getting this error:

No implementation for java.lang.Boolean (with no qualifier annotation) was bound, and could not find an injectable constructor. Injectable classes must have either one (and only one) constructor annotated with @Inject or a zero-argument constructor that is not private.
  at java.lang.Boolean.class(Boolean.java:43)


What does is neccesary to @Inject() can inyect a class wich has a Booolean Scala class argument in its constructor ?

Thank you very much to anyone who can give me a hand
Reply all
Reply to author
Forward
0 new messages