JSP project in RAD + Websphere, javascript changes lost - eclipse

I'm working on JSP project in RAD 8.5.5 (when I tried to switch to Eclipse Kepler I've had the same issue) and WebSphere 8.0
When I change something in external JavaScript files which contain my own JavaScript functions I begin to get an error - 'function non defined' or even I lost part of code of this *.js page when I try to debug it in Chrome.
When I publish it to the server or rebuild it doesn't help. When I try to work without javascript cache in Chrome it doesn't work. Only after certain amount of time it begins to work. When I make changes in embedded JavaScript code on JSP page I haven't any problem, only I use my own function in external files.
What can it be? I lost a lot of time on this issue and it's annoying.
Thank you!

To overcome this issue you should do as following:
1.Prevent from browser to cache pages, in Chrome you can do it only developer tools are open : Disabling Chrome cache for website development
2.Perform 'Build project' from Eclipse(RAD). In some difficult case you have to do 'clean' on the server.
3.If you encounter unexpected delay while publishing try to delete all Breakpoints and Expressions from debug perspective.
4.Sometimes your server turning off and on every minutes by itself. To stop such behavior restart it in usual mode and then restart in debug mode.
Hope it will helpful to somebody.

Related

Variable evaluation fails in Eclipse when debugging JavaScript using Chrome Dev Tools

I have installed the Chrome Dev Tools Eclipse plug-in as described on http://code.google.com/p/chromedevtools/ and debugging JavaScript basically works. I can set breakpoints in my JavaScript source files and when I run the JavaScript code in Chrome, Eclipse stops the execution and opens the Debug perspective. Stepping through the code works fine, and I can also see the local and global variables in the Variables view.
When clicking on one of the variables, the detail view shows an error message, though:
Helper script failed on remote: _com_chromium_debug_helper is not defined
Did I miss something during the installation?
Update
Added an issue on the project's page: http://code.google.com/p/chromedevtools/issues/detail?id=85
Most likely you should open an issue at the project page. It is definitely a bug and fixing it might require additional context from you.
This is internals of ChromeDevTools SDK's workaround for WebKit Remote Debugging protocol limitations.

Eclipse PDT + XDEBUG - source lookup not working entirely

I'm having trouble with a PHP project using Yii framework.
My setup is the following: Win7 + Eclipse4.2 + PDT 3.1 + Yiiclipse PDT extension + WAMP Server with XDEBUG enabled.
Pretty much everything works ok. The debug session starts, it's going through project's index.php source, but when it has to jump to framework's files, it doesn't open them up. I edited source lookup and added framework's local path but it simply cannot find them.
Here is a screenshot: http://img607.imageshack.us/img607/3687/eclipsepdt.png
This isn't necessarily an answer - but your question isn't necessarily a question either, so I feel like this is fair game :D
I've had so many problems with Eclipse PDT + xdebug in the past with debugging, code completion, etc., that I gave up on it a while ago and switched to Netbeans for PHP Debugging. It's now the defacto standard on my development team for debugging PHP; even though we all still have our own favorite editors, when we need to debug we'll still use Netbeans.
Code completion, phpdoc 'tooltips' on completion, and debugging all work flawlessly for me regardless of what platform I'm developing on (Windows, OS X, Linux) and I cannot say the same about Eclipse PDT (code completion would often miss, I'd run into problems or crashes debugging,etc.) in my personal experience.
So, I apologize in advance if this is a non-answer to a non-question - but maybe try out Netbeans?
Are you sure, you can use Xdebug to debug Yii (or any other framework-based) applications at all? Since Yii introduces URL-rewriting based on MVC pattern, I think you can't.
I don't have much experience with Xdebug, but from what I have found I clearly see, that it (along with Eclipse PDT) strongly depends on URL shown in Eclipse's internal browser, when debugging.
So, taking for example an URL from your screenshot:
http://localhost/testdrive/index.php?r=dispozitive
As you mentioned, Eclipse has correctly opened index.php, which is normal, as it is directly referenced in URL and you problably pointed it out as start file in debug configuration window.
Buth going further. How would you like Eclipse to understand, that route dispozitive (where route itself is a completely Yii concept (or similar framework) and Eclipse / Xdebug / PHP knows nothing about it) or that ?r=dispozitive URL parts corresponds to executing protected/SiteController.php file in your file system and calling default actionIndex() from it? So it could know it should open it in IDE and possibly stop execution on there defined breakpoints.
This process and concept (routing) is 100% authored by Yii and done by it internally, so how would you like Eclipse or Xdebug to know anything about it?
As I wrote, I don't have much experience in debugging Yii applications, but from what I have found until know, I clearly see, that you can't debug PHP applications with Xdebug, if they are using any kind of URL-rewriting methods. This technique (debugging with Xdebug) works IMHO only in case of applications, where URL changes directly reflects files in filesystem in your application contents.
EDIT: Additionally, check which version (package) of Eclipse you have? It turns out, that Helios package has some bugs and doesn't stops on breakpoints. Which makes it pretty useless for debugging process. You should consider using Galileo Package Eclipse for PHP Developers instead.

