cloudcoderdotorg / CloudCoder

A web-based programming exercise system.
GNU Affero General Public License v3.0
71 stars 60 forks source link

NullPointer Exception when compiling Java programs #93

Closed copperx closed 7 years ago

copperx commented 7 years ago

The builder is failing on my end when compiling Java programs; I have no trouble compiling C and C++ programs.

A NullPointer exception is thrown in the InMemoryJavaCompiler class.

Any ideas on why?

2016-09-26 14:52:47,148 Tester DEBUG - Executing 8 build step(s)
2016-09-26 14:52:47,150 Tester DEBUG - Executing build step: FetchExternalLibraryBuildStep
2016-09-26 14:52:47,151 Tester DEBUG - Executing build step: JavaCompilerBuildStep
2016-09-26 14:52:47,151 Builder2 ERROR - Internal error building and testing submission
java.lang.NullPointerException
    at org.cloudcoder.builder2.javacompiler.InMemoryJavaCompiler.<init>(InMemoryJavaCompiler.java:60)
    at org.cloudcoder.builder2.javacompiler.JavaCompilerBuildStep.getJavaCompiler(JavaCompilerBuildStep.java:97)
    at org.cloudcoder.builder2.javacompiler.JavaCompilerBuildStep.execute(JavaCompilerBuildStep.java:70)
    at org.cloudcoder.builder2.model.Tester.execute(Tester.java:65)
    at org.cloudcoder.builder2.server.Builder2.testSubmission(Builder2.java:88)
    at org.cloudcoder.builder2.server.Builder2Server.runOnce(Builder2Server.java:332)
    at org.cloudcoder.builder2.server.Builder2Server.run(Builder2Server.java:276)
    at java.lang.Thread.run(Thread.java:745)
2016-09-26 14:52:47,152 Builder2 INFO  - Sending SubmissionResult back to server
2016-09-26 14:52:47,152 SubmissionResultUtil INFO  - 0 results
copperx commented 7 years ago

Oops. It seems like the builder was using the JRE because I had not installed the JDK. The problem went away after installing the JDK on the server .