Eclipse 3.5 Cache Problem - eclipse

I am using eclipse 3.5 with google app engine + spring framework to develop application. My problem is when I change the code and build the project, the new code doesn't come in to effect. I even deleted the old file but at runtime, the old version gets display in the browser. Why?

Your description is not explicit, so following are my assumptions:
You are changing jsp/js or view related files
You have Google app engine plugin for eclipse to deploy the code
Following might be one of the reasons:
Your view files are cached in the browser, so try deleting the browser cache
Google app engine might have cached your files, so try deleting the temp folder
Eclipse IDE wouldn't have deployed your changed code, so check the timestamp, if it still shows the old timestamp, then find out how to configure eclipse to detect your changes.

I found 3 workarounds for similar issue (changes to a servlet (.java file) were not taking effect).
Before editing the .java file, stop the application. It seems that if you edit it while running, the issue occurs, even if you edit it, stop then re-start.
Delete items in Temp folder e.g, (C:\Users\username\AppData\Local\Temp), then stop and re-start the app.
I think the culprit folder in the Temp folder is this:Jetty_127_0_0_1_8888_war__.g0qk00
Right click in in the console area and select 'Remove All Terminated'. Sometimes that reveals there are other instances running, which need to be stopped by clicking the terminate button.

I got the similar issue and the problem was due to not stopping the running server.
What i was doing was running the server, editing the java file, saving and again running the server. This created two instances of the server running and when checking into the browsers the old code was executed from the first instances.
So, the solution is terminate and relaunch the server, and your new changes will be in effect.

Related

WebSphere Debugger not stopping at breakpoints in Eclipse

I have deployed my application on WAS 8 as debug. The server status is [Debugging, Synchronized]. When I put breakpoints and start the application, it doesn't stop at the breakpoints. I don't see the debugger thread start either.
I am using RAD 8.0.4 and JDK 1.6.0_31. I have tried cleaning the project and re-deploying but it still doesn't work.
I was able to get it working via a complete clean install of my app. Then removing it from the server via add remove. Clearing cache from the websphere/profiles/myprofile directory. and clearing all bits of my app from the profiles folder via a search for its containing file aka (myproject-folder). Then re-installed the app via add remove on the server and it worked for me.
Best guess I have is something was actually out of sync even though the server though everything was A okay.
WebSphere is a PITA and seems to get out of state too easily.
I'd restart the server and perhaps do a clean on the server (right click on the server, click "Clean...". If that doesn't work, you'll have to take a careful look at the location of your break points. They might not be on code that's getting executed. Place a break point further upstream if necessary, follow it down just to confirm the flow.

Eclipse - loading launch configurations from old system

My system died, and IT has moved me to a new machine. The old HD has been stuffed into the box as a secondary, and I've access to my old data and development. I restored the files from the repository and whatever was missing from the old HD and I'm back to developing.
Trouble is, while my launch configurations are there in each project, I'm not seeing them in Eclipse.
Is there a way I can recover these, without going through the painful process of recreating all of them?
Found it!
Select File/Import and expand Run/Debug.
Select Launch Configuration and hit Next.
Browse to old location and hit Finish

Eclipse code change working explanation

If you are using Eclipse and your development server is running in the debugger, when you save your changes to this file, Eclipse compiles the new code automatically, then attempts to insert the new code into the already-running server. Changes to classes, JSPs, static files and appengine-web.xml are reflected immediately in the running server without needing to restart
plz any one can explain this ??????????
For classes like JSP-files:
Its debugging using JPDA.
The IDE attach via socket to the JVM your running app and hot-redeploy the not-permanent-code (aka PermGen).
There are different techiques and frameworks for that:
http://en.wikipedia.org/wiki/Java_Platform_Debugger_Architecture
It doesn't happen automatically. Check Project --> Build Automatically option. It should have been checked.
If you un-check it; then project will not be build/deployed automatically.

