Why am I getting InvocationTargetException at ClassLoaders.callStaticFunction Java Eclipse?
<p>I have created a program to convert <strong>text to xml by using ReverseXSL API.</strong></p>

<pre><code> import java.io.BufferedReader;
 import java.io.BufferedWriter;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.FileReader;
 import java.io.FileWriter;
 import java.io.IOException;
 import java.io.OutputStream;
 import java.text.DateFormat;
 import java.text.SimpleDateFormat;
 import java.util.Date;

 import javax.xml.parsers.FactoryConfigurationError;
 import javax.xml.parsers.ParserConfigurationException;
 import javax.xml.transform.TransformerFactoryConfigurationError;

 import com.reverseXSL.parser.ParserException;
 import com.reverseXSL.transform.Transformer;
 import com.reverseXSL.transform.TransformerException;
 import com.reverseXSL.transform.TransformerFactory;

 public class MyTest4 {


     public MyTest4() {

     }

     public static int transformXSL(String defFile, String inputFile, String XSLFile, String OutputFile) {

         try {
             System.out.println("Dheeraj's method is called");

             // start time

             FileWriter fw = null;
             try {
                 fw = new FileWriter("D://Countime.txt");
             } catch (IOException e1) {
                 // TODO Auto-generated catch block
                 e1.printStackTrace();
             }
             BufferedWriter output = new BufferedWriter(fw);
             DateFormat sd = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
             Date dt = new Date();
             System.out.println("Date is calculated");

             try {
                 output.write("Start Time:" + sd.format(dt).toString());
             } catch (IOException e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
             }


             System.out.println(sd.format(dt));

             FileReader myDEFReader = null, myXSLReader = null;
             TransformerFactory tf = TransformerFactory.newInstance();
             Transformer t = null;
             FileInputStream inStream = null;
             ByteArrayOutputStream outStream = null;

             // Step 1:

             //instantiate a transformer with the specified DEF and XSLT

             if (new File(defFile).canRead()) {
                 try {
                     myDEFReader = new FileReader(defFile);
                     System.out.println("Definition file is read");
                 } catch (FileNotFoundException e) {

                     e.printStackTrace();
                 }

             } else myDEFReader = null;

             if (new File(XSLFile).canRead())
                 try {
                     myXSLReader = new FileReader(XSLFile);
                     System.out.println("XSL file is read");
                 } catch (FileNotFoundException e) {

                     e.printStackTrace();
                 } else myXSLReader = null;

             try {

                 t = tf.newTransformer(myDEFReader, myXSLReader);
             } catch (IOException e) {

                 e.printStackTrace();
             }

             System.out.println("Step 1: DEF AND XSLT Transformation completed");

             // Step 2:
             // Read Input data

             try {
                 inStream = new FileInputStream(inputFile);
             } catch (FileNotFoundException e) {
                 e.printStackTrace();
             }

             outStream = new ByteArrayOutputStream();

             System.out.println("Step 2: Reading Input file:  completed");

             // Step 3:

             // Transform Input

             try {
                 try (BufferedReader br = new BufferedReader(new FileReader("D://2.txt"))) {
                     String line = null;
                     while ((line = br.readLine()) != null) {
                         System.out.println("Content: " + line);
                     }
                 }

                 System.out.println("File: " + inputFile.toString());
                 System.out.println("\n content: \n" + inStream.toString());
                 System.out.println("Calling Transform Function");
                 t.transform(inStream, outStream);
                 System.out.println("Transformation is called");
                 outStream.close();
                 try (OutputStream outputStream = new FileOutputStream(OutputFile)) {
                     outStream.writeTo(outputStream);

                     System.out.println("Outstream is generated; Output file is creating");
                 }
                 System.out.println(outStream.toString());
             } catch (TransformerException e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
             } catch (ParserException e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
             } catch (IOException e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
             } catch (ParserConfigurationException e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
             } catch (FactoryConfigurationError e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
             } catch (TransformerFactoryConfigurationError e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
             } catch (javax.xml.transform.TransformerException e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
             }


             System.out.println("output file is created");
             // End time

             Date dt2 = new Date();
             System.out.println(sd.format(dt2));

             System.out.println("End time:" + dt2.toString());
             try {
                 output.append("End Time:" + sd.format(dt2).toString());
                 output.close();
             } catch (IOException e) {
                 // TODO Auto-generated catch block
                 e.printStackTrace();
             }
         } catch (Exception e) {
             // TODO Auto-generated catch block
             e.printStackTrace();
         }
         return 0;
     }
</code></pre>

<p>This program is to be <strong>executed by an application by calling static method (static int transformXSL)</strong>.</p>

<p><em>I am able to execute and produce output with running from Eclipse.
However, When I ran program (jar) by using application it stuck somewhere and I couldnt find anything.</em></p>

<p>Then, I debugged by "<strong>Debug as...-> Remote Java Application</strong>" in Eclipse from Application and found <strong>"InvocationTargetException" at ClassLoaders.callStaticFunction.</strong></p>

<p><a href="https://i.stack.imgur.com/ctrr8.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ctrr8.png" alt="InvocationTargetException"></a>
It doesn't have any stack trace, I cant find where this error coming from and what it is all about.</p>