Wednesday, November 28, 2012

Remote Debugging Client Side GWT Code

A while ago I had to remotely debug client side code of a GWT application already compiled and deployed  onto a server. After searching around and reading this document a few times, I finally managed to do it following these steps:
  1. Compile and install the application on the server and write down the URL (like
  2. Create an Application launcher (Run->Edit Configurations->Applications in IntelliJ).
    • Set the main class to:
    • Put this line in the program arguments: -noserver -war target/myapp -logLevel DEBUG -startupUrl -port 8080 my.package.myapp.Module
  3. Debug this new run configuration. This will run the GWT Dev Mode and enable you to set breakpoints on the client side code.
  4. Copy and paste URL provided by Dev Mode into your browser (like You will need to modify Dev Mode extension options to allow this new combination (of app server and code server). On Chrome, for example, you can do this by clicking on the greyed out Dev Mode logo if you get an error.
  5. Remotely debug the server in the normal way (JDWP) to be able to debug server-side code as well.

Friday, November 9, 2012

Expired/Expiring passwords and CAS

Once I had CAS working with our users database, the next step was to support expired user passwords or those in the grace password. CAS supported neither of those cases out of the box. Searching for it landed me on this page describing a solution, but it was old and not compatible with a fairly recent CAS source code. It was also coupled with LDAP which I didn't need.
After spending some time, I finally managed to extend CAS to provide a generic enough support for such cases. With no more ado, I am providing you a patch here that can be applied to the 3.4.11 version (and later version with possibly not much more effort). In order to enjoy this, just download CAS from here and apply the patch provided.
Though, I could extend from CAS Maven module (as described here) but then I had to repeat so many things because of a small change, making things more confusing. I am hoping to get this patch added to the main code, if guys over there are happy with it.