Deploying a Spring-boot webapp to a self-chosen host on a remote Tomcat8

已回答

I've been having this problem for weeks now, and we're long past the point of me tearing my hair out.

I have configured IntelliJ to deploy a rather simple Spring-Boot application to my remote Tomcat 8.5 server following the IntelliJ documentation (setting up remote staging area, adding JMX parameters to the JAVA options, etc.). It works well, but ONLY with the default <Host name="localhost" ...> in server.xml.

The thing is, I'd like to deploy the application to another Host in Tomcat, but I cannot for the life of me figure out where to choose which host I deploy to - or, as I'm beginning to think, if it's simply just not possible.

An interesting observation I did in my research was to remove the default <Host name="localhost" ..> from server.xml while still having other Hosts with other names defined - even while I had configured the defaultHost="..." attribute on the Engine element. Turns out IntelliJ doesn't like not having the a <Host name="localhost" ...>, as I got an error on the following deploy:

"Error running <build configuration>
Unable to connect to the <server address>:1099, reason:
javax.management.InstanceNotFoundException: Catalina:type=Deployer,host=localhost"

So that really does suggest to me that IntelliJ is only capable of deploying to the Host named localhost.

Hope to get a solution to this problem or some workaround - and not of the type of manually uploading the .war file through the manager app in Tomcat.

1
正式评论

It is indeed not supported right now. Unfortunately with the actual code base I don't see any workaround. 

I've opened IDEA-176026: "Tomcat: allow deployment to custom virtual host", you may track progress there. 

 

 

Avatar
Permanently deleted user

Thank you, I guess I can stop looking for a solution then.

As a workaround, I guess I can rename the Host I'm working on to localhost, while keeping the actual DNS names defined as Aliases.

1

请先登录再写评论。