What happened to java.net.SocketTimeoutException?

J

jdege

This morning, Sun's auto-update installed a new JRE on my machine -
1.5.0_04.

Now all of my Java apps that use sockets are failing with:

Exception in thread "main" java.lang.NoClassDefFoundError:
java/net/SocketTimeoutException

The code still compiles, so the SocketTimeoutException class has to be
visible to the compiler, but it won't run, so it clearly isn't visible
to the run-time.

What gives?
 
O

Oliver Wong

This morning, Sun's auto-update installed a new JRE on my machine -
1.5.0_04.

Now all of my Java apps that use sockets are failing with:

Exception in thread "main" java.lang.NoClassDefFoundError:
java/net/SocketTimeoutException

The code still compiles, so the SocketTimeoutException class has to be
visible to the compiler, but it won't run, so it clearly isn't visible
to the run-time.

What gives?

When you run the program, is the classpath set appropriately?

- Oliver
 
J

jan V

This morning, Sun's auto-update installed a new JRE on my machine -
1.5.0_04.

Now all of my Java apps that use sockets are failing with:

Exception in thread "main" java.lang.NoClassDefFoundError:
java/net/SocketTimeoutException

The code still compiles, so the SocketTimeoutException class has to be
visible to the compiler, but it won't run, so it clearly isn't visible
to the run-time.

What gives?

The new JRE doesn't have the class, whereas your JDK or other development
environment has ? Have a look in the RT.JAR and see if you can find
SocketTimeoutException.class.
 
T

Thomas Hawtin

This morning, Sun's auto-update installed a new JRE on my machine -
1.5.0_04.

Now all of my Java apps that use sockets are failing with:

Exception in thread "main" java.lang.NoClassDefFoundError:
java/net/SocketTimeoutException

The code still compiles, so the SocketTimeoutException class has to be
visible to the compiler, but it won't run, so it clearly isn't visible
to the run-time.

Your JRE is updated, but that doesn't include the compiler. Use
-Xbootclasspath to point javac at your JRE's rt.jar.

I guess the update could have messed up. Try a "jar tf rt.jar | grep
SocketT", or equivalent. Might be worth switching Class Data Sharing off
with, IIRC, -Xshare:eek:ff (or -server if it is present). I hope it isn't a
Windows on-line installer problem.

Tom Hawtin
 
J

Jeff Dege

Your JRE is updated, but that doesn't include the compiler. Use
-Xbootclasspath to point javac at your JRE's rt.jar.

I guess the update could have messed up. Try a "jar tf rt.jar | grep
SocketT", or equivalent. Might be worth switching Class Data Sharing off
with, IIRC, -Xshare:eek:ff (or -server if it is present). I hope it isn't a
Windows on-line installer problem.

I installed the new JDK, did some searches and found all the various JRE's
that different vendors had installed, and cleaned up my paths and
classpaths, and the problem went away.

--
Of all the dogs I have known the terrier has the best memory for friends.
Even casual friends are not forgotten if once accepted. As for the
master, what can exceed the patience and fidelity of the terrier if
once his heart is given; and if he is a little jealous and exclusive,
after all that is not peculiar to dogs.
-T.F. Dale
 
J

jan V

I installed the new JDK, did some searches and found all the various JRE's
that different vendors had installed, and cleaned up my paths and
classpaths, and the problem went away.

Problems that "go away" aren't very helpful when it comes to understanding
causes.. you had a worrying, interesting problem, and now you've wiped the
evidence. Did you at least follow Thom's, Oliver's and my advice to diagnose
the problem ?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,039
Latest member
CasimiraVa

Latest Threads

Top