"Error: Could not find or load main class com.hazelcast.core.server.StartServer" on running the extended docker image for Hazelcast

1,270 views
Skip to first unread message

Manoj Khotele

unread,
Feb 19, 2016, 1:00:29 PM2/19/16
to Hazelcast
I followed the steps, as mentioned in https://hub.docker.com/r/hazelcast/hazelcast/, to build the extended docker image and then run it.
I get this error "Error: Could not find or load main class com.hazelcast.core.server.StartServer".

I don't get such an error, if I run non-extended i.e. "hazelcast/hazelcast:latest" image.

It's really perplexing. 
Why should it stop finding main class com.hazelcast.core.server.StartServer?
Building a new docker image from original hazelcast image to include customized hazelcast.xml should neither move the class nor change the class-path. Right?

Manoj Khotele

unread,
Feb 19, 2016, 1:22:04 PM2/19/16
to Hazelcast
Just in case these log helps...

[ec2-user@ip-172-31-30-71 ~]$ sudo docker build -t ext-hz .
Sending build context to Docker daemon 8.192 kB
Step 1 : FROM hazelcast/hazelcast:latest
 ---> fe018aea2ca9
Step 2 : ADD hazelcast.xml $HZ_HOME
 ---> 231c73f87de9
Removing intermediate container 40dc39557351
Step 3 : CMD java -cp $HZ_HOME/hazelcast-$HZ_VERSION.jar com.hazelcast.core.serv er.StartServer
 ---> Running in f088ed53266a
 ---> 333c9b44eaa5
Removing intermediate container f088ed53266a
Successfully built 333c9b44eaa5
[ec2-user@ip-172-31-30-71 ~]$ sudo docker images
REPOSITORY            TAG                 IMAGE ID            CREATED               VIRTUAL SIZE
ext-hz                latest              333c9b44eaa5        About a minute ago    598 MB
hazelcast/hazelcast   latest              fe018aea2ca9        3 weeks ago           598 MB
[ec2-user@ip-172-31-30-71 ~]$ sudo docker run 333c9b44eaa5

Manoj Khotele

unread,
Feb 19, 2016, 2:00:42 PM2/19/16
to Hazelcast
I myself found the problem.
To run the extended hazelcast docker image, running the class com.hazelcast.core.server.StartServer in Dockerfile should be avoided.
Just comment the last line of the Dockerfile i.e. "CMD java -cp $HZ_HOME/hazelcast-$HZ_VERSION.jar com.hazelcast.core.server.StartServer"; and it works.

Bilal Yasar

unread,
Mar 1, 2016, 4:36:47 PM3/1/16
to Hazelcast
Hi Manoj,
seems your hazelcast jar name was wrong. you can use this command:

CMD java -cp $HZ_HOME/hazelcast-all-$HZ_VERSION.jar com.hazelcast.core.server.StartServer


or simply use:

CMD ./server.sh


seems you already solved the problem, i just wanted to give information.


regards.



--
You received this message because you are subscribed to the Google Groups "Hazelcast" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hazelcast+...@googlegroups.com.
To post to this group, send email to haze...@googlegroups.com.
Visit this group at https://groups.google.com/group/hazelcast.
To view this discussion on the web visit https://groups.google.com/d/msgid/hazelcast/47f98a1c-483a-41dc-9387-cb1c7361b0bb%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



--
-- 

Bilal Yasar
Mahir İz Cad. No:35, Altunizade, İstanbul 
bi...@hazelcast.com 
90 554-7755-725
Reply all
Reply to author
Forward
0 new messages