Re: My java changes not reflecting on server due to dependency



Zeba wrote:
I have a project TurboLister that depends on another project Biz. I
can see a biz.jar in the libraries of TurboLister.

I am mainly working on turboLister, but I have some changes to be made
in Biz too. I have build automatically enabled in my eclipse, and my
eclipse is linked to my apache-tomcat. I can see the changes I make in
my TurboLister project, but not those i made in the biz project.

I have tried manually deleting and replacing all the biz.jars in my C:
drive with the new one. Only when I replaced the one in my workspace :

C:\workspaces\tr2_4\.metadata\.plugins\org.eclipse.wst.server.core
\tmp0\webapps\TurboLister\WEB-INF\lib

This temporary directory is important, but not the exact directory, only its location relative to your CATALINA_BASE environment.

did the problem get resolved. How do I make my tomcat take my code as
I type it out, rather than replace my biz.jar in the workspace each
time ???

There are a couple of questions tangled together here - one is how to get Eclipse to recognize the project dependencies so that it rebuilds TurboLister's view of biz.jar whenever biz changes. The other is how to get Tomcat to recognize changes to biz.jar in its deployment of TurboLister.

The first is strictly an Eclipse question. There are settings in the "build path" of the project properties for project dependencies. There may be another heading in the properties that affects that, too - Eclipse has a few places that interact.

The second is partly an Eclipse question because you're using the Eclipse-managed Tomcat instance, but the larger question is all Tomcat. Tomcat will not automagically recognize any dependent JAR changes. You got it to recognize the changes by brute-force replacement of the *runtime* application library, the one in WEB-INF/lib/. The next time Tomcat reloaded the app, and I'm curious why it did, it picked up the new version of the class.

That is not a best practice. Best practice is to rebuild the WAR file and redeploy the whole app to Tomcat. Popping the library JAR directly into production, or Eclipse's simulation thereof, bypasses the build-and-deploy step and puts the project out of synch with the runtime version. Always redo all downstream process steps from the point of a change.

Programmers need certain basics of system administration and operations in their tool belt.

--
Lew
.



Relevant Pages

  • Re: [ant] "build-Design"
    ... Wenn Eclipse P compiliert, weiss Eclipse zwar, ... der Eclipse-spezifischen Builddatei die normale Builddatei aufrufe. ... Wie führst Du sinnvoll UnitTests auf dem Tomcat aus? ... JPDA = Java Platform Debugger Architecture ...
    (de.comp.lang.java)
  • Re: servlet project setup in Eclipse
    ... The way I set up Eclipse for web application projects is this. ... configure WEB-INF/src as a source folder for the project, ... See the Tomcat ... there isn't supposed to be a servlet directory underneath webapps. ...
    (comp.lang.java.help)
  • Re: Limiting Disck Cache
    ... What else are you running besides Tomcat and Eclipse? ... RAM and what goes in swap sees this brand new file being used ... that one file takes up all of cache. ...
    (Debian-User)
  • Re: [ant] "build-Design"
    ... paar Eclipse-spezifische Tasks in der build.xml, die von Eclipse beim build aufgerufen werden. ... .class-Datei" bis zu "tomcat hat die Klasse geladen" dauert schätzungsweise 1 sec. ... WEB-INF/classes kompilieren lassen. ...
    (de.comp.lang.java)