编译程序报错如下:
java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2438)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1245)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at com.tzsw.BigScreen.displayfile(BigScreen.java:968)
at com.tzsw.BigScreen$17.run(BigScreen.java:939)
at java.util.TimerThread.mainLoop(Timer.java:432)
at java.util.TimerThread.run(Timer.java:382)
到底什么原因有没有人知道,我用的服务器事Tomcat,数据库用Oracle,程序在Eclipse下跑的!
谁有解决方案???
java.io.EOFException
at java.io.ObjectInputStream$BlockDataInputStream.peekByte(ObjectInputStream.java:2438)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1245)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at com.tzsw.BigScreen.displayfile(BigScreen.java:968)
at com.tzsw.BigScreen$17.run(BigScreen.java:939)
at java.util.TimerThread.mainLoop(Timer.java:432)
at java.util.TimerThread.run(Timer.java:382)
到底什么原因有没有人知道,我用的服务器事Tomcat,数据库用Oracle,程序在Eclipse下跑的!
谁有解决方案???
解决方案 »
- [求助]:swt其他线程改变组件内容(如何非阻塞的判断线程池结束)
- 如何以空格为判断依据来保存单词(新手提问)
- 文件读取中遇到的一个小问题(在线等!~)
- MSSQL 关于从数据库中随机抽取数据的问题 急 高手来!!
- 请教:客户端、服务端同时初始化ObjectOutputStream、ObjectInputStream时卡住了 why~~~~~
- 我想在Panel上面显示一副JPEG图,怎么也显示不出来,请教大家
- 只用struts如何做级次的菜单树?
- 看JAVA编程思想附录A中关于拷贝构造内容(第三版)的一个疑问?
- 请教Class.forName()的含义及用法(菜鸟问题)!
- 补充:JBuilder5 中没有JDataStore吗?如果有那JDataStore的序列号和KEY是什么?(和前一次提问一起给分)
- 如何匹配html标签?
- 我的ftp代码一上传就报告NullPointer错误,到底是什么原因?50分
public void displayfile() throws Exception {
URL url = new URL(serverURL + "/screenfileservlet?deptid="+this.deptid+"&filenum="+this.filenum);
URLConnection con = url.openConnection();
con.setUseCaches(false);
InputStream in = con.getInputStream();
ObjectInputStream objStream;
objStream = new ObjectInputStream(in);
ScreenFile screenFile= (ScreenFile)objStream.readObject();
if(screenFile.getCurfilenum()>screenFile.getTotalfilenum()) {
this.filenum=1;
displayfile();
}
else {
String texttemp=screenFile.getFilecontent();
bigscreen.setContentType("text/html");
//如果文件过大,分成几屏,连续显示
//System.out.println("asdfsdfasdf");
//System.out.println((int)(texttemp.length()/fileContentLength)+1);
if(texttemp.length()>fileContentLength && fileContentNum<=(int)(texttemp.length()/fileContentLength)) {
if(fileContentNum==0) {
fileColor=texttemp.substring(texttemp.indexOf("\"")+1,texttemp.indexOf("\"",texttemp.indexOf("\"")+1));
texttemp=texttemp.substring(fileContentNum*fileContentLength,(fileContentNum+1)*fileContentLength);
bigscreen.setText(texttemp+"</font>");
timerflag=2;
fileContentNum++;
}
else if(fileContentNum==(int)(texttemp.length()/fileContentLength)) {
texttemp=texttemp.substring(fileContentNum*fileContentLength,texttemp.length());
bigscreen.setText("<font color='"+fileColor+"'>"+texttemp);
timerflag=1;
fileContentNum=0;
filenum++;
}
else {
texttemp=texttemp.substring(fileContentNum*fileContentLength,(fileContentNum+1)*fileContentLength);
bigscreen.setText("<font color='"+fileColor+"'>"+texttemp+"</font>");
timerflag=2;
fileContentNum++;
}
}
else {
bigscreen.setText(screenFile.getFilecontent());
filenum++;
}
}
}
感觉就是这儿有问题!
测试,应该是你的readObject()方法读取越位了