Thanks for reporting an issue for Micronaut, please review the task list below before submitting the
issue. Your issue report will be closed if the issue is incomplete and the below tasks not completed.
NOTE: If you are unsure about something and the issue is more of a question a better place to ask questions is on Stack Overflow (http://stackoverflow.com/tags/micronaut) or Gitter (https://gitter.im/micronautfw/). DO NOT use the issue tracker to ask questions.
It's necessary to have a eureka server started.
Start the service and registered to eureka server
The register to eureka server fails
When I compile without native-image and use java-jar command the application works, but when I compile with native-image from graalvm-ce-19.2.1 the application doesn't work correctly.
08:27:43.837 [main] INFO io.micronaut.runtime.Micronaut - Startup completed in 46ms. Server Running: http://mn-first-rest-3:8080
08:27:48.862 [nioEventLoopGroup-2-3] INFO i.m.d.registration.AutoRegistration - Instance [mn-first-rest-3] no longer registered with Eureka. Attempting re-registration.
08:27:48.891 [nioEventLoopGroup-2-4] ERROR i.m.d.registration.AutoRegistration - Error reporting state to Eureka:
io.micronaut.http.client.exceptions.HttpClientResponseException:
at io.micronaut.http.client.DefaultHttpClient$10.channelRead0(DefaultHttpClient.java:1816)
at io.micronaut.http.client.DefaultHttpClient$10.channelRead0(DefaultHttpClient.java:1756)
at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
at io.micronaut.http.netty.stream.HttpStreamsHandler.channelRead(HttpStreamsHandler.java:185)
at io.micronaut.http.netty.stream.HttpStreamsClientHandler.channelRead(HttpStreamsClientHandler.java:180)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:438)
is there any piece of news about this issue?
Not yet, will take a look soon...
Is there any update on this?
Any workarounds for registering to Eureka from native compiled micronaut application?
Thanks
I would love to see this fixed as well, I've been trying to fix it but I don't think I'm on the right path so far.
@ilopmar could you take a look at this one?
@graemerocher sure, added to my list.
In the meantime the following code snippet will help you to register to Eureka (it compiles to native code) .
https://github.com/sandhya-grl/micronaut_eureka_client/blob/master/EurekaRegistration.java
I've submitted a PR with the fix: https://github.com/micronaut-projects/micronaut-core/pull/3379
@ustari28 @prakis @anthonyrichir I've also created a test application that I'll add to our test suite once the PR is merged: https://github.com/micronaut-graal-tests/micronaut-service-discovery-eureka/ (look at master or 1.3.x depending the Micronaut version you are using)
Most helpful comment
@graemerocher sure, added to my list.