Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tomcat not deploying new version of files at all - linux / eclipse

I am having issue with the way tomcat deploys my files to the server.

I have installed Tomcat 7 to /opt/tomcat7.

In my eclipse i have specified this path as my tomcat server.

my workspace directory is /home/maciej/workspace/<projects here>

now if I edit a class file and i add simply log statement

log.info("blabla"); and then deploy 'NEW' version of the file via - run on server, i do not see this 'blabla' in my output. It seems like although i have modified the class file, it was not properly deployed into tomcat. Tomcat is reading god knows what but certainly not the file it should read.

EDIT: I have recofnigured my tomcat in eclipse and now:

Server Path = /opt/tomcat7
Deploy Path = /opt/tomcat7/webapps <- used to be .metadata/blablabla default 
                                      eclipse tomcat location

When I open 'Open Lunch Configuration' under arguments/working directory the default option is ticket with greyed out path /home/maciej/Desktop

Should this also be changed?

Isn't tomcat working directory /opt/tomcat7/work ?

Any suggestions / ideas? As this issue is slightly getting on my nerves as i can not develop the app.

like image 735
Maciej Cygan Avatar asked Jun 03 '15 12:06

Maciej Cygan


People also ask

How do I update Tomcat in Eclipse?

For configuring the tomcat server in eclipse IDE, click on servers tab at the bottom side of the IDE -> right click on blank area -> New -> Servers -> choose tomcat then its version -> next -> click on Browse button -> select the apache tomcat root folder previous to bin -> next -> addAll -> Finish.

Where is Tomcat preference in Eclipse?

To configure Tomcat as a new Runtime Environment, select the "Preferences" menu item from Eclipse's "Windows" menu (if you are using a Mac, you can find "Preferences" under the main Eclipse menu). You will be presented with large tree of preferences. Expand the "Server" preferences, and select "Runtime Environments".

How do I change Tomcat deploy path in Eclipse?

Follow the steps below to change the default deploy directory of Tomcat in Eclipse. Select “use custom location” radio button in the “Server Locations” section and set your custom deploy path.


1 Answers

The Server Path is the same as the Tomcat installation directory in the modal you see in Window > Preferences > Server > Runtime Environments after hitting Edit. That should be set to /opt/tomcat7 or wherever the root of your Tomcat installation lives.

The Deploy Path is relative to the Server Path. It should be webapps, unless you already have stuff there and you want a separate directory. You will not be able to edit this until you shut down Tomcat and remove all webapps underneath it through the Servers view.

Try unchecking Modules auto reload by default if you trust the JDK hot-swapping, which you should if you're using JDK 1.7 or 1.8 and just want to see a log statement inserted.

The working directory you mentioned is just the root directory that Tomcat uses to spit out thread dumps on crashes and the like. It has nothing to do with the Tomcat "work" directory.

like image 108
davidfmatheson Avatar answered Oct 14 '22 08:10

davidfmatheson