Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entrypoint.sh not respecting JAVA_TOOL_OPTIONS #19

Open
daya opened this issue May 15, 2022 · 4 comments
Open

Entrypoint.sh not respecting JAVA_TOOL_OPTIONS #19

daya opened this issue May 15, 2022 · 4 comments

Comments

@daya
Copy link

daya commented May 15, 2022

Hi I m trying to start Mirth with JAVA_TOOL_OPTIONS='-XX:MinRAMPercentage=50.0 -XX:MaxRAMPercentage=90.0' but if I do so then I am getting these errors

No suitable Java Virtual Machine could be found on your system.
The version of the JVM must be at least 1.8.
Please define INSTALL4J_JAVA_HOME to point to a suitable JVM.

My guess is JAVA_TOOL_OPTIONS and VMOPTIONS are mutually exclusive, but I am not a Java expert. For sure I don't want to be limited by Xmx setting limitations in multiples of 1024 hence trying -XX:MaxRAMPercentage

@cturczynskyj
Copy link
Collaborator

How are you setting these JAVA_TOOL_OPTIONS? Are you adding them to the VMOPTIONS environment variable?

@daya
Copy link
Author

daya commented May 20, 2022

Are you adding them to the VMOPTIONS environment variable?

No I am not. All my environment variables are defined in .env file which is read by Docker

But if set it up without single quotes i.e. JAVA_TOOL_OPTIONS=-XX:MinRAMPercentage=50.0 -XX:MaxRAMPercentage=90.0

then Mirth starts properly, perhaps it's ignoring JAVA_TOOL_OPTIONS settings 😮 🙅

@pladesma
Copy link
Collaborator

I've tested this using a Docker Compose file and a .env file, and it seems to be picking up the JAVA_TOOL_OPTIONS settings. This appears in the logs as Mirth Connect starts up:

mc_1  | Picked up JAVA_TOOL_OPTIONS: -XX:MinRAMPercentage=50.0 -XX:MaxRAMPercentage=90.0
mc_1  | INFO  2022-06-15 23:17:11,086 [Main Server Thread] com.mirth.connect.server.Mirth: Mirth Connect 4.0.1 (Built on April 18, 2022) server successfully started.
mc_1  | INFO  2022-06-15 23:17:11,089 [Main Server Thread] com.mirth.connect.server.Mirth: This product was developed by NextGen Healthcare (https://www.nextgen.com) and its contributors (c)2005-2022.
mc_1  | INFO  2022-06-15 23:17:11,090 [Main Server Thread] com.mirth.connect.server.Mirth: Running OpenJDK 64-Bit Server VM 11.0.14.1 on Linux (5.10.104-linuxkit, amd64), postgres, with charset UTF-8.
mc_1  | INFO  2022-06-15 23:17:11,091 [Main Server Thread] com.mirth.connect.server.Mirth: Web server running at http://172.31.0.3:8080/ and https://172.31.0.3:8443/

These are the contents of the .yaml file and .env files:
connect.yaml

version: "3.1"
services:
  mc:
    image: nextgenhealthcare/connect
    env_file:
      - connect.env
    ports:
      - 8080:8080/tcp
      - 8443:8443/tcp
    depends_on:
      - db
  db:
    image: postgres
    environment:
      - POSTGRES_USER=mirthdb
      - POSTGRES_PASSWORD=mirthdb
      - POSTGRES_DB=mirthdb
    expose:
      - 5432

connect.env

JAVA_TOOL_OPTIONS="-XX:MinRAMPercentage=50.0 -XX:MaxRAMPercentage=90.0"
DATABASE=postgres
DATABASE_URL=jdbc:postgresql://db:5432/mirthdb
DATABASE_MAX_CONNECTIONS=20
DATABASE_USERNAME=mirthdb
DATABASE_PASSWORD=mirthdb
DATABASE_MAX_RETRY=2
DATABASE_RETRY_WAIT=10000
KEYSTORE_STOREPASS=docker_storepass
KEYSTORE_KEYPASS=docker_keypass
VMOPTIONS=-Xmx512m

Then I used docker-compose -f connect.yaml up to start the containers.

@daya
Copy link
Author

daya commented Jun 16, 2022

@pladesma I hope it's not the single quote problem since it works for you with double quotes. I will try with double quotes and see, but the error does seem weird when using single quotes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants