Closed komushi closed 6 years ago
Hi Lei-
You undoubtedly set the GEODE_HOME
environment variable to the installation directory of Pivotal GemFire (or, in your case, Apache Geode) in the run profile/configuration before you ran your Spring-based GemFire/Geode server.
In effect, this enables the embedded HTTP service, which is part of GemFire/Geode's Management Service (i.e. (embedded) "Manager") to startup. And, I have explicitly enabled the Management Service in my SpringGemFireServerApplication
class, which allows JMX clients (e.g. Gfsh) to connect to this server.
The embedded HTTP service in the Manager starts up anytime it can find the GemFire/Geode provided WAR files in the $GEODE_HOME/tools/Extensions
and $GEODE_HOME/tools/Pulse
directories, and therefore attempts to start these provided Web apps. These WAR files are for GemFire/Geode's Developer REST API, non-public Management REST API, and Pulse, respectively.
However, , since I have not included a specific dependency on Jetty (which GemFire/Geode uses as the default Web container to run these provided Web apps), then the embedded HTTP service fails to start (which [you are aware of|https://github.com/komushi/spring-boot-geode-server/blob/d64aa02ea7c2fe83f70a5ff21d6acbca07839e9a/pom.xml#L49-L68], apparently).
Still, this does not prevent the server from starting...
at io.pivotal.gemfire.main.SpringGemFireServerApplication.main(SpringGemFireServerApplication.java:50)
Caused by: java.lang.ClassNotFoundException: org.eclipse.jetty.server.Handler
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:338)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 50 more
[info 2017/12/21 00:19:35.925 PST <main> tid=0x1] Loading previously deployed jars
[info 2017/12/21 00:19:35.939 PST <main> tid=0x1] Initializing region PdxTypes
[info 2017/12/21 00:19:35.939 PST <main> tid=0x1] Initialization of region PdxTypes completed
[info 2017/12/21 00:19:35.947 PST <main> tid=0x1] Connected to Distributed System [SpringGemFireServerApplication] as Member [10.99.199.8(SpringGemFireServerApplication:95526)<ec><v0>:1024] in Group(s) [[]] with Role(s) [[]] on Host [10.99.199.8] having PID [95526]
[info 2017/12/21 00:19:35.949 PST <main> tid=0x1] Created new Pivotal GemFire version [9.1.1] Cache [SpringGemFireServerApplication]
[info 2017/12/21 00:19:35.981 PST <main> tid=0x1] Falling back to creating Region [Factorials] in Cache [SpringGemFireServerApplication]
[info 2017/12/21 00:19:35.989 PST <main> tid=0x1] Created Region [Factorials]
[info 2017/12/21 00:19:36.017 PST <main> tid=0x1] Initializing region __PR
[info 2017/12/21 00:19:36.018 PST <main> tid=0x1] Initialization of region __PR completed
[info 2017/12/21 00:19:36.044 PST <main> tid=0x1] Partitioned Region /Factorials is born with prId=1 ident:#Factorials
[info 2017/12/21 00:19:36.291 PST <main> tid=0x1] Registering beans for JMX exposure on startup
[info 2017/12/21 00:19:36.297 PST <main> tid=0x1] Starting beans in phase 2147483647
[info 2017/12/21 00:19:36.300 PST <main> tid=0x1] Cache server connection listener bound to address localhost/127.0.0.1:40404 with backlog 1,000.
[info 2017/12/21 00:19:36.307 PST <main> tid=0x1] ClientHealthMonitorThread maximum allowed time between pings: 60,000
[info 2017/12/21 00:19:36.311 PST <main> tid=0x1] CacheServer Configuration: port=40404 max-connections=800 max-threads=0 notify-by-subscription=true socket-buffer-size=32768 maximum-time-between-pings=60000 maximum-message-count=230000 message-time-to-live=180 eviction-policy=none capacity=1 overflow directory=. groups=[] loadProbe=ConnectionCountProbe loadPollInterval=5000 tcpNoDelay=true
[info 2017/12/21 00:19:36.324 PST <main> tid=0x1] Started SpringGemFireServerApplication in 2.505 seconds (JVM running for 3.779)
Additionally, GemFire/Geode cache client applications can still connect to the server and perform cache operations. However, it does prevent Gfsh, or other JMX based clients (e.g. JConsole or JVisualVM) from connecting to this server since, once the embedded HTTP service fails to start, it also causes the Management Service to fail (clearly an uncaught Exception and a bug in GemFire/Geode, IMO!). GemFire/Geode should be more careful to make sure the required dependencies are present (e.g. Jetty) before it attempts to enable/start a service.
Anyway, my initial intention with these examples was not necessarily to enable the provided GemFire/Geode Web apps to run. If a user wishes to use these Web apps, then s/he must provide the necessary dependencies in his/her POM file.
But, since GemFire/Geode is not behaving correctly, and I am enabling the Manager (embedded Management Service) to allow users to administer this server with Gfsh, I suppose I should provide the dependency in case a user sets the GEODE_HOME
environment variable.
3 spring-data-geode(gemfire) 2.0.2.RELEASE
After pulling the previous commit I tried spring-gemfire-clientserver again and had exception like below: