Sometimes, when you want to restart the tomcat server, the server running process shouting down forcefully.
It happens because the tomcat server is unable to communicate with the Oracle TNS listener.
There are several ways to solve this problem:
1) Try restarting the main OracleServiceXE and the TNS listener service. Once down, run this from the command line: sqlplus system/password@localhost:1521/XEPDB1. Then, try to run the tomcat server again.
2)You can try opening the listener.ora file located at <Your machine path>\product\~\server\network\ADMIN\
& then check computer name is the same as in the HOST attribute.
Repeat the same for tnsnames.ora
3) Check whether the Oracle path is correctly set under Environment Variables on your machine.
How restart the OracleSErviceXE and TNC listener services?
1. Type the Services in the Search field--> Click on the Services app
2. Right-click on the OracleServiceXE-->Choose the restart option
3. Right-click on the OracleOraDB18Home1TNSListener-->Choose the restart option
Note: if the restart option isn't available for the TNC listener service, just restart your computer via the start menu and repeat Step 3.