Tomcat Crashing after SSH Disconnection

133 Views Asked by At

I am using apache-tomcat-8.5.15 ; with java version being 1.8. The tomcat contains a war that has the following function:

public static boolean GenFVUFile(String txtFilePath, String errFilePath, String outputFilepath) {
        try {
            
            String[] inputParameters = {txtFilePath + fileName + ".txt", errFilePath + fileName + ".err", outputFilepath + fileName + ".fvu", "0", "1.73"};
            PAOFvu pao = new PAOFvu();
            System.out.println("inputParameters1:: "+inputParameters);
            pao.main(inputParameters);
                   
            
            File errFile = new File(errFilePath + fileName + ".err");
            boolean exists = errFile.exists();
            System.out.println("Old file Name :: " + fileName);
            if (exists) {
                boolean status = GenErrFile(txtFilePath, errFilePath);
                GenTextFile(accDay,acctMonth, acctYear);

                System.out.println("New file Name :: " + fileName);
               GenFVUFile(txtFilePath, errFilePath, outputFilepath);
               
            }
        

The tomcat is deployed in a Linux Server. The code line: PAOFvu pao = new PAOFvu() has java.awt component and requires X11 display variable; hence unsetting display variable will not result in successful execution of the code. Also for the tomcat is being run on -Djava.awt.headless=true mode. The issue is: the code only works if the server having the tomcat being connected through SSH remote connection. The tomcat crashes upon disconnection of SSH remote.

0

There are 0 best solutions below