Petar Tahchiev Petar Tahchiev - 1 year ago 116
Java Question

JSR-354 java money moneta specify proxy

I'm trying to perform money conversion with Moneta API, so I call this:

MonetaryConversions.getExchangeRateProvider("IDENT", "ECB", "IMF", "ECB-HIST", "ECB-HIST90").getExchangeRate(sourceCurrency, targetCurrency);

Unfortunately I get this exception:

2016-06-15 17:14:12,659 [main] ERROR: Failed to load resource: IMFHistoricRateProvider
java.lang.IllegalStateException: Failed to load remote as well as fallback resources for LoadableResource [resourceId=IMFHistoricRateProvider, fallbackLocation=jar:file:/C:/Users/e-tahchpet/.m2/repository/org/javamoney/moneta/1.1/moneta-1.1.jar!/java-money/defaults/IMF/rms_five.xls, remoteResources=[], loadCount=0, accessCount=1, lastLoaded=0]
at org.javamoney.moneta.internal.loader.LoadableResource.getData(

I'm pretty sure it is because I am behind a corporate firewall. Is there a way to specify a proxy? Myabe in some property file?

Answer Source

Actually I found out it is possible by specifying the http.proxyHost and http.proxyPort system properties.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download