Google App Engine Eclipse Launch Local Host Multiple App Conflict?

I have two GAE projects created through pydev in eclipse 4.2 (windows 7) and the first one I had no issues running the localhost:8080 but when I created a second project, I duplicated the Run Configuration for local run adn just changed the project name to the new one.
However- when I run that config the inital HelloWorld project shows up[ in my browser, I tried completely removing the first project, but then it just ocmplains it cant fint app.yaml in the old directory (because the old directory isnt where it was).
So clearly I'm missing some setting in the launch procedure where it sets the root path.
The run config is a PyDeb Google App Run, main module points to
C:\program files (x86)\google\google_appengine\dev_appserver.py
And the arguments are
${project_loc}\src
Everything else is on the default settings.
Any help would be greatly appreciated as pushing to Google (which works fine for both) for every little debug iteration is driving me a bit crazy.
Thanks!
*EDIT: Forgot to mention I have already tried to delete all runconfigs and remake.
Have you tried Run as : PyDev Google App Engine Run, to create a new runconfig?
Turns out I'm just a bit silly. In eclipse, I wasn't properly turning off (not sure on the correct term there) the LocalHost for the first project before starting the second. To fix, I needed to go Into eclipses console window, and select "display selected console" and choose the project I wanted to stop and hit the stop all button. Then it runs fine.
Hope this helps someone in the future, that is as determined as me that "It can't be my fault".
Cheers.

Service code debugging question with GWT 2.1

I recently attempted to set new breakpoints in eclipse to debug service side code in GWT. For some reason eclipse refused to see the breakpoints or the new code changes I had made. In the debugger it would open up what appeared to be an ear file from somewhere. Even though I had deleted the old ears, compiled and redeployed the new ear files. We are using GWT 2.1, JBoss 4.3, java 1.6 and Eclipse Helios. Finally, when I created a new environment with the code from scratch it started working. Any ideas as to what was holding on to the old code? BTW, I had rebooted my machine and restarted eclipse, but it also didn't make any difference.
Thanks,
James
Current state of debugging GWT apps is ... well not really good. Sometimes it's incredibly slow (development mode), sometimes lot of rubbish stays at webserver.
This might not solve your problem directly, but here are some advices from me:
Writing new client code (/client) at GWT means refreshing browser
Writing new server code means "Reloading web server". You have little yellow "refresh" button in Eclipse in "Development Mode" tab. This should reflect all the changes done at server side.
Embedded Jetty works usually well with GWT debugging. If you are not doing something jboss-server-specific, it should also work fine at production server. Just make sure your unit tests pass ;-)
You can ofcourse debug GWT application on external server, see this section of documentation (I guess you do on JBoss)
Be sure to remove all old files when reloading web server. It happened to me, that sometimes there were some weird old mixed up files (I was using Tomcat though). So you might want to write own clean script.
You must be absolutely sure that your serever code even launched! Use lot of GWT.log() at client side, that will ensure you in this. Don't worry, GWT.log are ommitted in production mode.
Be sure to inspect client-side page, it sometimes help to find out that your server code didn't manage to launch.
Log every public void onFailure(final Throwable caught) { of your AsyncCallbacks to get more info.
Don't use Google Chrome in development mode. It's MUCH slower than Firefox.
Otherwise, if you're using most recent version of your application, Eclipse must stop at breakpoint correctly.
I think JBoss was somehow caching things in it's temporary files and then I had forgotten about adding source in. This may be a JBoss thing as I don't recall seeing it with other application servers before.
So after I cleared out the cache, what got me thinking about the source was the fact that eclipse would stop on the breakpoints in the debugger that I had just set, but I couldn't see the source files.
Prior to this I was apparently hitting the breakpoints in the cached files and I couldn't alter them by setting new breakpoints. That was the root cause of the issue. Then by adding in the source from the ear, I got the debugger in sync with the code and it started working fine.