tags:

views:

301

answers:

3

OMG - what is going on with Eclipse (3.3 Europa) - has anyone come accross this problem (bearing in mind I have been messing about with uninstalling different Tomat containers and installing others - but anyway thats another story)

When I change a line of code or remove a class within my project - when I come to debug - it actually goes to a line that is commented out and runs that line regardless!!!! e.g.

//System.out.println("you should not be able to read this!");

UPDATE: This can be solved by setting Project -> Build Automatically (see answer below).


REMAINING PROBLEM:

Eclipse is not keeping my hot deploy folder current with the latest changes to my project:

I found out to my horror that some old remenants of my project are 'hanging around' in the folder that I think Eclipse uses for hot deploys or something

C:\myJavaCode.metadata.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\myWebApp

basically it is not actually copying accross any changes made in the classes of my working dir!?!??

...anyway - in order to keep my project up to date - I have to modify this folder too - TOTALLY UNACCEPTABLE - as you can't develop in this way - it would take you eons! Anyway, if anyone can help explain to me what stupid thing I have done to get me in this mess and how I can get out of this mess - I would really appreciate it.

A: 

Have a look at:

Windows>Preferences>Server>Launching...

and:

Project>Build Automatically

maybe you accidentally disabled the auto-deploy features.

Manrico Corazzi
they are all set to "prompt" - I think that's default setting - no?
Vidar
My colleague is a doofus and told me to turn off "Build Automatically" - grrrrrrrrrrrr
Vidar
yes, that's fine... try and clean temp/work and restarting the server, maybe it's just a temporary issue
Manrico Corazzi
Well you solved that problem - but I think the problem still stands on the hot deploy folder issue - I couldnt seem to get that folder to reflect my current project folder - it just had old stuff in there - do you know what's going on there?
Vidar
It seems like the Java code is being updated (since your debugger is now working, isn't it?). What else do you expect to be updated that isn't? Also: is Tomcat configured to detect hot deploys?
Manrico Corazzi
A: 

Hi,

A super-silly question: Does all your webproject and related projects compile correctly?

Also check your output folder for classes (Project Properties -> Java Build Path -> Source Tab) then go to your filesystem and check permissions and modification dates.

Hope this will help you.

SourceRebels
Yep - all compiles no problems
Vidar
A: 

Probably the easiest way to get past this is to define a new server.

Right-click in the Servers window and select New, or when you do 'Run On Server' select Manually define a new server. You can have multiple servers defined using the same Tomcat runtime (they'll all have separate configs and deployment directories defined by -Dcatalina.base=...), but don't run them at the same time unless you change the ports they're listening on.

The new server will use a path like

<<yourEclipseWorkspace>>\.metadata\.plugins\org.eclipse.wst.server.core\tmp1

for the Tomcat conf and webapps directory.

Try running on this server. If it works, you can compare settings with the old one, maybe try deleting the app from it and re-deploying, and figure out what you might have done to cause the problem. Or just delete the original server config.

As far as your second problem, I'm not sure. I'd try a new server config first, get it working, stop the server, do a 'Clean' on your project, delete anything in the tmp1\work\Catalina directory, and restart the server (you could remove and add your project to the server again too to be really clean).

Check the console messages too to make sure there were no errors related to this.