1

I have a Spring Boot App generated by JHipster. It works fine but after adding the firebase-admin dependency in the Gradle build file I cannot run or debug this application in Eclipse. The error is 'Could not find or load main class' caused by 'java.lang.ClassNotFoundException'. The missing class is the annotated SpringBootApplication class I'm clicking on in Eclipse.

The application runs if I start Gradle from the command line or Eclipse or deploy the app to the cloud but without 'Debug as' in Eclipse I cannot use hot code replacement for development.

When I remove the dependency the 'Run/Debug as' in Eclipse works fine. I need this dependency to connect to the Firebase Firestore.

dassum
  • 4,727
  • 2
  • 25
  • 38
msz
  • 11
  • 3
  • What is your version of `firebase-admin` dependency inside `build.gradle` file? I'd recommend to change to the latest which includes all necessary stuff. Moreover, try to update Spring dependencies to the `4.0` versions and higher. – invzbl3 Dec 25 '19 at 15:32
  • the `firebase-admin` dependency is the newest `6.12.0`, the `spring-boot` dependencies are `2.1.11` and `spring-core` is `5.1.12`, all from Dec. 2019, so up to date, the project is created with the newest JHipster generator so they should not be outdated dependencies – msz Dec 25 '19 at 16:04
  • if you change `spring-boot` version to [2.2.0 or 2.2.1](https://mvnrepository.com/artifact/org.springframework.boot/spring-boot) instead of `2.1.11` and `spring-core` version to [5.2.0 or 5.2.1](https://mvnrepository.com/artifact/org.springframework/spring-core) instead of `5.1.12`, are you facing the same issue? Did you try to use [6.8.1](https://mvnrepository.com/artifact/com.google.firebase/firebase-admin) version of `firebase-admin`? – invzbl3 Dec 25 '19 at 16:32
  • no changes, I think Spring itself is not the problem, I'm wondering why this single dependency (`firebase-admin`) is causing this issue in Eclipse – msz Dec 25 '19 at 16:47
  • What is your [JDK/JRE](https://stackoverflow.com/a/8090885/8370915) version? I've found some answers related to similar Eclipse issue [here](https://stackoverflow.com/a/16695199/8370915) and [here w/ maven](https://stackoverflow.com/a/34406127/8370915), but still. Also try to play w/ configuration inside `build.gradle file` as mentioned [here](https://stackoverflow.com/q/24924932/8370915). – invzbl3 Dec 25 '19 at 17:17
  • As suggested in the JHipster documentation I'm using a ´AdoptOpenJDK 11´ and also tried it with an ´Oracle JDK 8´. Also played a lot with the ´build.gradle´ but couldn't find a solution for my problem. – msz Dec 27 '19 at 22:27
  • Could you add, please, your full `build.gradle` file to your question and [minimal reproducible code](https://stackoverflow.com/help/minimal-reproducible-example)? That would be helpful. – invzbl3 Dec 30 '19 at 02:59
  • The `build.gradle` is publicly available at [github](https://github.com/mathias-schulze/kicker-app/blob/master/build.gradle). You also find the hole project there. Because it's initially generated there's a lot of source code. – msz Dec 31 '19 at 10:21
  • I suppose your particular problem was because of incorrect configuration inside IDE Eclipse and it wasn't related to the code, rather to the launch settings of this project while importing. Because I don't have such error just NPE while running this project because of [nonexistent file](https://github.com/mathias-schulze/kicker-app/blob/master/src/main/java/de/msz/kickerapp/service/FirestoreService.java#L53) by this [path](https://github.com/mathias-schulze/kicker-app/tree/master/src/main/resources). But I'm using Intelij IDEA as IDE. – invzbl3 Jan 02 '20 at 03:06

0 Answers0