For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub
- This topic has 3 replies, 2 voices, and was last updated 21 years, 2 months ago by
Riyad Kalla.
-
AuthorPosts
-
Hi,
I’m wondering if there is any way of emptying MyEclipse’s cache of hot-deployed classes.
I use Orion Application Server together with MyEclipse and make use of features such as hot-deployment and the ability to debug web applications.
However, sometimes the files that are hot-deployed get out of synch. (The code running in Orion is NOT the one I’ve just edited) When that happens it seems that the only way of getting the files in-synch again, is to:
– kill MyEclipse
– manually remove all deplyed files
– kill computer
– have lunch
– Start over, build, deploy, etc and hope for the best.
Sometimes this works, sometimes I yell alot and repeat the whole procedure again.Whenever this happens, it takes a lot of time and effort. And I figure that there must be a quicker way to do this. But I have not found any magic “reset system” button in MyEclipse.
Any help would be useful.
Regards,
FredrikAugust 31, 2004 at 12:16 pm #214090
Riyad KallaMemberFredrik,
I’m wondering if there is any way of emptying MyEclipse’s cache of hot-deployed classes.
MyEclipse only hot deploys changes to your WebRoot/WEB-INF/classes directory. So to clear “its cache” so to speak, just rebuild your project.
– kill computer
– have lunch
– Start over, build, deploy, etc and hope for the best.
Sometimes this works, sometimes I yell alot and repeat the whole procedure again.LOL, yes its a lot easier than that.
Actually an error should popup when deployment becomes out of sync, make sure you have this checked: Window > Prefs > Java > Debug > “Hot Code Replace”, make all of those checked. Now yo uwill get an error from the App Server when it can no longer keep your app in sync… this usually happens when the structure of a class file changes (methods, args, vars, etc.) but normal code changes should hot deploy just fine.
Also if you ever need to “Reset” the situation just:
1) Shut down app server
2) Open up the deployment dialog
3) Select app, click “Redeploy”, this will erase and redeploy the application
4) Start app server againAs far as WHEN things get out of sync, its up to the app server, not us. Also I’ve worked for many hours before with Tomcat telling me my files are out of sync, but it kept working… so I don’t necessarily do this every time it warns me, just when I don’t see my chagnes deployed, then I’ll restart (e.g. I’ll press refresh and still see old info, then I know I need to reall redeploy).
The key to redeploying is the stopping of the server, otherwise it will keep a lock on the files and the “delete” step of the redeploy will fail.
August 31, 2004 at 5:25 pm #214154Hi Riyad,
First of all: thanks for you answer. Howerver, my curiosity isn’t quite satisfied yet :o)
I do have all the hot code toggle switches on, so whenever I add a method, for example, I get a pop-up saying the server is out of synch.
My problems start when I don’t get this pop-up. It usually happens when hot-deploy should kick in. If I debug the application it becomes apparent that the code running isn’t the one I’m looking at – it’s an older version.
I might add that the environment of our project is a somewhat complex.
The application is based on 3 web-applications, resting on top of a data access framework.My particular problem always arises when I make changes to the data access framework.
Since all the different web apps need to access the framework, I’ve deployed it globally (via ant and not from within M.E.) directly in Orions lib dir. Could this be the problem?Recap:
1. I build and deploy (non-web-)framework as several jars in orion global lib dir
2. I deply web-apps and start Orion from within M.E. (jars are loaded)
3. I make changes to framework code – that DO get hot deployed
4. Bad luck and/or cosmic interference causes hot-deploy to loose synch
5. I fail to get them in-synch again– Re-deploy does not work since this code is not part of web-app
– Re-building and separately deploying framework does not work
– Restarting Orion does not work
– I’ve checked, and the jar/file version in Orion’s lib is the right one(!!!)
– I still see the old file when debugging in M.E. Even after restarting M.E.Now, I cannot swear that I haven’t missed anything in my analysis of events, but it does seem to me that MyEclipse keeps a private cache of the out-of-synch, hot deployed and very elusive code.
I come to this conclusion since I only see it in M.E.My hope was that you would answer something like, “Ah, just delete the file called ‘sneaky-cache.me’ under the root dir” but if no such cache exists, I would be more than happy to receive any input on what might go wrong and how to fix it.
Regards,
fredrikAugust 31, 2004 at 6:20 pm #214159
Riyad KallaMemberSince all the different web apps need to access the framework, I’ve deployed it globally (via ant and not from within M.E.) directly in Orions lib dir. Could this be the problem?
The hot deployment feature works off of hooking into the Eclipse notification mechanism of file changes and then copies out the new files by way of a valid deployment. If you have no deployment for this DAO Framework then you are circumventing any ability ME might have to sync the files… so yes this is definately a problem if you need hot-sync.
“Ah, just delete the file called ‘sneaky-cache.me’ under the root dir”
Hah, yea we got rid of the sneaky-cache file a long time ago, we’re using the “impossible-to-debug.problem” file now.
No seriously, if you make your DAO frameowkr a dependenent project of one of the web applications (or all of them) and set your web deployment properties up correctly the deployment tool will actually JAR up and deploy the dependent project for you or stick it in the classes dir of your web project so hot-sync can work all the time.
By working around this and putting the JAR files in the orion lib dir, I think you are creating a conflict that the hot-deployed classes are actually running into the JAR classes int he classloader inside of Orion.
-
AuthorPosts

