我现在已经调试了一段时间了,我希望有人能在这里说清楚.
我有一个使用JDK 1.6添加到Jenkins的Maven项目.我在这个项目中使用AOP来处理数据库事务.
当我在Jenkins中运行构建时,我的测试用例失败,但有以下例外: -
Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'dataHandlerClassificationImpl':
Injection of resource dependencies failed; nested exception is
org.springframework.beans.factory.BeanNotOfRequiredTypeException:
Bean named 'writerDataLocationImpl' must be of type [xxx.script.WriterData],
but was actually of type [$Proxy17]
...
...
Caused by: org.springframework.beans.factory.BeanNotOfRequiredTypeException:
Bean named 'writerDataLocationImpl' must be of type [xxx.script.WriterData],
but was actually of type [$Proxy17]
...
...
Run Code Online (Sandbox Code Playgroud)
该DataHandlerClassificationImpl课程看起来像这样: -
@Service
public class DataHandlerClassificationImpl extends DataHandler {
@Resource(name="writerDataLocationImpl")
private WriterData writerData;
...
}
Run Code Online (Sandbox Code Playgroud)
WriterData 是一个具有多个实现的接口.
我能够在没有问题的情况下从IDE执行代码.为了确定它是Maven问题还是Jenkins问题,我使用命令行导航到Jenkins的项目作业文件夹,我能够毫无错误地运行mvn test …