ElasticSearch7.9.3 can't start successfully as a window service in win10 system

hi,

i coonfigure the elasticsearch.yml and jvm.option, can work normally in cmd window, but when i put it as a window service, it can start and running, after several seconds, it stop the service, error log as below, i use openjdk 11 in local environment

[2020-11-18T11:20:16,872][WARN ][stderr] [sw-node-1] java.lang.NoClassDefFoundError: java/util/logging/Logger
[2020-11-18T11:20:16,875][WARN ][stderr] [sw-node-1] 	at com.sun.jna.Native.<clinit>(Native.java:114)
[2020-11-18T11:20:16,876][WARN ][stderr] [sw-node-1] 	at java.base/java.lang.Class.forName0(Native Method)
[2020-11-18T11:20:16,876][WARN ][stderr] [sw-node-1] 	at java.base/java.lang.Class.forName(Class.java:315)
[2020-11-18T11:20:16,877][WARN ][stderr] [sw-node-1] 	at org.elasticsearch.bootstrap.Natives.<clinit>(Natives.java:45)
[2020-11-18T11:20:16,877][WARN ][stderr] [sw-node-1] 	at org.elasticsearch.bootstrap.Spawner.spawnNativeController(Spawner.java:109)
[2020-11-18T11:20:16,877][WARN ][stderr] [sw-node-1] 	at org.elasticsearch.bootstrap.Spawner.spawnNativeControllers(Spawner.java:88)
[2020-11-18T11:20:16,878][WARN ][stderr] [sw-node-1] 	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:173)
[2020-11-18T11:20:16,878][WARN ][stderr] [sw-node-1] 	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393)
[2020-11-18T11:20:16,878][WARN ][stderr] [sw-node-1] 	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170)
[2020-11-18T11:20:16,879][WARN ][stderr] [sw-node-1] 	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161)
[2020-11-18T11:20:16,879][WARN ][stderr] [sw-node-1] 	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
[2020-11-18T11:20:16,879][WARN ][stderr] [sw-node-1] 	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
[2020-11-18T11:20:16,879][WARN ][stderr] [sw-node-1] 	at org.elasticsearch.cli.Command.main(Command.java:90)
[2020-11-18T11:20:16,880][WARN ][stderr                   ] [sw-node-1] 	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126)
[2020-11-18T11:20:16,880][WARN ][stderr] [sw-node-1] 	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
[2020-11-18T11:20:16,881][WARN ][stderr] [sw-node-1] Caused by: java.lang.ClassNotFoundException: java.util.logging.Logger
[2020-11-18T11:20:16,881][WARN ][stderr] [sw-node-1] 	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
[2020-11-18T11:20:16,881][WARN ][stderr] [sw-node-1] 	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
[2020-11-18T11:20:16,882][WARN ][stderr] [sw-node-1] 	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
[2020-11-18T11:20:16,882][WARN ][stderr] [sw-node-1] 	... 15 more

elasticsearch.yml as below:

cluster.name: sw-application
node.name: sw-node-1
network.host: machine ip
http.port: 9500
discovery.seed_hosts: ["machine ip"]
cluster.initial_master_nodes: ["sw-node-1"]
node.master: true
node.data: true
node.ingest: true
transport.tcp.port: 9501
http.cors.allow-origin:  "/.*/"
http.cors.enabled: true
http.cors.allow-headers: Authorization,X-Requested-With,Content-Length,Content-Type
bootstrap.memory_lock: true
bootstrap.system_call_filter: false
xpack.security.enabled: true
xpack.security.transport.ssl.enabled: true

Is there more to your Elasticsearch log that you can share?

@warkolm,

below is the elasticsearch7.9.3-stdout.2020-11-18.log:

2020-11-18 09:58:14,043 main ERROR Could not reconfigure JMX java.lang.NoClassDefFoundError: javax/management/InstanceNotFoundException
	at org.apache.logging.log4j.core.LoggerContext.setConfiguration(LoggerContext.java:558)
	at org.apache.logging.log4j.core.LoggerContext.start(LoggerContext.java:263)
	at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:236)
	at org.elasticsearch.common.logging.LogConfigurator.configure(LogConfigurator.java:129)
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:354)
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170)
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161)
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
	at org.elasticsearch.cli.Command.main(Command.java:90)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126)
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
Caused by: java.lang.ClassNotFoundException: javax.management.InstanceNotFoundException
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:582)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 12 more 

@warkolm i fix it by move jre folder under openjdk-11\bin\ , then it works, thanks

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.