New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bean definition [io.micronaut.discovery.eureka.EurekaConfiguration] could not be loaded: Failed to inject value for parameter [embeddedServer] of class: io.micronaut.discovery.eureka.EurekaConfiguration$EurekaRegistrationConfiguration #4295
Bean definition [io.micronaut.discovery.eureka.EurekaConfiguration] could not be loaded: Failed to inject value for parameter [embeddedServer] of class: io.micronaut.discovery.eureka.EurekaConfiguration$EurekaRegistrationConfiguration #4295
Comments
We are using this application as a consumer to AWS SQS queue and we don't have any Eureka configuration |
Are you using |
Yes @graemerocher. |
And are you using aws parameter store within your serverless application? |
Yes @graemerocher. We are using to retrieve some configuration |
@graemerocher, any help on this please? |
@mutyasaisrikar would help if you could provide an example that reproduces the issue. Thanks. |
@graemerocher.. I am trying to prepare a sample project, but I have a doubt. Do I need micronaut-discovery-client for an SQS consumer? |
I doubt it |
@mutyasaisrikar I have an identical issue. Did you find the solution? |
@graemerocher hi =) ! Any chance that I find a workaround for this issue? io.micronaut.context.exceptions.BeanInstantiationException: Bean definition |
if one of you upload an example that reproduces the problem I can take a look |
@graemerocher here example of my project |
+1 I am also experiencing the same issue after adding the parameter-store dependency |
Sadly disabling all things eureka in the
|
@graemerocher can this be moved to an active milestone? |
It seems as a workaround you may be able to remove Working on a proper fix now |
@graemerocher this has not been fixed for me when using AWS param store Should I create another issue?
|
@LtTempletonPeck which version of Micronaut? |
@graemerocher latest micronaut 2.3.0 and discovery client 2.2.2 |
Hi, @graemerocher I have the same problem with the same versions as @LtTempletonPeck. |
Hi @graemerocher this error doesn't happen if I use this config: But with this configuration 'parameter store' is only looking for parameter in this path: '/config/[APPLICATION_NAME]', without Environment nor application. Maybe this error happens because we have this different environments: [ec2, cloud, dev, function, lambda], but for example in my case I only would need dev (my environment where I'm going to deploy this lambda) and ec2 because I need it to Parameter Store configuration. Are there any option to disable cloud, function and lambda environments?? Thanks |
@LtTempletonPeck @jmansiya how does one reproduce the issue? I can't reproduce with the original example associated with this issue |
Hi @graemerocher, I've create this gibhub as demo: https://github.com/jmansiya/micronaut-ssm-demo.git To execute: And the error I have is: "errorType":"io.micronaut.context.exceptions.BeanInstantiationException","errorMessage":"Bean definition [io.micronaut.discovery.eureka.EurekaConfiguration] could not be loaded: Thanks in advance!! |
@jmansiya This appears to be because your project declares another dependency on an older version of
Resolves the problem for me. @LtTempletonPeck you have an example? |
The problem appears to be in |
Sorry I've deleted this dependency, but the error is the same :( |
@jmansiya could you try the 2.2.4-SNAPSHOT version? See https://docs.micronaut.io/latest/guide/index.html#usingsnapshots |
Hi, @graemerocher with this version: I have this error: Message: No bean of type [io.micronaut.runtime.server.EmbeddedServer] exists. 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). |
Can you post the output of |
Sure, [INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ demo --- |
You have older versions on your classpath:
Could you update your POM and push the changes to your example GitHub repository? The version of |
Done, but this versions were change when I change pom parent version to 2.4.0-SNAPSHOT. |
sorry I should have been more clear the snapshot version of discovery client. Do the following updates to your project: From 6c09dfbc0cbfba363a70bf56fcc88edb989de7de Mon Sep 17 00:00:00 2001
From: graemerocher <graeme.rocher@gmail.com>
Date: Mon, 8 Feb 2021 17:31:55 +0100
Subject: [PATCH 1/2] Use micronaut 2.3.1
---
pom.xml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pom.xml b/pom.xml
index df28daa..44bc81f 100644
--- a/pom.xml
+++ b/pom.xml
@@ -10,14 +10,14 @@
<parent>
<groupId>io.micronaut</groupId>
<artifactId>micronaut-parent</artifactId>
- <version>2.2.4-SNAPSHOT</version>
+ <version>2.3.1</version>
</parent>
<properties>
<packaging>jar</packaging>
<jdk.version>11</jdk.version>
<release.version>11</release.version>
- <micronaut.version>2.2.4-SNAPSHOT</micronaut.version>
+ <micronaut.version>2.3.1</micronaut.version>
<exec.mainClass>io.micronaut.function.aws.runtime.MicronautLambdaRuntime</exec.mainClass>
<micronaut.runtime>lambda</micronaut.runtime>
</properties>
--
2.24.3 (Apple Git-128)
From 400dcf94056e65d2ad046b8a8bd1301405be2a23 Mon Sep 17 00:00:00 2001
From: graemerocher <graeme.rocher@gmail.com>
Date: Mon, 8 Feb 2021 17:35:17 +0100
Subject: [PATCH] Use micronaut discovery snapshot
---
pom.xml | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/pom.xml b/pom.xml
index 44bc81f..539b48c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -104,6 +104,12 @@
<version>2.3.0</version>
<scope>compile</scope>
</dependency>
+ <dependency>
+ <groupId>io.micronaut.discovery</groupId>
+ <artifactId>micronaut-discovery-client</artifactId>
+ <version>2.2.4-SNAPSHOT</version>
+ <scope>compile</scope>
+ </dependency>
<!-- <dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-ssm</artifactId>
--
2.24.3 (Apple Git-128) |
Great!! now it's working correctly!! thanks!! Could you tell me when this snapshot will be a finish version? Thanks!!!! |
You can try the 2.2.4 version https://search.maven.org/artifact/io.micronaut.discovery/micronaut-discovery-client/2.2.4/jar |
After the suggestion given at #4276, I have upgraded the version of Micronaut to 2.1.0 which has fixed the issue. But now I am facing another issue.
`Bean definition [io.micronaut.discovery.eureka.EurekaConfiguration] could not be loaded: Failed to inject value for parameter [embeddedServer] of class: io.micronaut.discovery.eureka.EurekaConfiguration$EurekaRegistrationConfiguration
Message: No bean of type [io.micronaut.runtime.server.EmbeddedServer] exists. 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).
Path Taken: new EurekaConfiguration(EurekaConnectionPoolConfiguration eurekaConnectionPoolConfiguration,ApplicationConfiguration applicationConfiguration,[EurekaRegistrationConfiguration eurekaRegistrationConfiguration]) --> new EurekaRegistrationConfiguration([EmbeddedServer embeddedServer],ApplicationConfiguration applicationConfiguration,DataCenterInfo dataCenterInfo,String appName,String hostname,Integer port,String ipAddr,String instanceId,Boolean preferIpAddress): io.micronaut.context.exceptions.BeanInstantiationException
io.micronaut.context.exceptions.BeanInstantiationException: Bean definition [io.micronaut.discovery.eureka.EurekaConfiguration] could not be loaded: Failed to inject value for parameter [embeddedServer] of class: io.micronaut.discovery.eureka.EurekaConfiguration$EurekaRegistrationConfiguration
Message: No bean of type [io.micronaut.runtime.server.EmbeddedServer] exists. 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).
Path Taken: new EurekaConfiguration(EurekaConnectionPoolConfiguration eurekaConnectionPoolConfiguration,ApplicationConfiguration applicationConfiguration,[EurekaRegistrationConfiguration eurekaRegistrationConfiguration]) --> new EurekaRegistrationConfiguration([EmbeddedServer embeddedServer],ApplicationConfiguration applicationConfiguration,DataCenterInfo dataCenterInfo,String appName,String hostname,Integer port,String ipAddr,String instanceId,Boolean preferIpAddress)
at io.micronaut.context.DefaultBeanContext.initializeContext(DefaultBeanContext.java:1549)
at io.micronaut.context.DefaultApplicationContext.initializeContext(DefaultApplicationContext.java:220)
at io.micronaut.context.DefaultBeanContext.readAllBeanDefinitionClasses(DefaultBeanContext.java:2780)
at io.micronaut.context.DefaultBeanContext.start(DefaultBeanContext.java:233)
at io.micronaut.context.DefaultApplicationContext.start(DefaultApplicationContext.java:166)
at io.micronaut.function.executor.AbstractExecutor.startEnvironment(AbstractExecutor.java:125)
at io.micronaut.function.executor.StreamFunctionExecutor.execute(StreamFunctionExecutor.java:80)
at io.micronaut.function.aws.MicronautRequestStreamHandler.handleRequest(MicronautRequestStreamHandler.java:54)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
Caused by: io.micronaut.context.exceptions.DependencyInjectionException: Failed to inject value for parameter [embeddedServer] of class: io.micronaut.discovery.eureka.EurekaConfiguration$EurekaRegistrationConfiguration
Message: No bean of type [io.micronaut.runtime.server.EmbeddedServer] exists. 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).
Path Taken: new EurekaConfiguration(EurekaConnectionPoolConfiguration eurekaConnectionPoolConfiguration,ApplicationConfiguration applicationConfiguration,[EurekaRegistrationConfiguration eurekaRegistrationConfiguration]) --> new EurekaRegistrationConfiguration([EmbeddedServer embeddedServer],ApplicationConfiguration applicationConfiguration,DataCenterInfo dataCenterInfo,String appName,String hostname,Integer port,String ipAddr,String instanceId,Boolean preferIpAddress)
at io.micronaut.context.AbstractBeanDefinition.getBeanForConstructorArgument(AbstractBeanDefinition.java:1035)
at io.micronaut.discovery.eureka.$EurekaConfiguration$EurekaRegistrationConfigurationDefinition.build(Unknown Source)
at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:1898)
at io.micronaut.context.DefaultBeanContext.createAndRegisterSingletonInternal(DefaultBeanContext.java:2647)
at io.micronaut.context.DefaultBeanContext.createAndRegisterSingleton(DefaultBeanContext.java:2633)
at io.micronaut.context.DefaultBeanContext.getBeanForDefinition(DefaultBeanContext.java:2305)
at io.micronaut.context.DefaultBeanContext.getBeanInternal(DefaultBeanContext.java:2279)
at io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:1245)
at io.micronaut.context.AbstractBeanDefinition.getBeanForConstructorArgument(AbstractBeanDefinition.java:1013)
at io.micronaut.discovery.eureka.$EurekaConfigurationDefinition.build(Unknown Source)
at io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:1898)
at io.micronaut.context.DefaultBeanContext.createAndRegisterSingletonInternal(DefaultBeanContext.java:2647)
at io.micronaut.context.DefaultBeanContext.createAndRegisterSingleton(DefaultBeanContext.java:2633)
at io.micronaut.context.DefaultBeanContext.loadContextScopeBean(DefaultBeanContext.java:2172)
at io.micronaut.context.DefaultBeanContext.initializeContext(DefaultBeanContext.java:1543)
... 11 more
Caused by: io.micronaut.context.exceptions.NoSuchBeanException: No bean of type [io.micronaut.runtime.server.EmbeddedServer] exists. 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).
at io.micronaut.context.DefaultBeanContext.getBeanInternal(DefaultBeanContext.java:2290)
at io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:1245)
at io.micronaut.context.AbstractBeanDefinition.getBeanForConstructorArgument(AbstractBeanDefinition.java:1013)
... 25 more
`
The text was updated successfully, but these errors were encountered: