Spring Tutorial 27 - Writing Our First Aspect Part 2

preview_player
Показать описание
Now that we have a basic Spring application, we'll implement the Logging aspect. We'll learn how to create a new Aspect using annotations and configure an advice to run before a getter method.
Рекомендации по теме
Комментарии
Автор

Excellent job, Kaushik ! I am really impressed with the way you build up concepts one over the other with a very easy to understand example of Shape, Circle and Triangle. Awesome work !

jpkakkassery
Автор

the "problem" with Koushik's videos is that you need to use your brain sometimes to understand them and adapt his code to the version of Spring you use. However I dont think this is such a big issue if you want to reuse the knowledge you got from Koushik's work. So unless you will only make circle and triangle shape with Spring I advice you to stop complaining and start use your brain to understand how it works....
For me, with Spring 3.2 everything works fine, with a little help from my brain

ecolibacteri
Автор

Hello Koushik, really clear tutorials.
Could you please redo the spring tutorials with the latest version of spring?

shivakumar
Автор

I personally switched to spring aspect along with aspectJ compile time weaving, incredible tool because the code is generated with the aspects already wired in. The best thing ever is the @Configurable class, which makes everything created with new as bean, thus @Autowires work. Improves spring immensely.

EnerccioCEO
Автор

The aop concept explained is very clear, excellent job done

sudhasharma
Автор

Works perfectly for me. Running Spring 3.1.2.

amsfuy
Автор

Hi Koushik, your tutorials are like brain tonic ! I Please put some more fast plzz.

jabroomunda
Автор

koushik could u please upload a vedio tutorial of spring will be really

sidasim
Автор

The answer given in that link is: "You have mismatching versions of cglib and ASM. Stacktrace tells overrides final method visit", in other words which extends org.objectweb.asm.ClassWriter tries to override final method visit, which of course fails.

For example maven dependendy for cglib 2.2.2 pulls asm 3.3.1, so this is one combination worth of trying."

LeBadman
Автор

As ligrab mentioned, the current download of ASM is 4.0 which throws error and the error description is tough to understand. Else, the tutorial is excellent as usual..

pramodtalekar
Автор

It finally work when I changed de aopalliance-alpha for aopalliance-1.0
@ligdrab is right, add the exact libraries as Koushik to avoid exceptions. =P

mcrnin
Автор

@ligrab
For me, It didnt worked for asm 3.3.1 also. I tried degrading to asm 1.5 and it worked.

depojatin
Автор

Why do you have to specify the Aspect class in both the spring.xml file and by annotations in the LoggingAspect.java class?
Shouldn't Spring be able to tell from one OR the other?

TimBee
Автор

Fix!!! aopalliance-1.0.jar

The aopaplliance-alpha1.jar does not contain the Advice class, so to be able to use it you have to download the aopalliance-1.0.jar file separately. One link that has the file is here: mvnrepository . com / artifact / aopalliance / aopalliance

Thanks again Koushik!

KentOJohnson
Автор

why is everything placed in separate packages?

DenUil
Автор

Many of your videos not working. I was going through all, so i have found till now that Tutorial - 18, 20, 23, 25, 26, 27 are not working. I hope it gets fixed sooner. I dont want to loose my flow. Completely involve in your videos.

skrajath
Автор

Hey koushik thanks for tutorials. But it does not seem to be working with Spring 3.2. Any help?? Thanks..

barry_allen
Автор

it does not work when i'm using [bean name="loggingAspect" /]

i got exception:

rror creating bean with name 'circle' defined in class path resource [spring.xml]: Initialization of bean failed; nested exception is java.lang.VerifyError: class overrides final method


Can you help me about this, Thank you

adamtimus
Автор

Hello Koushik,
Thanks for such a nice tutorials

moreover i have one problem while executing the same code with same dependencies
"Build path is incomplete. Cannot find class file for

following jars i used
aspectj-weaver.jar
asm-3.3.1.jar
aspectjrt.jar
cgilib 2.2.2.jar
aopalliance-1.0.0.jar

kirtisharma
Автор

No matter what.. it does not work for me!!! Links provided by koushik has no longer the downloads in them :(

aoozzooa