[英]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.