java-logo

Exception in thread “main” java.lang.IllegalStateException: CGLIB is required to process @Configuration classes

During developing Spring applications we might get below exception, basically we might get this exception when we are using “@Configuration” annotation in our Application and we are not adding the “cglib-nodep”  jar in to class path.   Mar 11, 2015 3:59:36 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO: Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@1d8c528: startup date [Wed Mar 11 15:59:36 IST 2015]; root […]

spring1

spring javaconfig example – @Configuration

In this tutorial we are going to explore how we can achieve to build a completely XML-free sample Spring  application. Before Spring 3.0  we are using XML based approach to configure our beans in xml file. But in Spring 3.0 we have new feature “@Configuration”  which is useful to configure our beans in programmatically. let us have […]

spring

Spring Bean Scopes Example

In this tutorial we will lean what is the significance of spring bean scopes. There are 5 types of scopes supported by spring Framework. singleton – Return a single bean instance per Spring IoC container prototype – Return a new bean instance each time when requested session – Return a single bean instance per HTTP […]

spring

How To Load Multiple Spring Bean Configuration Files

In general in spring projects we need to maintain different modules and different bean configuration file for specific module for maintainability and easy to understand.Consider there are 5 modules in our project like module1 and module2….module5 and one common module , so we have Six config files. so we may write code like this to load […]

spring

Spring Bean reference Example

In Spring, we can access beans i.e reference from the same or different bean configuration file, just have a look in to below scenarios. scenario 1: if the Bean is in different XML file If you are trying to access bean from different XML file, then we need to use ‘ref‘ tag with ‘bean‘ attribute. […]

spring

Constructor Injection example in Spring

In this tutorial we will learn how to inject values to bean via constructor injection in Spring 4.1. Technologies used in this article : 1. Spring 4.1.1 2. Maven 1.4 3. Eclipse 4.2 4. JDK 1.6 5. Spring IDE 1. Add Spring 4.1 Dependencies to the project Please add the Spring 4.1 dependencies like as in […]

spring

Setter method injection tutorial

In this tutorial we will learn how to inject values to bean via beans configuration file (beans.xml) in Spring 4.1. Technologies used in this article : 1. Spring 4.1.1 2. Maven 1.4 3. Eclipse 4.2 4. JDK 1.6 5. Spring IDE 1. Add Spring 4.1 Dependencies to the project Please add the Spring 4.1 dependencies […]

spring

How to Inject object reference to bean Example

In this tutorial we will learn how to inject values to bean via beans configuration file (beans.xml) in Spring 4.1. Technologies used in this article : 1. Spring 4.1.1 2. Maven 1.4 3. Eclipse 4.2 4. JDK 1.6 5. Spring IDE 1. Add Spring 4.1 Dependencies to the project Please add the Spring 4.1 dependencies […]

spring

setter method example in spring

In this tutorial we will learn how to inject values to bean via beans configuration file (beans.xml) in Spring 4.1. Technologies used in this article : 1. Spring 4.1.1 2. Maven 1.4 3. Eclipse 4.2 4. JDK 1.6 5. Spring IDE 1. Add Spring 4.1 Dependencies to the project Please add the Spring 4.1 dependencies […]

spring

Hello world Example in Spring 4

In this tutorial we will learn how to create a simple hello world example in Spring 4.1. Technologies used in this article : 1. Spring 4.1.0 2. Maven 1.4 3. Eclipse 4.2 4. JDK 1.6 5. Spring IDE 1. Add Spring 4.1 Dependencies to the project Please add the Spring 4.1 dependencies like as in […]