Search code examples
javaspring-bootweblogicweblogic12cnetflix-eureka

Unable to register services with Eureka under Weblogic


I have a Eureka server that must be deployed under Weblogic. So, I configured maven to generate a war file and deploy it on WebLogic. Everything worked as expected and I am able to reach the Eureka web application calling URL:

http://localhost:7001/domain/gateway

The problem is with the registration of services. It seems, for some reason, a demo service (insice DiscoveryClient) is not able to reach the URL: http://localhost:7001/domain/gateway/eureka. The strange thing is, if I try to run the server as a Spring boot jar application (and properly configured with the same URL /domain/gateway) services registration works fine.

What could be the issue? Inside WebLogic?

This is the error:

2022-03-17 11:02:51.009  INFO 7676 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_DEMOMS/demoms:3c6a23c2fc062f8b0baf4c5f7af277cb: registering service...
2022-03-17 11:02:51.263  WARN 7676 --- [nfoReplicator-0] c.n.d.s.t.d.RetryableEurekaHttpClient    : Request execution failure with status code 500; retrying on another server if available
2022-03-17 11:02:51.283  WARN 7676 --- [nfoReplicator-0] com.netflix.discovery.DiscoveryClient    : DiscoveryClient_DEMOMS/demoms:3c6a23c2fc062f8b0baf4c5f7af277cb - registration failed Cannot execute request on any known server

com.netflix.discovery.shared.transport.TransportException: Cannot execute request on any known server

My configuration is exactly the same as the other hundreds of configurations found here and on the documentation.

UPDATE: if the service is deployed under the same WebLogic it works as expected so, the problem is definitely due to communication between applications deployed under WebLogic and outside Weblogic.


Solution

  • There is a major issue due to dependencies incompatibility. Unfortunately, Weblogic uses Jersey 2.x but Eureka use 1.9.x and this makes the eureka server under WebLogic unstable.

    This is happening now, with the latest Spring boot version 2.6.x and 2021.0.x Spring Cloud version, maybe in future this will be solved.