在现有tomcat中部署我的应用程序 [英] Deployment of my application in existing tomcat

查看:97
本文介绍了在现有tomcat中部署我的应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在真正的TOMCAT 6服务器中部署我的Web应用程序, 使用其他应用程序. 问题是,当我将WAR文件放入webbApps时,日志文件中出现错误,并且错误404:

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)...

我用谷歌搜索,发现没有兼容的JDK和JSP编译器.

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

我的问题是:我可以将应用程序部署在不同的tomcat(7)服务器上,并在同一服务器上使用2个tomcat吗?我尝试了这个,但是当我启动新的tomcat(tomcat7/bin/startup)时,服务器会自动启动旧的tomcat!

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!

推荐答案

您使用Java 7编译了战争,并试图在使用Java 6的Tomcat 6中运行它.将Tomcat 6配置为指向Java 7安装它也应该在那里工作.

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.

此外,有可能在同一台计算机上运行两个Tomcat,但是它们在不同的端口上.如果这样做,则应在前面使用负载均衡器或代理来分发请求.但是,在同一台计算机上使用容器的两个不同版本来运行同一应用程序有点不寻常.

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.

关于启动一个Tomcat实际上会启动另一个Tomcat的事实,可能是由于您尚未配置它的CATALINA_HOME,并且它只是检查了Tomcat的常规位置并找到了另一个.

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.

请参阅: https://tomcat.apache.org/tomcat-7.0- doc/RUNNING.txt -高级配置-多个Tomcat实例

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

这篇关于在现有tomcat中部署我的应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