Spring AopConfigException

Description:
org.springframework.aop.framework.AopConfigException: Cannot proxy target class because CGLIB2 is not available. Add CGLIB to the class path or specify proxy interfaces.
Spring is using cglib to create it's proxies, therefor you need to add the cglib jar to your classpath.


Solution: Add the following dependency to your pom.xml :
        
            cglib
            cglib
            2.2.2
        

Set up a maven web project in Intellij with Spring and JPA - Part Seven

Welcome to part Seven of this tutorial series! After configuring our Spring MVC setup in the last tutorial we will now implement it. First of all let's have a look at our index.jsp and change it to this:


We only need this one line of code here.



Now create PostController.java in the blog.controller.dao package and mark it with @Controller.

Set up a maven web project in Intellij with Spring and JPA - Part Six

Hello, welcome to part 6 of these series. Today we will be covering how to configure spring mvc in a web application.

First off all let's configure our web.xml which at this point should look something like this

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
    http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
           version="3.0">

</web-app>


In a web application you can tell Spring to load config files in the following way: If you would like to pass more config files just separate them with a comma.

Set up a maven web project in Intellij with Spring and JPA - Part Five

Here we go for part 5 of this tutorial series! This part will cover our Data Acces Object Layer (DAO).
We will be mainly talking about CRUD (create,update,delete) operations using JPA and Spring.


I should start by saying that we will use an Interface and an Implementation for each Entity.
This way we can easily switch database providers later if we would like to.

The PostDao interface:
package blog.dao;

import blog.domain.Post;
import java.util.List;

public interface PostDao {
    List<Post> findAllPosts();
    Post findPostByPostId(Long postId);

    void create(Post post);

    void remove(Post post);

    void update(Post post);

    List<Post> findMostRecentPosts();
}

note that we created crud methods and some other selection methods we'll need later.

Set up a maven web project in Intellij with Spring and JPA - Part Four

Hello, welcome the part four of this tutorial. Today we will be adding Spring configuration to our application.
Start by creating the following packages: blog.dao and blog.service.
The next thing we will be doing is adding the Spring configuration file: add applicationContext.xml file to your WEB-INF folder.

The basic setup of this file should look like this:






This configures the namespaces we will be needing in our configuration. Next we will have a look to what we will need specifically.

Set up a maven web project in Intellij with Spring and JPA - Part Three

Here we are for the third part of these tutorial series, we will now cover how to map create our JPA mappings.
This tutorial will be using a simple blog example from now on, using a simple mysql database.

Ok let's start by introducing our first entity "Post":

Set up a maven web project in Intellij with Spring and JPA - Part Two

Hello again, in this tutorial we will continue our MavenWebapp project we made earlier.
This part will focus on configuring maven.

When opening the pom.xml you should now have the following code:

    4.0.0

    MavenWebapp
    MavenWebapp
    war
    1.0

    



Set up a maven web project in Intellij with Spring and JPA - Part One

Hello everyone, in this article i will you how to setup a web application with maven integration in Intellij.
I'm planning to make it a mutli-part tutorial on how to configure maven with spring and jpa. This is the first part in the tutorial, more coming soon.



  1. Open your Intellij, navigate to file -> new project and create a project from scratch -> next

Adding SyntaxHighlighter to Blogger

In this tutorial I will cover how to implement SyntaxHighlighter to your Blog. First of all... SyntaxHighlighter is a javascript based syntaxhighlighter which supports the most popular programming languages such as java, .NET, javascript, etc.

For more info please refer to http://alexgorbatchev.com/SyntaxHighlighter/. Implementing SyntaxHighlighter is very easy to use I will show you in a few steps how to add the hosted version to your blogspot blog.

Let's get started, the first thing to do is go to the Designer view.
Template -> Edit HTML -> proceed

Search for the <head> tag and paste the following code right under it: