Same here with grails 1.0.4, Ubuntu 8.10 (32 bit) and JDK 1.6 from Sun. After some investigation and test I found the cause (I hope): maximum number of open files per user is exceeded. In Ubuntu the default limit is 1024 files for normal uses and if you think about the Grails environment, all the development files, classes, jars, templates etc., it's quite easy to reach the limit.
Following code simulates the situation (it opens files until a limit is reached):
public class FileListTest {
public static void main(String[] args) throws Exception {
final int N = 2048;
File dir = new File("/home/mikko/src/aplan/aplan-grails/src/groovy");
System.out.println("Trying to open " + N + " files");
InputStream streams[] = new InputStream[N];
for (int i = 0; i < N; i++) {
File f = new File(dir, "test.groovy");
streams[i] = new FileInputStream(f);
String[] files = dir.list();
if (null == files) {
System.err.println("File.list() returned null after " + (i + 1) + " opened files");
break;
}
}
System.out.println("Your system seems to support at least " + N + " open files");
}
}
Did some testing on different systems.
that's all the testing we (Huub & Anton) did for the moment. Seems to be jdk1.6 related. See also
GRAILS-3318.GRAILS-3318.