Why do I receive a Java exception while using Datafeed Toolbox to retrieve data from Yahoo when I specify an IP address in the connection?

17 次查看(过去 30 天)
Using the Datafeed Toolbox, I connect to Yahoo and attempt to retrieve data using:
c = yahoo('<http://quote.yahoo.com','192.168.3.15',8080>);
d = fetch(c,'msft','05/01/04','05/31/04')
I receive the following Java exception:
??? Java exception occurred:
java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at ice.net.ConnectionManager.createSocket(OEAB)
at ice.net.ConnectionManager.getConnection(OEAB)
at ice.net.HttpURLConnection.connect(OEAB)
at ice.net.HttpURLConnection.getInputStream(OEAB)
at java.net.URL.openStream(Unknown Source).
Error in ==> yahoo.fetch>wwwread at 293
is = www.openStream;
Error in ==> yahoo.fetch at 243
[tmpdat,h] = wwwread(fetchurl,numinputs,c);

采纳的回答

MathWorks Support Team
This bug has been fixed for Release 14 SP1 (R14SP1). For previous releases, please read below for any possible workarounds:
This is a bug in the way that the FETCH function for the Yahoo datafeed in the way the Datafeed Toolbox 1.5 (R14) constructs the URL when an IP address is specified for the connection.
Some customers have found that commenting out lines 288-290 and line 292 of the following file:
$MATLAB\toolbox\datafeed\datafeed\@yahoo\fetch.m
where $MATLAB is your MATLAB root directory, resolves this issue.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 .NET Client Programming 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by