Hello Amat,
Thanks for contacting the Pivotal Support Community!!.
My name is Juan José Ramos Cassella, and I am a GemFire Technical Support Engineer with Pivotal.
That said, I've tested this setup locally and found out that the most important part of the stack trace (which is actually what tells you what's happening!!) was omitted in your post:
Caused by: java.lang.ClassCastException: org.apache.logging.slf4j.SLF4JLogger cannot be cast to org.apache.logging.log4j.core.Logger
at org.apache.geode.internal.logging.LogService.init(LogService.java:82) ~[geode-core-9.5.3.jar:na]
at org.apache.geode.internal.logging.LogService.<clinit>(LogService.java:73) ~[geode-core-9.5.3.jar:na]
... 41 common frames omitted
That said, and as a summary, the problem is that Pivotal GemFire 9.5.3 (transitive dependency pulled through spring-data-gemfire 2.1.6) uses an out of date dependency on Log4j [1], where newer versions of Spring Boot [2] (2.0 onwards) pull in a more recent version of the same library, causing these weird exceptions in runtime.
In order to solve the problem, you basically have three options:
- Upgrade your Pivotal GemFire version to the latest available release 9.7.0, which has an updated Log4j version as well. Please have a look at Spring Data for Pivotal GemFire Version Compatibility Matrix [3] to make sure you're using a fully supported combination.
- Simply exclude the org.springframework.boot:spring-boot-starter-logging dependency all together from your project, which will avoid any sort of logging issues with older, incompatible versions.
- Exclude org.apache.logging.log4j.log4j-to-slf4j dependency directly, technically that's the one causing the issue.
As a side note, you might want to have a look at the newest and greatest Spring Boot for Apache Geode & Pivotal GemFire [4], it greatly simplifies the integration between Spring Boot and Apache Geode / Pivotal GemFire (just to mention one of the cool things it provides).
Hope this helps.
Cheers.
[1]: https://logging.apache.org/log4j
[2]: https://spring.io/projects/spring-boot
[3]: https://github.com/spring-projects/spring-data-gemfire/wiki/Spring-Data-for-Pivotal-GemFire-Version-Compatibility-Matrix
[4]: https://docs.spring.io/autorepo/docs/spring-boot-data-geode-build/1.0.0.RC2/reference/html5/index.html