开发者

replaced-method question in spring 3

开发者 https://www.devze.com 2023-01-25 06:15 出处:网络
Excuse me. I\'m a beginner of spring. Now, there\'s some question in it. I\'m reading Spring in action and try the code in MyEclipse. But when I try the code of replaced-method, there\'s a error.

Excuse me. I'm a beginner of spring. Now, there's some question in it.

I'm reading Spring in action and try the code in MyEclipse. But when I try the code of replaced-method, there's a error.

    <bean id="harry" class="com.springinaction.sprintidol.Magician">
    <property name="magicBox" ref="magicBox" />
    <property name="magicWords" value="Bippity boppity boo" />
</bean>

<bean id="magicBox" class="com.springinaction.sprintidol.MagicBoxImpl">
    <replaced-method name="getContents" replacer="tigerReplacer" />
</bean>

<bean id="tigerReplacer" class="com.springinaction.sprintidol.TigerReplacer" />

This is the applicationContext.xml. And the exception as followed:

Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stevie' defined in clas开发者_开发问答s path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/cglib/proxy/CallbackFilter

All of the code come from the book. Why do I get the exception? And how to solve?

Thanks.


I found the reason. Because I didn't include the Spring 3.0 Persistence Core Libraries.Thanks all the same.

0

精彩评论

暂无评论...
验证码 换一张
取 消