简体   繁体   English

常规Tomcat实例中的Eclipse Tomcat端口更改或测试

[英]Eclipse Tomcat Port Change or Test in the Regular Tomcat Instance

This is a Windows 7 development environment where Tomcat 7 is set to autostart in c:\\tomcat7 folder. 这是Windows 7开发环境,其中Tomcat 7设置为在c:\\ tomcat7文件夹中自动启动。 That does work fine but I want to test my Java (.JSP) code right inside Eclipse Neon interface. 这样做确实可以,但是我想在Eclipse Neon接口中测试我的Java(.JSP)代码。 So I configure Tomcat inside Eclipse by pointing to c:\\tomcat7 folder but I get the port 8080 already in use error. 因此,我通过指向c:\\ tomcat7文件夹在Eclipse中配置Tomcat,但是却收到端口8080已经在使用中的错误。

I know what's happening: Tomcat is trying to start but it is already running. 我知道发生了什么:Tomcat正在尝试启动,但它已经在运行。 So I duplicated the c:\\tomcat7 folder to a c:\\tomcat7_for_eclipse folder, pointed Eclipse to that, then changed the port to 8081 via Eclipse but I now get an error: 所以我将c:\\ tomcat7文件夹复制到c:\\ tomcat7_for_eclipse文件夹,将Eclipse指向该文件夹,然后通过Eclipse将端口更改为8081 ,但是现在出现错误:

Tomcat couldn't start;

and doing that actually stops the port 8080 instance of Tomcat. 并实际上停止了Tomcat的8080端口实例。

There must be a simpler way to quickly deploy to the actual Tomcat to test applications or to do the port route as I tried above? 必须有一种更简单的方法来快速部署到实际的Tomcat中,以测试应用程序或进行端口路由,就像我上面尝试过的那样?

I am very new to Java, Eclipse, and Tomcat. 我是Java,Eclipse和Tomcat的新手。 So please bear with me: I have looked at online solutions but nothing helping so far. 因此,请忍受我:我已经研究了在线解决方案,但到目前为止没有任何帮助。

Thanks! 谢谢!

I think I got the two instances of Tomcat working simultaneously. 我认为我使Tomcat的两个实例同时工作。 Here is what I ended up doing: 这是我最终要做的事情:

1) Left the original instance of Tomcat on port 8080 as such 1)像这样将Tomcat的原始实例留在端口8080上

2) Inside Eclipse, added a new Server and this time downloaded to ac:\\tomcat7_for_eclipse2 folder. 2)在Eclipse中,添加了一个新服务器,这次下载到了ac:\\ tomcat7_for_eclipse2文件夹。

3) Inside Eclipse, changed the ports to 8081 etc for the newly downloaded instance of Tomcat 3)在Eclipse中,将新下载的Tomcat实例的端口更改为8081等

This seems to be working fine: Both the regular instance of Tomcat continues to run while I can now launch the new instance of Tomcat right from inside Eclipse and quickly view my .JSP file's dynamic code. 这似乎运行良好:两个常规的Tomcat实例都可以继续运行,而现在我可以直接从Eclipse内部启动新的Tomcat实例,并快速查看我的.JSP文件的动态代码。

This is sort of like what Microsoft Visual Studio does. 这有点像Microsoft Visual Studio所做的。 I know it's not some 'best practices' but it keeps my development environment simpler. 我知道这不是“最佳实践”,但是它使我的开发环境更简单。

Thanks to all for their help! 感谢大家的帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM