我正在尝试使用Moneta API执行货币转换,因此我将其称为:
MonetaryConversions.getExchangeRateProvider("IDENT", "ECB", "IMF", "ECB-HIST", "ECB-HIST90").getExchangeRate(sourceCurrency, targetCurrency);
不幸的是,我得到了这个异常:
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=[http://www.imf.org/external/np/fin/data/rms_five.aspx?tsvflag=Y], loadCount=0, accessCount=1, lastLoaded=0]
at org.javamoney.moneta.internal.loader.LoadableResource.getData(LoadableResource.java:378)
我很确定这是因为我在公司防火墙后面。有没有办法指定代理? Myabe在某些属性文件中?
最佳答案
实际上,我发现可以通过指定http.proxyHost
和http.proxyPort
系统属性来实现。