- This topic has 12 replies, 4 voices, and was last updated 17 years, 8 months ago by
iimuhin.
-
AuthorPosts
-
Levan DvalishviliMemberHas 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.
support-snjezaMemberdlevancho ,
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
Levan DvalishviliMemberI 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,
Levan DvalishviliMemberquick 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 ?
Riyad KallaMemberWith 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.
support-snjezaMemberdlevancho ,
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 themCheck :
– 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/classesIf this doesn’t help ,please send me an example of your project to support@genuitec.com with subject ATTN Snjeza
Snjeza
Levan DvalishviliMemberHi 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 reloadedchanges made in jsp do get reloaded
changes made in xml, do get reloaded.
Riyad KallaMemberdlevancho,
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).
Levan DvalishviliMemberI 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.
Riyad KallaMemberAre you using an exploded deployment or a packaged deployment? (You need to be using an exploded deployment)
Levan DvalishviliMemberof course, I am using exploded deployment otherwise, jsps would not sync .
Riyad KallaMemberThe 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.
iimuhinMemberdlevancho, 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.
-
AuthorPosts