Java/JVM

Issues while Migrating from Java6 to Java8 in AEM 6.1

Recently while working on AEM 6.1, I had to move from Java 6 to Java 8. Simply changing the Java version in POM led to some issues with OSGi services. Specifically, those services that were using @Reference annotation were not getting active and remained in "satistied" state. Here are all the steps I followed firstly to change Java...

by Shiffali Grover
Tag: Java
30-Oct-2015

Grails, iOS

Push Notification in IOS Using Grails

Hi All, In my previous blog . I have explained how to send the push notification to Android Device. Now, it's time to see how we can send push notification to iOS devices. For sending Push Notification in iOS I have used JavaPNS_2.2.jar . So before, directly jumping on example we should know that what are prerequisites of...

by madhav.khanna
Tag: Java
31-Jul-2015

Android, Grails

Push Notification in Android Using Grails

Hi All, I had a use case where I need to send the push notification to Android Device using Grails Application. For sending push notification I have used the Android GCM plugin. So, before going further we should know what is push notification and how it works. Push Notification : It is a message or events delivered by a...

by madhav.khanna
Tag: Java
31-Jul-2015

Technology

Perform any DB operation in an isolated transaction

Hi Friends, Sometimes we need to perform any DB operation in between a transaction, but due to transaction's property, it's getting committed only once the parent transaction will be finished. If you need to perform any operation that need to be committed immediately, irrespective of parent transaction (Example : for a dependent...

by Anil Agarwal
Tag: Java
28-Jul-2015

Grails, Java/JVM

Sending Scheduled/delayed messages with RabbitMQ through java client

The requirement to send delayed/scheduled message is to publish any message with a delay time. To achieve this, earlier we had to use dead letter exchange but now we can send scheduled/delayed messages from RabbitMQ with "rabbitmq_delayed_message_exchange" plugin. we can send scheduled/ delayed messages from rabbitMQ by following these...

by Vishal Kumar
Tag: Java
28-Jul-2015

Grails, Technology

When details in principal object of spring security are not sufficient

Sometimes we need to access details of current logged in user but that will be an additional database query. To save that query we can use principal object of Spring security which provides details of logged in user . But by default principal object have few fields like id, username and password. If we need to access user's name /...

by Lovin Saini
Tag: Java
24-Jul-2015

Automation Testing, Testing

Useful Functions for Automation Framework using Selenium Web Driver

While doing automation using selenium, there are certain repetetive tasks that we need to perform in order to handle page elements. So, the aim of this blog is to highlight some common operations that we need to handle every now and then. Some operations are: 1. Open URL in different browsers (Chrome, Firefox, IE) 2. Do mouse-hovers ...

by Sumit Gambhir
Tag: Java
28-May-2015

Grails

Receive Email using SubEthaSMTP (The local SMTP server).

In my Grails app, I came across a requirement of setting up an SMTP server for receiving mails and extracting their content. After exploring a lot I found SubEthaSMTP to be the most suitable. SubEthaSMTP lets your application receive an SMTP mail very easily. To setup an SMTP server in your application, You need to follow the steps as...

by Akash Sethi
Tag: Java
14-May-2014

Technology

Apache HTTP Conditional Policy Requests for checking whether resource is modified or not and reduce unnecessary processing

Hi, Before writing this blog, I would first like to make you familiar with one quote "Be liberal in what you accept, and conservative in what you send". Yes that's what HTTP robustness protocol states. Scenario : We have a use case where our server need to read XML files that are large containing 400 outer element with extremely...

by Tarun Pareek
Tag: Java
18-Apr-2014

Grails

Getting property class from property name

Recently in one of my project i had a requirement of identifying the class of a property of an object with object class and property name and then determining whether it's an Enum class or not. I found an easy solution for this using Reflection API. Using Java Reflection you can inspect the fields (member variables) of classes. This is...

by Sachin Verma
Tag: Java
26-Sep-2012

Grails

How to implement AOP Profiling in Grails application

In one of my recent project, i want to profile method execution time. I have used Spring AOP to profile method execution time. It's very easy to implement AOP profiling in grails 1. Suppose we have below mentioned service class, we want to log execution time of method saveDataStudent,saveDataUpdated methods in service class. We need...

by Mohit Garg
Tag: Java
25-Sep-2012

Technology

Normalization Forms for Accented Characters in Java

Text Normalization is the process of "standardizing" text to a certain form, so as to enable, searching, indexing and other types of analytical processing on it. Often working with large quantities of text we encounter character with accents like é , â etc. Unicode provides multiple ways to create such characters . For example we can...

by Sachin
Tag: Java
29-Jun-2012