hi,
im using eclipse 3.6.0, jdk 6, build target is android 2.2, i'm developing under windows 7. im trying to fetch a xml file like the following:
SAXParserFactory spf = SAXParserFactory.newInstance();
try {
//get a new instance of parser
SAXParser sp = spf.newSAXParser();
//parse the file and also register this class for call backs
sp.parse("http://ipaddress/my/valid/path.xml", this);
}catch(SAXException se) {
se.printStackTrace();
}catch(ParserConfigurationException pce) {
pce.printStackTrace();
}catch (IOException ie) {
ie.printStackTrace();
}
but i'm getting permission denied error (caused by socket exception) in the debugger. apart from that i also get sntpclient error: address family not supported by protocol. here the detailed logs: 09-29 16:13:40.181: WARN/System.err(304): java.io.IOException: Couldn't open http://213.137.198.141:8085/MarketDataServiceV3.asmx/GetIntraday?instrument=FSPAA.ST&from=2010-09-01&to=2010-09-20&authentication=D41D8CD98F00B204E9800998ECF8427E&nocache=true 09-29 16:13:40.200: WARN/System.err(304): at org.apache.harmony.xml.ExpatParser.openUrl(ExpatParser.java:759) 09-29 16:13:40.210: WARN/System.err(304): at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:291) 09-29 16:13:40.210: WARN/System.err(304): at javax.xml.parsers.SAXParser.parse(SAXParser.java:392) 09-29 16:13:40.220: WARN/System.err(304): at javax.xml.parsers.SAXParser.parse(SAXParser.java:268) 09-29 16:13:40.230: WARN/System.err(304): at aiCharts.GettingStarted.MySAXParser.parseDocument(MySAXParser.java:45) 09-29 16:13:40.239: WARN/System.err(304): at aiCharts.GettingStarted.DataFactory.getChartDataByWebService(DataFactory.java:30) 09-29 16:13:40.249: WARN/System.err(304): at aiCharts.GettingStarted.GettingStartedActivity.onCreate(GettingStartedActivity.java:42) 09-29 16:13:40.249: WARN/System.err(304): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) 09-29 16:13:40.260: WARN/System.err(304): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627) 09-29 16:13:40.270: WARN/System.err(304): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679) 09-29 16:13:40.279: WARN/System.err(304): at android.app.ActivityThread.access$2300(ActivityThread.java:125) 09-29 16:13:40.279: WARN/System.err(304): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033) 09-29 16:13:40.289: WARN/System.err(304): at android.os.Handler.dispatchMessage(Handler.java:99) 09-29 16:13:40.289: WARN/System.err(304): at android.os.Looper.loop(Looper.java:123) 09-29 16:13:40.301: WARN/System.err(304): at android.app.ActivityThread.main(ActivityThread.java:4627) 09-29 16:13:40.301: WARN/System.err(304): at java.lang.reflect.Method.invokeNative(Native Method) 09-29 16:13:40.320: WARN/System.err(304): at java.lang.reflect.Method.invoke(Method.java:521) 09-29 16:13:40.320: WARN/System.err(304): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868) 09-29 16:13:40.331: WARN/System.err(304): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626) 09-29 16:13:40.339: WARN/System.err(304): at dalvik.system.NativeStart.main(Native Method) 09-29 16:13:40.351: WARN/System.err(304): Caused by: java.net.SocketException: Permission denied 09-29 16:13:40.370: WARN/System.err(304): at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocketImpl(Native Method) 09-29 16:13:40.390: WARN/System.err(304): at org.apache.harmony.luni.platform.OSNetworkSystem.createStreamSocket(OSNetworkSystem.java:186) 09-29 16:13:40.390: WARN/System.err(304): at org.apache.harmony.luni.net.PlainSocketImpl.create(PlainSocketImpl.java:265) 09-29 16:13:40.399: WARN/System.err(304): at java.net.Socket.checkClosedAndCreate(Socket.java:873) 09-29 16:13:40.409: WARN/System.err(304): at java.net.Socket.connect(Socket.java:1020) 09-29 16:13:40.409: WARN/System.err(304): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnection.(HttpConnection.java:62) 09-29 16:13:40.419: WARN/System.err(304): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpConnectionPool.get(HttpConnectionPool.java:88) 09-29 16:13:40.431: WARN/System.err(304): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getHTTPConnection(HttpURLConnectionImpl.java:927) 09-29 16:13:40.441: WARN/System.err(304): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:909) 09-29 16:13:40.441: WARN/System.err(304): at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnectionImpl.getInputStream(HttpURLConnectionImpl.java:1152) 09-29 16:13:40.450: WARN/System.err(304): at org.apache.harmony.xml.ExpatParser.openUrl(ExpatParser.java:757) 09-29 16:13:40.450: WARN/System.err(304): ... 19 more 09-29 16:14:26.580: DEBUG/SntpClient(59): request time failed: java.net.SocketException: Address family not supported by protocol
i can parse the file when i run it separately as a java application. i have also permitted to access an internet in the manifest. the entry is:
uses-permission android:name="INTERNET"
could someone give me any clue?
thanks in advance!
greetings magda muskala