Bean not found #8828
Replies: 1 comment
-
without knowing more about the code itself I dont think you'll get much discussion. I've seen often times when we submit a discussion on bugs we're experiencing we can give insufficient information - I like micronaut's bug report for a good set of information to provide outside of what you've already added. for instance I found your question because I have this same error, but I'm running into this from my tests. I can't tell from your write up if you're in the same boat as I am. also github has this cool formatting trick where if you add three for instance, this text:
buildscript { repositories { mavenCentral() } dependencies { produces this code block
or this example specifying a filetype for syntax highlighting:
micronautVersion=3.8.5 micronautDataVersion=3.9.6 spekVersion=2.0.19 postgresVersion=42.5.4 slf4jVersion=2.0.6 hibernateVersion=2.2.5 groovyAllVersion=3.0.13 spockCoreVersion=2.4-M1-groovy-3.0 lombokVersion=1.18.26 ``` micronautVersion=3.8.5
micronautDataVersion=3.9.6
spekVersion=2.0.19
postgresVersion=42.5.4
slf4jVersion=2.0.6
hibernateVersion=2.2.5
groovyAllVersion=3.0.13
spockCoreVersion=2.4-M1-groovy-3.0
lombokVersion=1.18.26 |
Beta Was this translation helpful? Give feedback.
-
No bean of type [xxx.xxx.XXService] exists for the given qualifier: @nAmed ('xXService'). Make sure the bean is not disabled by bean requirements (enable trace logging for 'io.micronaut.context.condition' to check) and if the bean is enabled then ensure the class is declared a bean and annotation processing is enabled (for Java and Kotlin the 'micronaut-inject-java' dependency should be configured as an annotation processor).
and my build.gradle looks like:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:3.3'
}
}
plugins {
id "application"
id "idea"
id 'java'
id 'groovy'
id 'org.sonarqube' version '2.6.2'
id 'jacoco'
id 'io.micronaut.library' version '1.3.2'
}
apply plugin: "groovy"
mainClassName = "com.xxx.xxx.Main"
distTar.version = ""
jar.enabled = true
repositories {
mavenCentral()
}
dependencies {
annotationProcessor "org.projectlombok:lombok:$lombokVersion"
annotationProcessor("io.micronaut.data:micronaut-data-processor:$micronautDataVersion")
annotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
annotationProcessor "io.micronaut:micronaut-inject-java"
annotationProcessor "io.micronaut:micronaut-validation"
annotationProcessor "javax.persistence:javax.persistence-api:2.2"
compileOnly("org.projectlombok:lombok:$lombokVersion")
implementation 'builders.dsl:spreadsheet-builder-poi:3.0.1'
implementation("io.micronaut.data:micronaut-data-hibernate-jpa:$micronautDataVersion")
implementation("io.micronaut.data:micronaut-data-processor:$micronautDataVersion")
implementation 'io.micronaut.spring:micronaut-spring:4.5.0'
implementation "io.micronaut:micronaut-validation"
implementation "io.micronaut:micronaut-inject:$micronautVersion"
implementation platform("io.micronaut:micronaut-bom:$micronautVersion")
implementation "io.micronaut:micronaut-runtime"
implementation "io.micronaut:micronaut-http-server-netty"
implementation 'io.micronaut:micronaut-http-client'
runtimeOnly "ch.qos.logback:logback-classic:1.4.5"
implementation 'org.postgresql:postgresql:$postgresVersion'
implementation 'io.micronaut.configuration:micronaut-jdbc-hikari:2.2.6'
runtimeOnly("io.micronaut:micronaut-core:$micronautVersion")
implementation "io.micronaut:micronaut-inject-java:$micronautVersion"
implementation 'javax.inject:javax.inject:1'
// implementation 'javax.inject:javax.inject-api:2.0.1'
implementation("io.micronaut.rxjava3:micronaut-rxjava3:2.4.0")
implementation("io.micronaut.rxjava3:micronaut-rxjava3-http-client:2.4.0")
implementation "org.yaml:snakeyaml:1.33"
/Logging and Json Dependencies/
compileOnly group: 'org.slf4j', name: 'slf4j-api', version: "$slf4jVersion"
implementation group: 'org.apache.commons', name: 'commons-configuration2', version: '2.8.0'
implementation group: 'org.apache.commons', name: 'commons-text', version: '1.10.0'
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
implementation group: 'org.apache.commons', name: 'commons-collections4', version: '4.4'
implementation group: 'org.apache.poi', name: 'poi-ooxml', version: '5.2.3'
/* Testing Framework Dependencies */
testAnnotationProcessor platform("io.micronaut:micronaut-bom:$micronautVersion")
testAnnotationProcessor "io.micronaut:micronaut-inject-groovy"
testAnnotationProcessor "io.micronaut:micronaut-inject-java"
testImplementation("io.micronaut.test:micronaut-test-core")
testImplementation("org.codehaus.groovy:groovy-all:$groovyAllVersion")
testImplementation("org.spockframework:spock-core:$spockCoreVersion")
testImplementation "io.micronaut.test:micronaut-test-spock"
implementation("org.apache.logging.log4j:log4j-core:2.20.0")
testImplementation "io.mockk:mockk:1.13.4"
testImplementation platform("io.micronaut:micronaut-bom:$micronautVersion")
testImplementation "org.junit.jupiter:junit-jupiter-api"
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine"
testImplementation "io.micronaut.test:micronaut-test-junit5"
testImplementation "io.micronaut:micronaut-inject-groovy"
testImplementation "io.micronaut:micronaut-inject-java:$micronautVersion"
}
configurations.all {
exclude group: 'ch.qos.logback'
resolutionStrategy.force "org.yaml:snakeyaml:1.33"
}
properties:
micronautVersion=3.8.5
micronautDataVersion=3.9.6
spekVersion=2.0.19
postgresVersion=42.5.4
slf4jVersion=2.0.6
hibernateVersion=2.2.5
groovyAllVersion=3.0.13
spockCoreVersion=2.4-M1-groovy-3.0
lombokVersion=1.18.26
My service class is annotated as javax Singleton and is being injected in controller with javax Named annotation
I have seen many people suggesting downgrading micronaut but I dont want to opt for that
Beta Was this translation helpful? Give feedback.
All reactions