Wrox Programmer Forums
|
BOOK: Beginning Spring Framework 2 ISBN: 978-0-470-10161-2
This is the forum to discuss the Wrox book Beginning Spring Framework 2 by Thomas Van de Velde, Bruce Snyder, Christian Dupuis, Sing Li, Anne Horton, Naveen Balani; ISBN: 9780470101612
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Spring Framework 2 ISBN: 978-0-470-10161-2 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 20th, 2008, 03:43 AM
Registered User
 
Join Date: Sep 2008
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default AOP does not work

Hi People,

i downloaded the latest code for beginning Spring 2. Since the code base does not include sample for AOP i tried to add some AOP features to the Pix application.

i added the following segment to the pix-servlet.xml

<aop:config>
        <aop:pointcut id="samplePointcut"
                      expression="execution(com.wrox.beginspring.pix.dao .persistUser(..))"/>

        <aop:aspect id="sampleAspect" ref="advice">
            <aop:around method="lookup" pointcut-ref="samplePointcut"/>
        </aop:aspect>
    </aop:config>

    <bean id="advice" class="com.wrox.beginspring.pix.cache.CacheService "/>

also implemented the class wrox.beginspring.pix.cache.CacheService with the method "lookup"

When i try to deploy first it gaves a ClassNotFoundException with the class name org.objectweb.asm.commons.EmptyVisitor
This class is there in the asm-commons-2.2.1.jar.
Once i added this jar back again it says ClassNotFoundException for org.objectweb.asm.FieldWriter.

this class(FieldWriter)is not there in the asm-1.5.3.jar but it is there in the asm-3.1.jar.

when i add this jar (after deleting asm-1.5.3.jar ) it gives the following error.

hodError: org.objectweb.asm.ClassWriter.<init>(Z)V
Caused by:
java.lang.NoSuchMethodError: org.objectweb.asm.ClassWriter.<init>(Z)V
        at net.sf.cglib.core.DebuggingClassWriter.<init>(Debu ggingClassWriter.ja
va:47)
        at net.sf.cglib.core.DefaultGeneratorStrategy.getClas sWriter(DefaultGene
ratorStrategy.java:30)
        at net.sf.cglib.core.DefaultGeneratorStrategy.generat e(DefaultGeneratorS
trategy.java:24)
        at net.sf.cglib.core.AbstractClassGenerator.create(Ab stractClassGenerato
r.java:216)
        at net.sf.cglib.core.KeyFactory$Generator.create(KeyF actory.java:145)
        at net.sf.cglib.core.KeyFactory.create(KeyFactory.jav a:117)
        at net.sf.cglib.core.KeyFactory.create(KeyFactory.jav a:108)
        at net.sf.cglib.core.KeyFactory.create(KeyFactory.jav a:104)
        at net.sf.cglib.proxy.Enhancer.<clinit>(Enhancer.java :69)
        at org.hibernate.proxy.pojo.cglib.CGLIBLazyInitialize r.getProxyFactory(C

which version of the asm jar file should be added ?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 1 Ctrl+F5 don't work, F5 does work? jimboak BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 7 June 29th, 2008 03:46 AM
aop source code missing ccp2p BOOK: Beginning Spring Framework 2 ISBN: 978-0-470-10161-2 0 March 7th, 2008 11:50 AM
What is the difference between AOP and IoC kotaiah Spring 0 September 6th, 2007 01:21 AM
Ok, this should work but it is not polorboy PHP How-To 0 January 25th, 2007 01:34 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.