简体   繁体   English

为什么grails无法在同一端口上运行两个应用程序?

[英]Why can't grails run two applications on the same port?

With Tomcat or Glassfish, there is no problem with deploying multiple apps on port 8080. But if you try to do a grails run-app on multiple apps (without specifying different ports) at the same time, you will receive a JVM Bind Exception. 使用Tomcat或Glassfish,在端口8080上部署多个应用程序没有问题。但是,如果您尝试同时在多个应用程序上执行grails运行应用程序(未指定不同的端口),则会收到JVM Bind Exception。

Why is grails run-app different from deploying a .WAR to a container? 为什么grails run-app与将.WAR部署到容器不同?

deploying a .WAR to a container 将.WAR部署到容器

The container itself is bound to a port. 容器本身绑定到端口。 The container (Tomcat, Glassfish, whatever) has the ability to host multiple applications 容器(Tomcat,Glassfish等)可以承载多个应用程序

grails run-app Grails运行应用程序

Spins up its own container that is bound to a port. 旋转绑定到端口的自己的容器。 This container may have the ability to host multiple apps, but that isn't what you're doing when you type "run-app" 该容器可能具有托管多个应用程序的能力,但是当您键入“ run-app”时,这并不是您要做的事情

I'm no grails expert, but Tomcat and Glassfish are one process/application bound to one port. 我不是grails专家,但是Tomcat和Glassfish是绑定到一个端口的一个进程/应用程序。 Then they host different applications (web/enterprise) running in the same VM, and route requests using the context root for example. 然后,它们托管在同一VM中运行的不同应用程序(Web /企业),并使用上下文根路由请求。

I suspect grails run-app starts a new application as a new process/in a new JVM instance and tries to bind it to the port. 我怀疑grails run-app在新的JVM实例中/在新进程中启动了新应用程序,并尝试将其绑定到端口。 If there's already a binding, that won't work. 如果已经存在绑定,那将不起作用。

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

相关问题 两个应用程序使用相同的 IP 和端口 - Two applications working with the same ip and port 为什么我的代码不能同时运行两个面板? 当我运行它时它不会显示任何内容,但它会编译 - Why can't my code run two panels at same time? it doesnt show anything when I run it, but it compiles 无法在Eclipse上运行Grails应用程序 - Can't run grails app on eclipse 我可以在两个不同的端口上运行weblogic吗? - Can I run weblogic on two different port? 如何在同一台服务器上运行两个 Spring Boot 应用程序? - How to run two spring boot applications on same server? 多个java应用程序可以在同一个VM下运行吗 - Can multiple java applications run under same VM? 如何使用批处理文件运行两个Java应用程序? - How can i run two java applications using a batch file? 两个 web 应用程序共享的 JAR 是否可以登录到 Tomcat 中的同一文件? - Can a JAR shared by two web applications log to the same file in Tomcat? 我们可以在同一个应用服务器中部署两个struts2应用程序吗? - Can we deploy two struts2 applications in same app server? Wildfly 8:无法在相同IP下的其他应用程序上部署在其他端口运行的Jolokia - Wildfly 8 : Not able to deploy Jolokia running at different port w.r.t other applications under same IP
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM