- This topic has 5 replies, 2 voices, and was last updated 19 years, 11 months ago by
Riyad Kalla.
-
AuthorPosts
-
When I make a code change (dependent project – Java), the class file gets deployed to the Tomcat server (I see new date/time). I am running in debug and I am currently at my breakpoint. The code change is made to the code I am stopped at (breakpoint). In the Debug view, I can see that the Thread and the class file are labeled as (out of synch). If I step thru the code, I can see that the source and what is being executed do not match. I am stepping on lines that correspond to the old version of the code. After releasing the breakpoint and rerunning the code, I hit my breakpoint again. I still see the out of synch label. Restarting Tomcat seems to be the only way to resynch my code. How do I fix this?
My Tomcat\conf\web.xml has the following properties (which are the default values):
<init-param>
<param-name>development</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>reloading</param-name>
<param-value>true</param-value>
</init-param>What operating system and version are you running?
Windows XP, SP2What Eclipse version and build id are you using? (Help > About Eclipse Platform)
Version: 3.0.2
Build id: 200503110845– Was Eclipse freshly installed for MyEclipse?
Yes– Are any other external plugins installed?
No– How many plugins in the <eclipse>/plugins directory are like org.eclipse.pde.*
8What MyEclipse version are you using? (Help > About Eclipse Platform > Features)
3.8.4What JDK version are you using to run Eclipse? (java -version)
1.4.2 (compiler compliance level 1.3)What JDK version are you using to launch your application server?
1.4.2What steps did you take that resulted in the issue?
– Start Tomcat 5.0.28 server (for debug)
– Hit breakpoint
– Change java code currently at
– Save (and build) code changeWhat application server are you using?
Tomcat 5.0.28Are there any exceptions in the Eclipse log file? (<workspace>/.metadata/.log)
No
Riyad KallaMemberFirst change your compiler compliance level to 1.4, IIRC hot swap was not avalibe in 1.3, if that doesn’t work change it back.
Additionally you can restart only your web context and not the entire app server when you make code changes. And hot code swamping in a running debug session is up to the VM and the app server IIRC, has nothing to do with Eclipse. Now if you *were* running a debugging session with a client application that WILL hot-swap your code, but in this case Tomcat is hosting the running code.
Also to restart just the context, fire up a browser and point to http://localhost:8080 and lcick “Manager” and login (have to set up a manager role and username) then you can click “REstart” here.
I tried changing the compliance level to 1.4, but that did not fix the problem. I figured it was probably a Tomcat issue. Are you saying that Tomcat 5.0.28 does not support hot code swapping? Our company is currently evaluating MyEclipse and this feature is one we need and are acustomed to from using WebSphere Studio. This feature could be a deal breaker for us. I got the impression from you documentation on Web Projects that Tomcat 5 supported hot code swapping. Restarting the application everytime a code change is made would be a definite useability issue for us.
Riyad KallaMemberAre you saying that Tomcat 5.0.28 does not support hot code swapping?
No, it does. Just make sure you are launching Eclipse and Tomcat with atleast a 1.4+ VM, preferably the same. Tomcat should (and usually will) reload changes in a web context, but you need to make sure that the context is configured to reload changes (please see Tomcat docs on how to set this).
Restarting the application everytime a code change is made would be a definite useability issue for us.
I understand. Assuming you are not in the middle of a debug session what will happen is if you have the Tomcat context configured (reloadable=true) then as new classes are deployed Tomcat will actually reload the new class for you. I am unsure of the impact of this on a current debug session.
I left Java compliance level at 1.3, and changed the JAVA_HOME system variable (Control panel -> System -> Advanced -> Environment variables)to point to my Java 1.4.2 directory. It was pointing to a Websphere 5.1.2 version of Java. I was told that Tomcat uses this (although I was somewhat skeptical since I have my Eclipse preferences for Tomcat 5 set to Java 1.4.2 for the JVM). I don’t think I have any other change that could affect this. But at any rate, the hot code replace feature appears to be working correctly now!
Riyad KallaMemberWe appreciate you posting your followup findings.
-
AuthorPosts