vscode-tomcat icon indicating copy to clipboard operation
vscode-tomcat copied to clipboard

Can't change CATALINA_BASE

Open ecattez opened this issue 6 years ago • 11 comments

Hi,

I'm working on Liferay, with an embedded tomcat. So I added the tomcat folder. When I start the server, it seems to use the following CATALINA_BASE :

...\workspaceStorage\fec42f93b753ebda2508e0f3a9ef873f\adashen.vscode-tomcat\tomcat\tomcat-7.0.62

Unfortunally, that's not what I want. I would like to set the CATALINA_BASE with the real tomcat folder path.

Could it be possible to define environment variables for each tomcat registered in vscode ?

Thank you.

ecattez avatar Sep 18 '18 07:09 ecattez

You could configure the tomcat.workspace in VSCode settings.

SummerSun avatar Sep 19 '18 00:09 SummerSun

But it will affect all my tomcat instances. In my case, I just don't work by copy. If I add a tomcat folder, I would like to use that folder (and that instance obviously). That's why defining CATALINA_BASE and CATALINA_HOME should be editable for each tomcat :(.

ecattez avatar Sep 19 '18 08:09 ecattez

Seems I misunderstood your points.

Let me explain the current behavior of the extension first:

tomcat.workspace is the workspace of the Tomcat extension. That is where the extension manages all the server instances. So yes, the Tomcat extension works by copying. Users specify the server path, and it is copied to the workspace for following operations such as start, stop or rename a server instance.

In this way, all operations are performed on the instances. Users could add several instances from one server and they don't influence each other.

And the expected behavior I think you are expecting is the extension to support to use the server itself instead of the copied instance, right?

It sounds a solid feature request to me. In order to support this, we could add new operators like Use Existing server together with the Add button and Refresh button in the upper right corner of the extension explorer. This will not break the current behaviors.

SummerSun avatar Sep 19 '18 11:09 SummerSun

And the expected behavior I think you are expecting is the extension to support to use the server itself instead of the copied instance, right?

Right ! The feature is exactly what I am looking for !

ecattez avatar Sep 19 '18 11:09 ecattez

What is the timeline on this ticket ?

shamik134 avatar Jun 12 '19 23:06 shamik134

+1 on this feature getting priority!

jeffrpowell avatar Aug 20 '19 11:08 jeffrpowell

This issue is really important for me. I currently can't use this tomcat extension at all because it's not actually running my external tomcat instance.

My tomcat setup is really complicated, so when the extension tries to copy things (to its local tomcat copy), it misses half of my webapps, and the other half won't even run.

Any chance someone could work on this?

allanjackson avatar Jul 27 '20 17:07 allanjackson

I changed the setting tomcat.workspace but still application gets deployed to CATALINA_BASE.

I don't have CATALINA_BASE env variable setup but still plugin seems to set it to some folder.

Also there should be a way to at least view various env variables that the plugin uses when it's serving application.

AshishGupta001 avatar May 03 '21 09:05 AshishGupta001

I started a fork to add a new Run In Place setting: https://github.com/jeffrpowell/vscode-tomcat. Got the feature mostly working, but noticed an unexpected behavior of the current extension: it doesn't try to run tomcat's included startup.bat or catalina.bat file (or their .sh equivalent). It instead incompletely ports over the behavior from catalina.bat/sh into the extension's code (thus bypassing things like the setenv hook in the startup scripts). I'm working on seeing what it might look like to drop the custom port and reuse the tomcat startup script instead.

jeffrpowell avatar Nov 27 '21 14:11 jeffrpowell

All done with my PR!

jeffrpowell avatar Dec 01 '21 17:12 jeffrpowell

I would recommend Community Server Connector as an alternative extension.

Eskibear avatar Dec 02 '21 02:12 Eskibear