关于http读取html文件的错误
来源:互联网 发布:硬盘检测软件 编辑:程序博客网 时间:2024/04/30 12:27
我下面的程序是通过网络来获取html文件的
File file=new File(filename);
HttpURLConnection httpConn=null;
try {
URL url = new URL(sourcePicturePath);
httpConn = (HttpURLConnection)url.openConnection();
InputStream is=httpConn.getInputStream();
BufferedInputStream bis=new BufferedInputStream(is);
OutputStream os=new FileOutputStream(file);
BufferedOutputStream bos=new BufferedOutputStream(os);
byte buf[] = new byte[1024 * 4];
int count=0;
while((count=bis.read(buf))>0){
bos.write(buf,0,count);
}
bis.close();
is.close();
bos.close();
os.close();
}catch (Exception e) {
e.printStackTrace();
}
我在本机测试是没有问题的,但在aix上运行就会报以下错误:
java.io.FileNotFoundException: http:/ip:port/project/mng_market/ManageEmail/TaskManage/EmailReadXml.jsp?contentId=13910386967.
html (A file or directory in the path name does not exist.)
at java.io.FileOutputStream.open(Native Method)
at java.io.FileOutputStream.<init>(FileOutputStream.java:205)
at java.io.FileOutputStream.<init>(FileOutputStream.java:157)
at email.application.xml.ReadXml.getHtmlFile(ReadXml.java:326)
at email.application.xml.ReadXml.setHtmlFile(ReadXml.java:268)
at email.application.xml.ResourceThreadPool.addXml(ResourceThreadPool.java:102)
at email.application.xml.ResourceThreadPool.getXml(ResourceThreadPool.java:32)
at email.application.xml.GetXmlObject.getXml(GetXmlObject.java:9)
at cmod.proxy.message.control.MessageSend.sendMessageNew(MessageSend.java:73)
at cmod.proxy.message.thread.MessageTask.perform(MessageTask.java:47)
at cmod.proxy.message.thread.TaskThread.run(TaskThread.java:59)
操作时间2009-07-24 13:16:07 http:/ip:port/project/mng_market/ManageEmail/TaskManage/EmailReadXml.jsp?contentId=13910386967.htm
l (A file or directory in the path name does not exist.)
不知道为什么http后边少了一个/这个符号?
希望高人解决一下错误的原因,aix上部署的是WebSphere 。请个人大侠帮忙解决!!!
在线等!!!!
- 关于http读取html文件的错误
- HTML 5 关于文件读取学习笔记
- 关于http的506错误
- 关于http get的错误
- 关于perl的文件读取
- 关于资源文件的读取
- 关于BMP文件的读取
- 关于properties文件的读取
- 关于windows的系统文件保护。转载:http://hi.baidu.com/w1n_r00tkit/blog/item/b4354900691aa2067aec2c6f.html
- html中关于http-equiv的使用
- 关于MFC读取excel文件后退出程序后出现dispatch错误的解决方法
- 关于Java 工程读取xml文件 运行 伪属性名的错误
- 关于“http错误404-文件或目录未找到”的解决方法
- 关于“http错误404-文件或目录未找到”的解决方法
- 关于win10 php环境配置后运行php文件出现HTTP 错误 401.3 - Unauthorized的解决方法
- java读取html文件
- Scanner读取文件时的错误
- 关于matlab 的M文件的读取
- 基本概念:堆与堆栈
- 参数初始化表
- windbg.txt
- 谢鸣
- Ubuntu安装oracle10G
- 关于http读取html文件的错误
- sql语句
- 随机取数
- vim 的自定义快捷键设置
- Adobe CS3 Design Premium在Windows 2003和XP SP1下无法安装的解决办法
- 笔试面试常考题---------内存对齐
- cisco setting cisco 服务器设置
- 新版.NET 程序员必备工具下载
- VISTA基础版系统。从哪里可以调出原始的IE浏览器?