- This topic has 7 replies, 3 voices, and was last updated 20 years, 5 months ago by Scott Anderson.
-
AuthorPosts
-
bortMemberHi
I have a Web Application that I’ve successfully deployed onto Tomcat 4 using MyEclipse 3.8 on Eclipse 3.0RC1.
However, when I make a change in the code, rebuild, and redeploy, the change isn’t reflected in Tomcat 4. For instance, I changed one of the SQL queries in my code and redeployed. But, as I was debugging through the code (that assigned the SQL query to a String variable) I noticed that the SQL query was the same as it was before my change!
I thought maybe the build process wasn’t working, so I took the compiled .class file and decompiled it to look inside. The SQL query had been updated, and was sitting in the newly built .class file. So, if the .java file and .class file have the new SQL query, where would Tomcat be picking up the old one?
help!
bort
Scott AndersonParticipantbort,
What JDK are you using to run Tomcat? When using JDK 1.4.1+, you should be able to use exploded deployment and get updated code just by saving your java files (with autobuild enabled) without having to manually redeploy. Tomcat 4 will reload modified JSP’s etc, but code changes can only be injected using the JDK 1.4+ debugger while running.
Riyad KallaMemberBort,
you also want to make sure that you have your web context (use Tomcat administrator for this) is set to reload changed classes, otherwise it won’t. The <context> attribute is something like “reloadable=true”, if you use the Tomcat administrator, they give you a gui with a checkbox to handle this.
bortMemberScott: I’m using the j2sdk1.4.1_02 JDK, which should work, and I do have the web app set up for “Exploded Archive”
Riyad: The context is set to reloadable=true. But I’m curious… what Tomcat administrator do you speak of? I just looked inside the server.xml file.
Scott AndersonParticipantAre you launching the server in debug mode (see the connector preference pages)?
Do you have autobuild on? Do you have Window > Preferences > Java > Debug > “Show error when hot code replace fails” set?
Riyad KallaMemberTomcat Administrator: when Tomcat is running, go to http://localhost:8080, and click the link “Administrator” on the top left side of the screen. Its a web application UI that lets you manage your apps.
bortMemberScott: Yes, I do have the server setup to run in debug mode, and I have autobuild on. However I didn’t have the “show error when hot code replace fails” set. That all being said, I think it must have been “user error” 😳 I’ve tried to duplicate the scenerio, and have been unsuccessful (which is a good thing in this case).
If it happens again, I’ll let you guys know, and some more specific information. Unfortunately, I couldn’t post the code for this last one, as it is somewhat confidential…. 😉
Thanks guys…
Scott AndersonParticipantNo problem. Glad you’re up and running.
-
AuthorPosts