hazelcast / hazelcast/hz-docs

Docs: Feedback for Deploying on Docker - Unable to add custom jar to classpath

Open
#1,053 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
11
Forks
112
Avg merge
20h 29m
Merged PRs (30d)
19

Description

Hi, I have some feedback about [this page](https://github.com/hazelcast/hz-docs/edit/main/docs/modules/deploy/pages/deploying-with-docker.adoc)

I tried adding my jar to classpath following this doc but it is not working.

I have following files in present working directory: `my.jar` and `hazelcast.xml`.

First tried using directory as CLASSPATH like this.

```
docker run -d --name hazelcast \
--network hz-network \
-p 5701:5701 \
-v "$(pwd)":/opt/hazelcast/ext \
-e HZ_NETWORK_PUBLICADDRESS=192.168.0.130:5701 \
-e CLASSPATH="/opt/hazelcast/ext/" \
-e JAVA_OPTS="-Dhazelcast.config=/opt/hazelcast/ext/hazelcast.xml" \
hazelcast/hazelcast:5.3
```

Then I tried adding my.jar directly like this

```
docker run -d --name hazelcast \
--network hz-network \
-p 5701:5701 \
-e HZ_NETWORK_PUBLICADDRESS=192.168.0.130:5701 \
-v "$(pwd)/my.jar":/opt/hazelcast-jet/lib/my.jar \
-v "$(pwd)":/opt/hazelcast/ext \
-e JAVA_OPTS="-Dhazelcast.config=/opt/hazelcast/ext/hazelcast.xml" \
hazelcast/hazelcast:5.3
```

I am getting `Caused by: com.hazelcast.core.HazelcastException: java.lang.ClassNotFoundException: com.example.hazelcast.maploader.SettingMapLoader` for my custom MapLoader class.

**Expected behaviour:**

My custom Map Loader should have been added to classpath.

Contributor guide

No contributing guide indexed for this repository

Research direction

Review docs/modules/deploy/pages/deploying-with-docker.adoc and reproduce the reported Docker commands with my.jar, hazelcast.xml, and the custom MapLoader. Verify how the Hazelcast 5.3 image handles the mounted jar and CLASSPATH, then update the page with working instructions and confirm the ClassNotFoundException is resolved.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, java
Domain
devops, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.