I am using Kotlin and Moneta 1.4, and have them included in my classpath :
moneta-core-1.4.4.jar
money-api-1.1.jar
In my application I have the following code:
fun doSomething(paymentFee: Double, currency: String) {
val paymentFee: MonetaryAmount = FastMoney.of(paymentFee, currency),
}
When calling the code in one of the environments that I'm using, I'm consistently getting the following error:
"exception": "java.lang.ExceptionInInitializerError: Exception javax.money.UnknownCurrencyException: Unknown currency code: XXX [in thread \"Thread-572\"]
at javax.money.spi.MonetaryCurrenciesSingletonSpi.getCurrency(MonetaryCurrenciesSingletonSpi.java:78)
at javax.money.Monetary.getCurrency(Monetary.java:382)\n\tat org.javamoney.moneta.FastMoney.<clinit>(FastMoney.java:119)
I checked the data and there's no XXX when FastMoney.of() is getting called. Since it's ExceptionInInitializerError (error during static initialization) I presume it's caused by this line in the FastMoney class:
public static final FastMoney MAX_VALUE = new FastMoney(Long.MAX_VALUE, Monetary.getCurrency("XXX"));
However, I don't know why this error only occurs in that one environment, and how to fix it.
I am using Kotlin and Moneta 1.4, and have them included in my classpath :
In my application I have the following code:
When calling the code in one of the environments that I'm using, I'm consistently getting the following error:
I checked the data and there's no XXX when
FastMoney.of()
is getting called. Since it'sExceptionInInitializerError
(error during static initialization) I presume it's caused by this line in theFastMoney
class:However, I don't know why this error only occurs in that one environment, and how to fix it.
Thanks for any help in advance.