This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Servlets and the fly likes Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark ""java.io.IOException: The handle is invalid" in Win 2000" Watch ""java.io.IOException: The handle is invalid" in Win 2000" New topic
Author

"java.io.IOException: The handle is invalid" in Win 2000

Eric Knapp
Greenhorn

Joined: May 06, 2001
Posts: 4
Hello,
I am in instructor at a community college and I have many
students who can't get something to work under Windows 2000 with
jdk1.3. They are trying to perform a simple System.in.read() and
they get this:
java.io.IOException: The handle is invalid
at java.io.FileInputStream.readBytes(Native Method)
at java.io.FileInputStream.read(FileInputStream.java:183)
at java.io.BufferedInputStream.fill(BufferedInputStream.java:186)
at java.io.BufferedInputStream.read(BufferedInputStream.java:204)
at Demo.main(Demo.java:8)
Exception in thread "main"
I can't reproduce this on my Linux box and the students in the
class who are running Windows 98 also are not having any
problems.
Can anyone help?
Thanks...
Phil Hanna
Ranch Hand

Joined: Apr 05, 2001
Posts: 118
Can you post Demo.java?
------------------
Phil Hanna
Sun Certified Programmer for the Java 2 Platform
Author of :
JSP: The Complete Reference
Instant Java Servlets
Website: http://www.philhanna.com


Phil Hanna<BR>Sun Certified Programmer for the Java 2 Platform<BR>Author of :<BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072127686/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">JSP: The Complete Reference</A><BR><A HREF="http://www.amazon.com/exec/obidos/ASIN/0072124253/electricporkchop/107-3548162-1137317" TARGET=_blank rel="nofollow">Instant Java Servlets</A>
Jayson Falkner
Author
Ranch Hand

Joined: May 07, 2001
Posts: 57
I can't remember the fix to this one off the top of my head, but I remember reading it on Sun's Java forums awhile ago. Do a search there and you should be able to find it.
Jayson Falkner
V.P./CTO, Amberjack Software LLC
Jayson@jspinsider.com
www.jspinsider.com

Jayson Falkner<br />jayson@jspinsider.com<br />Author of <a href="http://www.jspbook.com" target="_blank" rel="nofollow">Servlets and JavaServer Pages; the J2EE Web Tier</a>
Eric Knapp
Greenhorn

Joined: May 06, 2001
Posts: 4
Phil Hanna asked me to post the sample app that I used for this. Here it is:
public class Demo {

public static void main(String args[]) throws Exception {
char userInput;
int a = 2;
System.out.println("Please enter a character.");
userInput = (char) System.in.read();
System.in.read();
System.in.read();
System.out.println("You entered: " + userInput);
}
}

The class works just fine where ever I try it. I now have a Win 2000 setup and it works fine for me. Some of my students get the errors that I posted earlier on the first System.in.read().
-Eric
P.S. I guess this wasn't the correct forum for this. I'm new to JavaRanch.
Eric Knapp
Greenhorn

Joined: May 06, 2001
Posts: 4
I have searched every forum that I can find including the one at Sun and I have not been able to find the answer to this one. Any hints would be greatly appreciated!
Thanks,
-Eric
 
 
subject: "java.io.IOException: The handle is invalid" in Win 2000
 
Similar Threads
Axis 1.1 and Attachments
Invalid handle exception
Voice Chat Open Source
Sad news
"java.io.IOException: The handle is invalid" in Win 2000