Magento Code Debugging Through Eclipse PDT

I am trying to debug Magento Code through Eclipse PDT. I configured X-Debugger properly and apply breakpoints in index.php file and launch the debugging session. I started debugging the code line by line but it get stop at last line of index.php file.
Actually i just want to debug the one-page checkout process of Magento. I have applied breakpoints in OnepageController.php file and gone through Onepage Checkout process but Eclipse does not stops at break points. Please help me.
I was busy for many days to find an installation (in 2012) for debugging Magento. Eclipse, Netbeans and PhpDeveloper all failed for XDebug (stopped only at first breakpoint) in a Xamp installation (my experience) and I could not load a ZendDebugger.dll as well. You find indeed a lot of outdated articles about this subject.
But finally I can debug Magento without problems (you need a debugger as a professional for Magento). I downloaded Zend Server CE and if you have a latest Eclipse PDT version downloaded (take the one from Zend) debugging works like a charm (all settings are done already by Zend, so no mistakes and wasting of time anymore). You should see when a webpage had finished that the php program had terminated (no error, is normal, for a next page php programs are started again). One problem yet Connect Manager does not install extensions anymore, BUT while debugging admin it works too (yes funny, but that’s Magento, it takes all your time). You can debug admin by adding /admin to the url in the debug browser window (just that simple).
Now the debugger is working fine, i think the problem was occurring due to wrong configuration of eclipse PDT. To know how to configure eclipse PDT and X-debugger
please visit
http://devzone.zend.com/1147/debugging-php-applications-with-xdebug/
http://subesh.com.np/2010/01/debugging-magento-eclipse-pdt-zend-debugger/

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.

Vaadin - GWT error "module xxx may need to be recompiled

I'm ramping up on Vaadin and I'm getting this javascript alert whenever I try and run the demo apps.
GWT module 'com.vaadin.terminal.gwt.DefaultWidgetSet' may need to be recompiled
I've tried cleaning the project to no avail.
As I said, I'm ramping up so I'm sure there's some simple step I'm missing or a concept I haven't grasped.
I don't know anything about Vaadin, but there's a more general context in which this error occurs:
So long as you're testing in Eclipse, the dynamic coding of your app is still real Java coding being run in a JVM. This coding is made available through debugger that's accessible via a socket. You get a URL that looks like this:
http://127.0.0.1:8888/MyApp.html?gwt.codesvr=127.0.0.1:9997
with this codesvr thing being your eclipse-hosted debugger process for your Java code.
Before your app can run standalone, GWT has to translate your Java code to JavaScript; separate versions of the code are produced for each browser type (Firefox, WebKit, Opera, ...) and language that you want to support. Only once this is done can you access your app the usual way via
http://127.0.0.1:8888/MyApp.html
After weeks of running my app only in Eclipse, I'd managed to forget about the compiling-for-browsers step and wondered about the message. The way to fire up the compiler, if you're not using the Ant task, is to hit Google|GWT Compile in the project's context menu. That done, the JS in your app gets fleshed out and your app can run without Java on the client side.
And of course the message goes away.
It is a warning not an error. Does the app work? Otherwise you have to recompile the Vaadin widgetset. These might help too: http://vaadin.com/directory/help/using-vaadin-add-ons
Often this message meens:
you're missing the ?gwt.codesvr=127.0.0.1:9997 parameter in the URL (or have misspelled it).
your module uses the xs linker <add-linker name="xs" />. This is a known limitation and will be fixed in the future: Issue 4232: Allow Development Mode to work with XS Linker
You may need to clear the browser cache. It is possible that the compiled js that the browser is using is not the js that has most recently been compiled.
In Chrome you can see if the cached js is being used in the developer tools windows (ctrl + shift + i). In the size column it will say (from cache) instead of the actual size. You can then right click and clear the browser cache. ctrl + r to reload and the error should be gone.
Carl Smotricz is absolutely right.
Just Cleaning and Build Project on the topmost menu doesn't work.
You must use "Google | GWT Compile" on the context menu generated when right-clicking on your GWT project, prior to deployment.
The error may not be about not-adding "?gwt.codesvr=127.0.0.1:9997" at the end of host web page if he or she tried to deploy the GWT-based webapp on WAS external to Eclipse.
Server restart did the job for me.
I had tried clearing cache, clean and rebuild .. but i was still getting the same warning message.
Server restart made it reload all the stull from the latest compiled war.
It was a hit and trial and i am glad it worked :) :)