facebook

Tomcat 4: code changes not reflected when testing [Closed]

  1. MyEclipse IDE
  2.  > 
  3. General Development
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #207845 Reply

    bort
    Member

    Hi

    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

    #207849 Reply

    Scott Anderson
    Participant

    bort,

    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.

    #207851 Reply

    Riyad Kalla
    Member

    Bort,
    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.

    #207854 Reply

    bort
    Member

    Scott: 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.

    #207856 Reply

    Scott Anderson
    Participant

    Are 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?

    #207866 Reply

    Riyad Kalla
    Member

    Tomcat 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.

    #207886 Reply

    bort
    Member

    Scott: 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…

    #207904 Reply

    Scott Anderson
    Participant

    No problem. Glad you’re up and running.

Viewing 8 posts - 1 through 8 (of 8 total)
Reply To: Tomcat 4: code changes not reflected when testing [Closed]

You must be logged in to post in the forum log in