0

I have developed aSspring restful standalone web services using Eclipse using Java 20. Thereafter I configured the application as a WAR file. Having completed, I decided to deploy on a Tomcat server.

Below is the error I am getting on the Tomcat Web Application Manager:

Encountered exception [org.apache.catalina.LifecycleException: Failed to start component [StandardEngine[Catalina].StandardHost[localhost]

What could be the problem here?

I have restarted the Tomcat application server to confirm whether there could be any correlation with restarting it.

andrewJames
  • 19,570
  • 8
  • 19
  • 51
  • Please provide the full message and its surrounding context. Usually, part of that fuller message is a comment that you should look in the log files for more information. Assuming this is the case, have you done so? Tomcat's `catalina*.log` files should have more specific error messages which you can add to your question. You can check the `manager.*.log` files also. – andrewJames May 18 '23 at 15:08
  • Here is the log information from catalina log file, I had to cut it a bit so I could paste here 18-May-2023 15:19:52.134 SEVERE [Catalina-utility-1] org.apache.catalina.startup.HostConfig.deployWAR Error deploying web application archive Caused by: java.lang.UnsupportedClassVersionError: org/springframework/web/SpringServletContainerInitializer has been compiled by a more recent version of the Java Runtime (class file version 61.0), this version of the Java Runtime only recognizes class file versions up to 58.0 (unable to load class [org.springframework.web.SpringServletContainerInitializer] – Chinwendu Ochonma May 18 '23 at 15:18
  • Please add the new information to your question, as formatted text. Don't use comments for this. Having said that, this is a common error with many questions (and answers) already on Stack Overflow - you should be able to research it and find a good solution. If you still cannot solve this yourself, then you can clarify by editing your question again - and showing us what you _specifically_ tried, and what _specifically_ happened. – andrewJames May 18 '23 at 15:24
  • Example: [Class has been compiled by a more recent version of the Java Environment](https://stackoverflow.com/q/47457105/12567365) – andrewJames May 18 '23 at 15:26
  • Does this answer your question? [Class has been compiled by a more recent version of the Java Environment](https://stackoverflow.com/questions/47457105/class-has-been-compiled-by-a-more-recent-version-of-the-java-environment) – borchvm May 19 '23 at 06:13

1 Answers1

0

In searching for solution, I had to check that the java version I used in Eclipse matches Tomcat application server java runtime.

I used version 20 in my eclipse, then I did same here and the issue was resolved. Tomcat Java Runtime