- This topic has 5 replies, 2 voices, and was last updated 18 years, 1 month ago by MuhammedShakir.
-
AuthorPosts
-
MuhammedShakirParticipantDear All,
I am struggling to get auto-deployment / hot deployment / smart sync (what ever you may call it) with MyEclipse and Tomcat 5.5. I have done exactly as explain in tutorial – Configured Tomcat, Set the deployment as “Exploded Archive”. Now when ever I make a change to any of my .java files in src, I do not see any reloading of context (redeployment) of my application in console. As such in other IDE(s) I can see the hot deployment happening automatically I soon as I make any changes in my .java files and save them. Also please note that, I cannot even manually redeploy my JSF application while TOMCAT is running. It says “some files may be in use”. I am forced to stop TOMCAT and then redeploy and then restart the server. This is very cumbersome.
Please help as I had made up my mind to subscribe for MyEclispse IDE after looking at its features. Now I have apprehensions.
Thanks In Advance
Muhammed Shakir
Scott AndersonParticipantMuhammed,
I think there’s a big of a misunderstanding on how HotSync works and what you should expect.
Now when ever I make a change to any of my .java files in src, I do not see any reloading of context (redeployment) of my application in console.
A change in your Java code doesn’t cause a redeployment. In fact, Tomcat doesn’t even know about it since the synchronization is handled by the debugger. When you update your java files, the get recompiled by MyEclipse and the changes get propogated directly into the JVM running Tomcat. So, the code gets updated, but Tomcat doesn’t know it. No context reload is necessary in this case and your application maintains its current state instead of having to be restarted. This also allows for much faster development, since the restart is avoided.
As for JSP pages, they are also immediately propogated to your deployment and the new pages will be seen the next time the page is reloaded. This also is done without the need of a contextual restart in Tomcat.
Also please note that, I cannot even manually redeploy my JSF application while TOMCAT is running. It says “some files may be in use”.
This is because Tomcat is locking one or more jars that are used in your application. However, a redeployment is seldom needed since HotSync will keep the application synchronized automatically. If you do want to force a contextual restart of your application within Tomcat, rather than redeploying, simply “touch” the web.xml file within MyEclipse. That will force web.xml to be HotSync’d to your deployment location and Tomcat will recognize the change to the descriptor file and restart your application for you, without a “redeploy” or a shutdown and restart.
MuhammedShakirParticipantDear Scott,
I highly appreciate your quick response my dear friend. But this does not solve my problem because what I understand by “HOTSYNC” is that when ever I make changes to my .java files, I will get the effect of that change when I refresh my application in “MyEclipse Web2.0 Browser” or IE. This does not happen. I do not get the changes reflected till the time I do not restart / redeploy my application. For e.g. I call getter method from JSP on a Java Bean returning “X” (hard coded) and now when I change the value returned by getter method to “Y” and refresh my application in browser, I still get “X” displayed on jsp and not “Y”.
Please Help
Muhammed Shakir
MuhammedShakirParticipantThanks a TON My dear friend. I got the point and problem solved. I got hint from your line “Tomcat doesn’t even know about it since the synchronization is handled by the debugger” in your reply. I used to run the application to test my changes. Now I debug my application instead of running and the changes are now reflected as per my expectations. Indeed it is very fast and far better than bea workshop.
Regards
Muhammed Shakir
Scott AndersonParticipantMuhammed,
I’m pleased we’ve gotten you to a point where it’s working well for you. From your experiences, we plan on creating a more comprehensive tutorial that details the steps more fully so that others will not be similarly confused. We appreciate your feedback greatly as this will help us improve.
MuhammedShakirParticipantAny time my friend. I will be subscribing for this product before it expires.
Cheers
-
AuthorPosts