Muhammed Tanrıkulu
Muhammed Tanrıkulu

Reputation: 138

Unrecognized option: --spring.profiles.active=prod Openshift

When i deployed jhipster web application to OpenShift, my app page getting "503 Service Temporarily Unavailable" and when I look at the log files, having the following problem;

==> app-root/logs/mapp.log <==
Unrecognized option: --spring.profiles.active=prod
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Is there any solution you know?

Upvotes: 1

Views: 8322

Answers (1)

mkobit
mkobit

Reputation: 47249

That is not an option recognized by the JVM. In order to set system properties use use -D. From the Java 7 reference:

-Dproperty=value

Sets a system property value.

If value is a string that contains spaces, then you must enclose the string in double quotation marks:

java -Dmydir="some string" SomeClass

In this instance you would use:

-Dspring.profiles.active=prod

It can then be acquired in your application by using the System class:

System.getProperty("spring.profiles.active")

Upvotes: 5

Related Questions