不好说啊,你把IOException e使用e.printStackTrace()贴出完整的报错信息来看看吧。
光一个IOException可没法猜

解决方案 »

  1.   

    你先直接在ie看看能不能打开你要读取的文件。
    如果可以的话,那就要用e.printStackTrace看看具体什么异常了
      

  2.   

    如果是http访问的话,需要发送get命令
    给你一段简单的HTTP客户程序的代码public class HttpClientHttpURLConnection {
        public static void main(String[] args)
            throws MalformedURLException, ProtocolException, IOException {        URL url = new URL("http://www.debian.org/");        HttpURLConnection urlconn = (HttpURLConnection)url.openConnection();
            urlconn.setRequestMethod("GET");
            urlconn.setInstanceFollowRedirects(false);
            urlconn.setRequestProperty("Accept-Language", "ja;q=0.7,en;q=0.3");        urlconn.connect();        Map headers = urlconn.getHeaderFields();
            Iterator it = headers.keySet().iterator();
            System.out.println("response header:");
            while (it.hasNext()){
                String key= (String)it.next();
                System.out.println("  " + key + ": " + headers.get(key));
            }        System.out.println("response code:[" + urlconn.getResponseCode() + "] " +
                               "response message:[" + urlconn.getResponseMessage() + "]");
            System.out.println("\n---- body ----");        BufferedReader reader =
                new BufferedReader(new InputStreamReader(urlconn.getInputStream()));        while (true){
                String line = reader.readLine();
                if ( line == null ){
                    break;
                }
                System.out.println(line);
            }        reader.close();
            urlconn.disconnect();
        }
    }
      

  3.   

    高手也指点一下我的!~
    帖子:请教一个安全问题(java.net.SocketPermission 异常)(在线等...!) 高手进.....
    http://topic.csdn.net/u/20080803/11/bf7055af-d6e9-4047-86a1-39eaae495b20.html
    请在原帖处回复。解决后,我马上再开帖加分。我那个贴已经结账了。再开帖的话是80分。 
      

  4.   

    哦,好像听别人说tomcat的问题啊,在tomcat根文件夹下好像不能异地访问?要是想访问只能找别的办法