对不起。我是春天的初学者。现在,它有一些问题。
我正在阅读 Spring in action 并尝试MyEclipse中的代码。但是当我尝试被替换方法的代码时,会出现错误。
<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" />
这是 applicationContext.xml 。例外情况如下:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'stevie' defined in class path resource [applicationContext.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: net/sf/cglib/proxy/CallbackFilter
所有代码都来自本书。为什么我会得到例外?以及如何解决?
感谢。
答案 0 :(得分:2)
我找到了原因。因为我没有包含Spring 3.0 Persistence Core Libraries
。非常感谢。