Deployment of my application in existing tomcat

南楼画角 提交于 2020-01-06 06:53:19

问题


I want to deploy my web application in a real TOMCAT 6 server which uses other applications. The problem is, when I put my WAR-file in webbApps, I get an error in the log file and I get an error 404:

java.lang.UnsupportedClassVersionError: metier/utilisateurs/Compte :        Unsupported  major.minor version 51.0 (unable to load class metier.utilisateurs.  Compte)   at org.apache.catalina.loader. WebappClassLoader.findClassInternal(   WebappClassLoader.java:2822)...

I googled this and I found that there is no compatible JDK and compiler of JSP.

My question is: Can I deploy my application in a different tomcat (7) server and use 2 tomcat in the same server? I tried this but when I start my new tomcat (tomcat7/bin/startup), the server starts the old tomcat automatically!


回答1:


You compiled your war using Java 7 and you are trying to run it inside a Tomcat 6 with Java 6. Configure your Tomcat 6 to point to the java 7 installation and it should work there as well.

Also, it is possible to have two Tomcats running on the same machine, but on different ports. If you do this, you should use a load balancer or a proxy in front to distribute the requests. However, using two different versions of the container on the same machine to run the same application is a bit unusual.

Regarding the fact that starting one Tomcat actually starts up the other one, it is probably due to the fact that you haven't configured it's CATALINA_HOME and it simply checks the usual locations for Tomcat and finds the other one.

See: https://tomcat.apache.org/tomcat-7.0-doc/RUNNING.txt - Advanced Configuration - Multiple Tomcat Instances



来源:https://stackoverflow.com/questions/32197386/deployment-of-my-application-in-existing-tomcat

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!