I've created a Maven project and added the following eureka-client dependency as mentioned in
https://github.com/Netflix/eureka/wiki/Configuring-Eureka#configuring-eureka-client
<dependency>
<groupId>com.netflix.eureka</groupId>
<artifactId>eureka-client</artifactId>
<version>1.6.2</version>
</dependency>
To reuse the service registration code, I've copied both ExampleEurekaService and ExampleServiceBase classes from Eureka master branch into my project and changed the necessary package names. But the maven build is failing with following compilation errors:
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleServiceBase.java:[5,20] package javax.inject does not exist
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleServiceBase.java:[6,20] package javax.inject does not exist
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleServiceBase.java:[10,26] package com.netflix.config does not exist
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleServiceBase.java:[17,2] cannot find symbol
[ERROR] symbol: class Singleton
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleServiceBase.java:[22,19] cannot find symbol
[ERROR] symbol: class DynamicPropertyFactory
[ERROR] location: class com.eureka.registration.ExampleServiceBase
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleServiceBase.java:[27,31] cannot find symbol
[ERROR] symbol: class DynamicPropertyFactory
[ERROR] location: class com.eureka.registration.ExampleServiceBase
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleEurekaService.java:[11,26] package com.netflix.config does not exist
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleServiceBase.java:[24,6] cannot find symbol
[ERROR] symbol: class Inject
[ERROR] location: class com.eureka.registration.ExampleServiceBase
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleEurekaService.java:[27,98] cannot access javax.inject.Provider
[ERROR] class file for javax.inject.Provider not found
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleEurekaService.java:[45,9] cannot find symbol
[ERROR] symbol: class DynamicPropertyFactory
[ERROR] location: class com.eureka.registration.ExampleEurekaService
[ERROR] /D:/EclispeWorkspace/NetflixEureka/eureka/src/main/java/com/eureka/registration/ExampleEurekaService.java:[45,67] package com.netflix.config does not exist
Is there any other dependency needs to be added other than eureka-client? Or any other version of eureka-client needs to be used. I've used eureka-client version 1.6.2
Regards,
Sameek
Hi Sameek,
Can you please share the dependencies you have added to resolve the above errors. Even am facing the same issue.
Regards,
Vidya
It's 6 month old thread but whatever I can recall you can try by adding the following dependencies in your pom. There are other dependencies as well in my pom, but I feel the following should fix the issue. If no, pls let me know, will give the other dependencies from my pom based on the new maven errors that comes up.
<dependency>
<groupId>com.netflix.archaius</groupId>
<artifactId>archaius-core</artifactId>
<version>0.7.3</version>
</dependency>
<dependency>
<groupId>javax.inject</groupId>
<artifactId>javax.inject</artifactId>
<version>1</version>
</dependency>
Regards,
Sameek