3

What do I need to do to make my JSP code changes effective on local installation of Tomcat? I tried all it seemed logical to me: Tried to Clean Project, Build Project, Publish Tomcat, Restart Tomcat and Clean Tomcat. Nothing works. My changes suddenly appear and I can't figure out what is needed prior changes to take place. This is really frustrating.

Sometime Clean Project, then Server Restart works, sometime not. Actually I think Tomcat gets refreshed in some time intervals and it doesn't care at all what I do.

I asked this question before as a part of another question, but I didn't get good answer. At least not the answer that would help me around this issue.

I looked at server.xml file and for my project I have this:

 <Context docBase="RTTA" path="/RTTA" reloadable="true" source="org.eclipse.jst.j2ee.server:RTTA"/></Host>

Next to RTTA entry under Tomcat sever (Servers Tab) it says [Synchornized], but it is not.

Thanks.

Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140
bobetko
  • 5,019
  • 14
  • 58
  • 85
  • cleaning the work directory should help. – sul Aug 29 '11 at 23:31
  • @sul: "Clean Tomcat" should do that part. bobetko: Tomcat is indeed a pretty terrible hotpublisher/hotdeployer. Live with it. I'd turn hotpublishing off and manually restart it. Works in in pretty much all cases and it's not slower than hotpublishing. I'm happy with Glassfish 3 when it comes to intensive development and hotpublishing. I've even ever mentioned that in one of your previous questions: http://stackoverflow.com/questions/7151892/eclipse-and-jsp-programing-where-to-store-classes – BalusC Aug 30 '11 at 00:40
  • @BalusC - in fact, it is not that bad, but WTP is somewhat buggy. I've been using it with FileSync - sending files to manually, and it works pretty fine - a restart is needed only if you change a class structure. – Bozho Aug 30 '11 at 05:46
  • Thanks guys. I really appreciate your time. Glassfish3 I can't use. I am making changes on project that uses Tomcat 6.0 server. I could maybe set it up on my local machine, but eventually I will have to move project to test/production where Tomcat is, so I would like to avoid doing that. I really have no idea what "hotpublishing" is. If you mean to turn off option "Automatically publish when resources changes", I did that. The think is manual restart of the server doesn't work. – bobetko Aug 30 '11 at 14:02
  • About my Tomcat installation: I selected option for Eclipse to take over Tomcat installation. I run Tomcat from within Eclipse. I tried running it from windows, but in that case page is never updated (when I change the code). – bobetko Aug 30 '11 at 14:03
  • @Bozho, can you explain your FileSync process? In my mind: I would have to have Tomcat instances seoparate (windows and eclipse) and setup some FileSync process to move my project files to webapps folder when file changes? Is that right? If yes, what program did you use to sync files? Thanks. – bobetko Aug 30 '11 at 14:06
  • @sul: I tried. It doesn't work. I right click my project in Servers tab and pick Clean Module Work Directory. I get message that server will be restarted. After restart, my old content is still there. – bobetko Aug 30 '11 at 14:12
  • @bobetko - yes, exactly. There's an eclipse plugin for that - it's called FileSync. I've worked with that setup in 3 projects and it was fine – Bozho Aug 30 '11 at 14:36
  • @Bozho. Downside of doing this is, I guess, you can't run Tomcat in Debug mode. Right? – bobetko Aug 30 '11 at 14:55
  • @bobetko - you can, and it works :) You still run tomcat from within eclipse (see my answer) – Bozho Aug 30 '11 at 15:52

1 Answers1

2

WTP + Tomcat doesn't work very good, alas. In a number of projects I've used the FileSync plugin to synchronize the files in the project and in an (external) tomcat. Tomcat is still controlled through eclipse (start it in debug mode), but applications are not deployed via WTP.

Bozho
  • 588,226
  • 146
  • 1,060
  • 1,140
  • I am little bit confused. Which option I should use for server locations? -Use workspace metadata or -Use Tomcat Installation? When I click run server from within Eclipse, which instance will be running? Since I copy all files to webapps folder, I assume Windows version of Tomcat will run (not Eclipse's). Is that right? – bobetko Aug 30 '11 at 16:35
  • use the last option: "Use custom location". And run tomcat from eclipse. It is the same as starting it from command line, but you can debug without extra effort – Bozho Aug 30 '11 at 21:42
  • I set docBase to the path o my develop folder and works good. Tomcat will manage when files change (with reloadable="true") –  Sep 13 '11 at 21:25