You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
package com.bean.example
import com.bean.example.auth.AuthTokenProvider
import javax.enterprise.context.ApplicationScoped
@ApplicationScoped
class AuthTokenConsumer(val tokenProvider: AuthTokenProvider) {
fun main(): String {
return tokenProvider.myToken
}
}
Library Bean
package com.bean.example.auth
import javax.enterprise.context.ApplicationScoped
@ApplicationScoped
class AuthTokenProvider() {
val myToken = "so secure"
}
In the example, i have a bean created inside a library module and it is being called by the service module.
When running ./gradlew :services:quarkus-service:test, there is a RuntimeException because the bean in the library is not found.
When running ./gradlew :services:quarkus-service:quarkusDev, the service fails to startup because the bean is not found.
[error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type com.bean.example.auth.AuthTokenProvider and qualifiers [@default]
- java member: com.bean.example.AuthTokenConsumer():tokenProvider
- declared on CLASS bean [types=[com.bean.example.AuthTokenConsumer, java.lang.Object], qualifiers=[@default, @Any], target=com.bean.example.AuthTokenConsumer]
What am I missing to make the bean work for the service?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm unable to get a quarkus CDI to work using composite builds using this sample project: https://github.com/jcjolley/quakus-cdi-failure-example
Service Class
Library Bean
In the example, i have a bean created inside a library module and it is being called by the service module.
When running
./gradlew :services:quarkus-service:test
, there is a RuntimeException because the bean in the library is not found.When running
./gradlew :services:quarkus-service:quarkusDev
, the service fails to startup because the bean is not found.What am I missing to make the bean work for the service?
Beta Was this translation helpful? Give feedback.
All reactions