我正在尝试使用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在一些属性文件中?
答案 0 :(得分:1)
实际上我发现可以通过指定http.proxyHost
和http.proxyPort
系统属性来实现。