Grails

Run multiple app instances with diff config files on same tomcat server

The application I am working on, requires different configurations for the each client. For internal QA environment, we wanted to deploy multiple instances of this app with different configuration setup so that it can be tested easily and without creating tomcat instance for each deployment. So the challenge was to use different external configuration file […]

Automation TestingGrailsJava/JVM

Handing Browser Alert Box Using Selenium Web Driver

Recently while working on selenium I have come across in a situation where browser dialog box are the show stopper to validate ‘Login/Registration/Forgot Password etc.’ modules, though we are considering such cases as design issues. However we need to deal with it to learn something new, fortunately I have got the solution to handle browser […]

Grails

Adding interactive charts to web pages using Highcharts

I recently had to add charts to a web page in my project. I used Highcharts library for this. It is very dynamic allowing you to change graphs even after the chart has been drawn. To display a graph we need a div with an ID. Let’s say we have div with ID “chartDivId” and we want to display two lines […]

Grails

SSH Tunneling through a secure box

Hi, many of us must have landed into a situation which I faced recently, the issue was with one of the new features deployed to PRODUCTION environment in the latest release not working as expected, but I was unable to reproduce this on Local or QA environments. So to debug it quickly, I tried something […]

Grails

Adding field to hasMany, got MySql error ??

It’s a common practice to add fields to Grails domain’s hasMany block while in database a foreign key relationship is maintained for every such entry. In other words, for each foreign key, we have a column in parent table (or domain) and a reference column in other table. I was adding a field into hasMany […]

GrailsJava/JVMTechnology

Migrating Code Base from SVN to GIT

Hi all, I have a use case where I need to migrate the code base from svn to git while preserving all the commits of different committers. For migration I have used an utility tool git-svn. In order to install git-svn we can use below command in linux box : sudo apt-get install git-svn After […]

Grails

Compile GroovyScript at Runtime and allow caching of compiled source to avoid recompilation at Runtime using GroovyClassLoader

In some cases we need mechanism to provide compilation of groovy script at runtime. But at the same time we need to make sure it doesn’t consume the JVM to perform compilation every time when we try to access that script. Hence to perform this we need to do the following task : Compile Groovy […]

Grails

Log SQL Query with Data Bindings in grails for a piece of code

Although in grails, we can use the logSql property in the DataSource file to log SQL queries or enable loggers “org.hibernate.SQL” for logging queries and “org.hibernate.type.descriptor.sql.BasicBinder” for logging bindings. But this solution wouldn’t be that much helpful if we just want the logging for a particular piece of code rather than the whole project. So […]

AWSGrailsJava/JVM

File Upload on Amazon S3 server via HTML Form

Use Case :   File upload was require on web by end user which needs to be frequent and multiple at a time and if it goes through our tomcat server than it would be overhead on server . So for that we directly send the file to S3 server. We can upload file on Amazon S3 Server […]

Services