Debugging a Google Web Toolkit application that has an error when deployed on Google App Engine - debugging

I have a Google Web Toolkit application that I am deploying to Google App Engine. In the deployed application, I am getting a JavaScript error Uncaught TypeError: Cannot read property 'f' of null. This sounds like the JavaScript equivalent of a Java NullPointerException.
The problem is that the GWT JavaScript is obfuscated, so it's impossible to debug in the browser and I can't reproduce the same problem in hosted mode where I could use the Java debugger. I think the reason I'm only seeing the error on the deployed application is that the database I'm using on the GAE server is triggering something differently than the test database I'm using during testing and development.
So, any ideas about the best way to proceed? I've thought of the following things:
Deploy a non-obsfucated version of my application. Despite a lot of Googling, I can't figure out how to do this using the automatic deploy script provided with the Google Eclipse Plugin. Does anyone know?
Download and copy my GAE data to the local server
Somehow point my development code to use the GAE server for data instead of the local test database. This seems like the best idea...
Can anyone suggest how to proceed here?
Finally, is there a way to catch these JavaScript errors on the production server and log them somewhere? Without logging, I won't have anyway to know if my users are having errors that don't occur on the server. The GWT.log() function is automatically stripped out of the production code...

1) If you can replicate the needed state of your GAE database locally, then run the javascript compiled version on your local machine. This will almost certainly give the same error, but is a lot less expensive than a full AppEngine deployment. Do this by compiling your app with the GWT compiler, then start it normally, then point your browser to the specified address without the ?gwt.codesvr=127.0.0.1:9997 part.
2) Use the -style PRETTY or -style DETAILED with the GWT compiler to get nicer javascript. If you compile locally with this flag once, then deploying to AppEngine (with the Eclipse plugin) will send the same non-obfuscated version.
3) Instrument your code (Window.alert() works fine) to figure out exactly where the error happens. This is especially useful to find where the javascript execution deviates from the hosted mode execution.
4) Speed-up your compilation process by keeping only one permutation. See how to do this there:
How do I speed up the gwt compiler?
5) Javascript errors that don't show up in the development version or in unit tests are (almost always) due to a bug in GWT, after you've investigated a little, drop by the GWT forum or issue tracker and see if it's a known bug and whether or not there is a workaround.

Related

Separating frontend from backend

For development purposes I need to have a better separation of my frontend from my backend.
We have an application built using Vaadin 8, and currently we are experiencing some problems on how our back end updates are pulled into our designer’s local environment causing most of the time compilation problems, that require help from a developer in order to be solved.
Since our designer only pushes SCSS files to our repository, we thought that maybe a temporary workaround for this problem would be doing an application wide cache, so he can work on a static version of the whole application and work on the SCSS without worrying about back end compilation process.
I know this is a development process issue, but since we need to find a quick solution and carry on , we thought that maybe this might do the job.
i found this related thread:
Vaadin 8 - application-wide cache

Ruby/Sinatra: Load additional code without restarting web app

I want to build a plugin system for a web app I'm writing. I don't want to have to restart the application every time a plugin is added/removed/enabled/disabled. Also I won't know the names of the plugins or even how many there are (I want to make it 'infintely' expandable).
The obvious way would be to reload the app on every request (as in this question, the Sinatra FAQ, and with Sinatra-Contrib). Reloading on every request would have poor performance for a production environment, especially a popular app.
I have read an article about Kernel#load and that it reloads the file when called multiple times and Kernel#autoload which only loads the code if needed. But both methods require the name of the module/class to be hard-coded in.
Jenkins CI and WordPress imply they can do this. Jenkins says "1000+ community contributed Jenkins plugins" and WordPress says "48,492 plugins". So I imagine it must be possible, but maybe only in Java or PHP.
I am working with Ruby 2.2, Rack 1.6.5, and Sinatra 1.4.7. I'm developing on Windows and I plan to deploy to Linux. If what I want is impossible to do on Windows (annoyingly some things are :P) I will set up a dev server with Linux.
Thanks!
EDIT: I will also need to be able to unload plugins. I'm not aware of any unload/un-require methods

