So, is "ant test" supposed to run to completion on a reasonable
dev machine? I don't know that I've ever had it work, and so don't
generally run it.
But I was feeling guilty tonight, so tried again, went away for awhile,
and came back to my RAM (12gb) and CPUs both pegged. And lots of these
in the console:
[junit] Exception in thread "pool-1-thread-569"
java.lang.NullPointerException [junit] at
com.google.gwt.dev.util.DiskCache.transferToStream(DiskCache.java:187)
[junit] at
com.google.gwt.dev.util.DiskCacheToken.writeObject(DiskCacheToken.java:91)
[junit] Exception in thread "pool-1-thread-1" java.lang.RuntimeException: Unable to read from byte cache
[junit] at com.google.gwt.dev.util.DiskCache.transferToStream(DiskCache.java:201)
[junit] at com.google.gwt.dev.util.DiskCacheToken.writeObject(DiskCacheToken.java:91)
[junit] at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[junit] at java.lang.reflect.Method.invoke(Method.java:616)
[junit] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
[junit] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
[junit] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
[junit] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
[junit] at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
[junit] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1493)
[junit] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
[junit] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
[junit] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
[junit] at java.util.ArrayList.writeObject(ArrayList.java:673)
[junit] at sun.reflect.GeneratedMethodAccessor33.invoke(Unknown Source)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[junit] at java.lang.reflect.Method.invoke(Method.java:616)
[junit] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
[junit] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
[junit] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
[junit] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
[junit] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
[junit] at com.google.gwt.dev.javac.CachedCompilationUnit.writeObject(CachedCompilationUnit.java:223)
[junit] at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[junit] at java.lang.reflect.Method.invoke(Method.java:616)
[junit] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
[junit] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
[junit] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
[junit] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
[junit] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
[junit] at com.google.gwt.dev.javac.PersistentUnitCache$6.run(PersistentUnitCache.java:446)
[junit] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
[junit] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
[junit] at java.lang.Thread.run(Thread.java:679)
[junit] Caused by: java.io.EOFException
[junit] at java.io.RandomAccessFile.readInt(RandomAccessFile.java:776)
[junit] at com.google.gwt.dev.util.DiskCache.transferToStream(DiskCache.java:188)
[junit] ... 35 more
Which suggests that we're attempting to read data from the cache before we've added anything..
[junit] Exception in thread "pool-1-thread-3" java.lang.NullPointerException
[junit] at com.google.gwt.dev.util.DiskCache.transferToStream(DiskCache.java:187)
[junit] at com.google.gwt.dev.util.DiskCacheToken.writeObject(DiskCacheToken.java:91)
[junit] at sun.reflect.GeneratedMethodAccessor51.invoke(Unknown Source)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[junit] at java.lang.reflect.Method.invoke(Method.java:616)
[junit] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
[junit] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
[junit] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
[junit] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
[junit] at java.io.ObjectOutputStream.defaultWriteFields(ObjectOutputStream.java:1528)
[junit] at java.io.ObjectOutputStream.defaultWriteObject(ObjectOutputStream.java:438)
[junit] at com.google.gwt.dev.javac.CachedCompilationUnit.writeObject(CachedCompilationUnit.java:222)
[junit] at sun.reflect.GeneratedMethodAccessor65.invoke(Unknown Source)
[junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[junit] at java.lang.reflect.Method.invoke(Method.java:616)
[junit] at java.io.ObjectStreamClass.invokeWriteObject(ObjectStreamClass.java:962)
[junit] at java.io.ObjectOutputStream.writeSerialData(ObjectOutputStream.java:1480)
[junit] at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1416)
[junit] at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1174)
[junit] at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:346)
[junit] at com.google.gwt.dev.javac.PersistentUnitCache$6.run(PersistentUnitCache.java:446)
[junit] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
[junit] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
[junit] at java.lang.Thread.run(Thread.java:679)
The only way this could happen is if the file object is null (line 187) - but that can only really happen if close() is called. It can't be called by another class directly, as it's private, so it must be invoked via the finalizer - but that should only happen on JVM shutdown.
Now, the problem with diagnosing this is that the file is set to be
deleted on exit. So after the program exits, you can't see how
ridiculously huge the file might have been. To test that theory, you
could try commenting out this line to test it, or you could keep track
of the # of bytes written and spit it out when this exception occurs.