facebook

[Closed] MyEclipse Hot-sync over tomcat 5.5 nightmare

  1. MyEclipse Archived
  2.  > 
  3. Web Development (HTML, CSS, etc.)
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #260430 Reply

    Has anyone else experences problems with hot-sync over tomcat 5.5?
    I find this a very frustrating not be able to depend on hot-sync becasue I am not sure if it did copy my changes, it did not copy my changes, …. and finaly when still see error I keep looking for the problem and after wasting time realize its just hot -sync did not copy the files, dang ….so now on, I better manualy resync, which makes hot-sync totaly useless …. why is it happening, what are the proccedures? is there a way to debug hot-sync and findout what is going on? how do I manualy triger it if I can ? I really like to use that feature, but would like to see what options I have to find the reason its failing .
    I have my ant-builder on to of the stack of all other myeclipse builders .it basically uses my build file and copys all neccessary files to web dir before any other (myeclipse) builders kick in, so its totaly no-intrusive, note sure how this can be related but still for FYI … any suggestions?
    Best Regards.

    #260433 Reply

    dlevancho ,

    There are some things you should pay attention to:

    1) If you develop common JSP/servlet applications, you need to start Tomcat in debug mode.
    In this case Tomcat’s JVM will ‘hot replace’ java code.
    2) If you develop JSF applications, we have to add next:

    
      <context-param>
        <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
        <param-value>client</param-value>
      </context-param>
    

    in web.xml for reloading JSF pages.
    Nothing of these will reload JSF java code (managed beans).
    If you want to reload JSF java code, you have to add the argument ‘reloadable’ to context.xml.

    You can set context.xml at the server level (TOMCAT_HOME/conf/context.xml)
    For example:

    
    <Context reloadable="true">
        <WatchedResource>WEB-INF/web.xml</WatchedResource>    
    </Context>
    

    or at the application level (META-INF/context.xml) :

    
    <Context path="/<YOUR_PATH>"  reloadable="false">
    </Context>
    

    If you set ‘reloadable’ to ‘true’, reloading will work in both run mode and debug mode, but this will reload complete application. If the application is large, it will take some time.
    This argument is only used for applications development .

    You can always reload application with touch web.xml.

    3) If you change JAR files and use Windows OS,you will have problems because
    JVM on Windows locks JAR files and Windows doesn’t allow changes (redeploying).
    The solutions for this:
    a) stop the server
    redeploy application
    start the server
    b) You can add antiJARLocking and antiResuorceLocking arguments to context.xml and redeployment will work,but reloading application (argument reloadable) won’t.
    This problem exists only on Windows (it doesn’t exist on Unix, Linux, Mac OS ).

    Snjeza

    #260746 Reply

    I develop in Struts, (no JSF)
    I have tomcat running under Debug Mode
    I have set Tomcats config reloadable =”true”
    I have noticed, that if I change, struts- config , tiles config or any jsp files, hot-sync modifies it correctly,I stillhav eto reload them but at least they get synced , but if I change java file and compile it , it does not do that .I have to stop server, click redeploy and then start it back up,

    #260747 Reply

    quick question, I have noticed that when I click redeploy it erase s a whole directory and then plases everything allover again, I would think it only replaces modified files, it woul dbe nuce hot-sync to have like force sync buttons, something like update that basicaly updates if needed all modified files, is is thre a some ant task that I can call maybe ?

    #260748 Reply

    Riyad Kalla
    Member

    With an exploded deployment, only changed files get replaced, with pressing the “Redeploy” button, it does a full undeploy and redeploy (as you said). If you only wants Diffs, using an exploded deployument should already do that for you.

    That being said, our deployment team is looking at handling deployment based on file timestamps in a future release, so it may get faster going forward.

    #260760 Reply

    dlevancho ,

    I develop in Struts, (no JSF)
    I have tomcat running under Debug Mode
    I have set Tomcats config reloadable =”true”
    I have noticed, that if I change, struts- config , tiles config or any jsp files, hot-sync modifies it correctly,I stillhav eto reload them but at least they get synced , but if I change java file and compile it , it does not do that .I have to stop server, click redeploy and then start it back up,

    If you run Tomcat in debug mode, you don’t have to set argument reloadable=”true”. It will unnecessary reload complete application. However, it has to work if you have set correctly :

    1) running in debug mode
    2) set reloadable=”true”
    3) both of them

    Check :

    – you use an exploded deployment
    – the argument path in the file context.xml is correct
    – the output directory of your Java project is WEB-INF/classes

    If this doesn’t help ,please send me an example of your project to support@genuitec.com with subject ATTN Snjeza

    Snjeza

    #260787 Reply

    Hi Sneja, thanks for your promt and courtes reply thats what matters most , and I am glad I choosed myEclipse.
    I will make a sample project and send it to you
    anyways to summirise what I have found so far are following :

    changes made to java class do not not reload them ,
    changes made in js files, do not get reloaded

    changes made in jsp do get reloaded
    changes made in xml, do get reloaded.

    #260852 Reply

    Riyad Kalla
    Member

    dlevancho,
    Before sending the sample project, to make sure that exploded deployment is working, have you tried checking the time stamps on the actual deployed .class files and seeing if they are changing? If they are, then the problem lies with Tomcat not reloading the changed class, not with MyEclipse deploying it (that will help us trouble shoot alternative solutions more effectively).

    #261325 Reply

    I have set it to autobuild, and modifying a java file does not change timestamp for corresponding class file in deployment dir,
    same with js javascript file modifications are completely ignored.

    #261334 Reply

    Riyad Kalla
    Member

    Are you using an exploded deployment or a packaged deployment? (You need to be using an exploded deployment)

    #261482 Reply

    of course, I am using exploded deployment otherwise, jsps would not sync .

    #261483 Reply

    Riyad Kalla
    Member

    The next step be to check your log file for exceptions that would shed some light as to why the class files are not being deployed. Your log file is located at (<workspace dir>\.metadata\.log), check near the bottom (most recent) events and look for deployment failures or errors.

    #263537 Reply

    iimuhin
    Member

    dlevancho, i had the same problem. I solved it.

    Solution: in order to start the server on the “Servers” page don’t click on green arrow, click on the green bug.

Viewing 13 posts - 1 through 13 (of 13 total)
Reply To: [Closed] MyEclipse Hot-sync over tomcat 5.5 nightmare

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