MSTest: No test discoverer is registered to perform discovery of test cases

I created a console application that was designed to be completely self-reliant and contain all the necessary DLLs to run. I was able to do this and get it to run locally, but when copying to another computer I began to receive this message...
"No test discoverer is registered to perform discovery of test cases. Register a test discoverer and try again."
I found this Microsoft bug report, but it was closed as could not reproduce:
https://connect.microsoft.com/VisualStudio/feedback/details/770093/unit-test-project-not-discovering-test-cases
I didn't want to sit around waiting for Microsoft to say they couldn't reproduce so I dug into it and found that the reason I was getting this error message is because I was missing the DLL file "Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll".
This is the file that contains the test discoverer and it needs to be in directory of the executable that is running the tests as well as the directory of the test files themselves. It is easy to miss because the assemblies to run the tests appear to be completely contained within the "Microsoft.VisualStudio.TestPlatform" namespace and the tests appear to only require a reference to "Microsoft.VisualStudio.TestTools.UnitTesting".
I decided to post this "knowledge share" post because there was no other information about the issue on the internet and Microsoft's documentation of their MSTest framework is bad at best.
Just come across this issue with some unit tests originally written in .Net 3.5 and running (or not) in vs 2013.
The UnitTestFramework.dll mentioned by Love2Learn was present however updating to .Net 4.5 seems to resolve the problem.
I'm sure someone out there can explain why but my gut feeling is that this has something to do with this being a multi-platform solution and that .Net 4.5 is just better at running 32bit unit tests against 64bit projects.

Running Umbraco source code in Windows 7 only produces login screen

I am trying to get started in development of my website and plugins using Umbraco. When I download the binaries from Codeplex, the installation and running of the website works fine. When I downloaded the source code, All I get is a login screen even when the web.config files are the same. Am I doing something wrong or is there something I missed.
The path I use to map IIS to is
branches\4.1.0\umbraco\presentation
You need to compile the source code to get it to work.
To be honest, you shouldn't need the full source unless you really want to start hacking around in the core (which may cause you problems with future updates) or you want to see how stuff works. The Umbraco framework is pretty extensible, I've not found too much so far that I couldn't do without having to touch the core source.
I had a similar issue when running the source and that was that the hashing of the admin password did not work. So i debugged it to see what value was expected and then changed it in the database.

What is the simplest way to set up a BIRT report viewer for a xulrunner application?

I recently began using BIRT and have developed a report to use with my xulrunner application. What I haven't yet figured out is how I should deploy the viewer. It seems like BIRT mostly targets Java applications, so there are instructions for deploying on J2EE, JBoss, and other technologies -- with which I am not familiar (but I'm not developing in Java anyway).
Reviewing this article on deploying BIRT and reviewing the deployment details on BIRT's web site, I'm not sure where to go. I wasn't expecting to have to add some large Java dependency for the xulrunner application --is there no way I can drop an executable in with my xulrunner app, call it from my app, and pass it a report document? (Or something else that would be simpler than learning and using J2EE, JBoss, tomcat?)
It appears that there is a genReport.bat file in the run-time somewhere that can generate reports from the command line. This appears to be what I need, and this article describes it.
(11/2014) I'm going to add:
download Birt runtime from: http://www.eclipse.org/downloads/download.php?file=/birt/downloads/drops/R-R1-4_3_0-201306131152/birt-runtime-4_3_0.zip
extract somewhere and set a new Environment variable BIRT_HOME=path_to_where_you_extracted
remember to add your database library into \ReportEngine\lib , (ex: jtds.jar)
Open a console inside ReportEngine dir and run:
genReport.bat -f PDF -o PATH/GENERATED_REPORTS/REPORT.pdf -F "PATH/TO/REPORT.rptdesign"
And that's all what I needed to do

Resources