Page tree

Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


If you do see this entry in the HPCC logs and your jar is included in the classpath, the error is either a) in the import statement syntax in ECL or b) an internal error in your java code causing the problem.

2. You get unexpected errors when running your java in ECL: java.lang.ExceptionInInitializerError, etc.

Put a Main in your java class that runs the same code as is being runned via ECL. Try calling the jar file from the command line on the HPCC Cluster. (java -cp /opt/HPCCSystems/classes/myjava.jar ). Chances are you'll see the same error. If you do, debug the java from here; if the error only occurs when running from ECL, raise an issue at

3. You get a java.lang.NoClassDefFoundError , etc.


2. error when running your Java from ECL; the error doesn't occur when running the same java from the command line.

In one case, where java code was creating an instance of Jboss Drool's specific classes, this error popped up because the contextClassLoader was null. Adding the following code to the Java class fixed the error.

                 if(Thread.currentThread().getContextClassLoader() == null)
                    { Thread.currentThread().setContextClassLoader(String.class.getClassLoader()); } 

More details are in this ticket:


4. You try running your java, and get an out of memory or heapspace error.


Code Block
import java;
STRING segment() := IMPORT(java,'org/hpccsystems/Segmenter.SegmentText:(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;');
STRING clearcache() := IMPORT(java,'org/hpccsystems/Segmenter.ClearCache:(Ljava/lang/Boolean)Ljava/lang/String;');

SEQUENTIAL(output(segment('text to segment')),








You can also view additional java-related HPCC issues that have occurred in JIRA or raise an issue at


to get help resolving a java issue.

A simple Java Integration example