• Post Reply Bookmark Topic Watch Topic
  • New Topic

RandomAccessFile.read(): Bad file descriptor ?  RSS feed

 
Ben Wood
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a servlet I need to deploy in Tomcat5 on Win 2003 server using java 1.4.2_04. The servlet reads portions of a big 35GB data file off another server on the network using RandomAccessFile and addresses the file using the share name and path like \\share\data\mydata.dat (I first tried a standard path to a mapped drive on the server like H:\data\mydata.dat and got a FileNotFoundException).

Now when the servlet attemtps to read the file I get this error being thrown at RandomAccessFile.read(), which appears to be a native method.


java.io.IOException: Bad file descriptor
at java.io.RandomAccessFile.read(Native Method)
at java.io.RandomAccessFile.readShort(Unknown Source)
at uk.ac.bgs.modelling.grid.Grid.cutRectangle(Grid.java:556)
at uk.ac.bgs.modelling.grid.Grid.streamImage(Grid.java:722)
at DTMServlet.test9(DTMServlet.java:486)
at DTMServlet.actionRequest(DTMServlet.java:204)
at DTMServlet.doPost(DTMServlet.java:54)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:763)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:856)


I don't really know where to start. This code works fine on our Win2K test server, so I'm thinking maybe it has to do with either Windows version, tomcat version (test server is running v4, not 5) or java version (test server is running 1.3.0_02).

Does anyone else have experience of the "Bad file descriptor" problem with RandomAccessFile.read()?
[ November 09, 2004: Message edited by: Ben Wood ]
 
Ben Wood
Ranch Hand
Posts: 342
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this was a premature close() call onthe RandomAccessFile. I suggest anyone experiencing this try commenting out their close() call/s and see what happens.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!