SrcCodes

org.springframework.aop.framework.AopConfigException: Cannot proxy target class because CGLIB2 is not available

Spring AOP uses either JDK dynamic proxies or CGLIB to create the proxy for a given target object. If the target object to be proxied, does not implement any interfaces then a CGLIB proxy will be created. In this situation if CGLIB is not present in the classpath following exception

Send logs by Email Notification using Apache log4j SMTPAppender

It is always better to get notified as soon as any major issues / exceptions occurred in the Application, instead of manually going thorugh huge logs to find probable exception messages. Apache log4j provides out of the box log Appender (called SMTPAppender) to send email alerts for the log level configured

Deploy to AppFog PaaS using Cloud Foundry Integration plugin of Eclipse / STS

AppFog Cloud Platform is built by using the Cloud Foundry OSS bits alongside its own set of custom extensions and enhancements. AppFog provides good command line tool to deploy application but we can configure Cloud Foundry Integration plugin of Eclipse / Spring Tool Suite (STS) to deploy web application directly from

Configure Simple Logging Facade for Java (SLF4J) with log4j as underlying logging framework

Simple Logging Facade for Java (SLF4J) is an abstraction of different logging frameworks (eg. log4j, java.util.logging, commons logging etc.). This tutorial describes how to configure SLF4J with log4j as underlying logging framework. To use SLF4J, it is required to include 3 jars SLF4J API (slf4j-api-x.x.x.jar)

Example to Generate Random Alpha Numeric Text

This example shows how to generate random alpha numeric text which is not easy to guess.

SrcCodes © 2026