1

I added tomcat 8 and 9 both in my eclipse oxygen and tried to run Spring based Web Application on the tomcat server but its giving error in console:

Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit

In popup it gives the error:

'Server Tomcat v9.0 Server at localhost' has encountered a problem Server Tomcat v9.0 Server at localhost failed to start.

How to fix this?

bawlo
  • 107
  • 3
  • 10
  • 1
    Can you post your stack trace? – Joey Pinto May 15 '18 at 02:37
  • Most of the time this is a result of an improper mapping of a servlet – Joey Pinto May 15 '18 at 02:37
  • The only thing I am getting in console is: Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. -Djava.endorsed.dirs=/Users//Desktop/tomcat/apache-tomcat-9.0.8/endorsed is not supported. Endorsed standards and standalone APIs in modular form will be supported via the concept of upgradeable modules. – bawlo May 15 '18 at 02:57
  • Which version of Oxygen? Possible duplicate of https://stackoverflow.com/questions/50085750/ (same solution should correct cases with Java 9 as well). – nitind May 15 '18 at 03:01
  • What do you mean by "fixed JVM problem"? And shouldn't this new problem be a different question? – nitind May 15 '18 at 04:08
  • @nitind JVM problem: Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. I have fixed this – bawlo May 15 '18 at 06:40
  • I understand which problem you fixed, I'm curious about how you fixed it. As might anyone else with this original problem. – nitind May 15 '18 at 06:42
  • Problem not yet fixed. I am getting this error in console . Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit. -Djava.endorsed.dirs=/Users//Desktop/tomcat/apache-tomcat-8.0.52/endorsed is not supported. Endorsed standards and standalone APIs in modular form will be supported via the concept of upgradeable modules. – bawlo May 15 '18 at 09:55
  • any fix yet? I just had this issue too. – Mathyou Jun 02 '18 at 01:13
  • Yes its fixed. For me it was related to java version. It was Java 10 in mac. I installed 8 and it started working!! – bawlo Jun 05 '18 at 00:03

1 Answers1

0

Please do a "ping localhost" on a terminal. if it is responding something like

ping: cannot resolve localhost: Unknown host

Chances are you don't have "127.0.0.1 localhost" line in your hosts file (/etc/hosts). So, just add it there. Sometimes the line is there but it is still not working. The issue can be with the "Line Endings" on /etc/hosts file. Check it using Sublime (View/Line Endings). If it is set to "Mac OS" just change it to "Unix". After do this, try again to ping localhost. If it is going as expected just try again Running/Debugging on Server in Eclipse.

lm2a
  • 835
  • 1
  • 10
  • 19