我已经搜索并尝试了我能想到的所有解决方法,但TestService类中的Dao始终为null.我看到Spring日志显示Dao被注入以及TestService类.我试过在WTP下运行eclipse以及在Tomcat中直接运行.两者都会导致相同的错误.任何人都可以帮助解密错误导致Dao在TestService类中为空的位置.
版本:
Jersey 1.8
Spring 3.0.5Release
Tomcat apache-tomcat-7.0.27
Maven 3.0.3 (r1075438; 2011-02-28 12:31:09-0500)
Java 1.6.0_31
Eclipse Java EE IDE for Web Developers.
Version: Indigo Service Release 2
Build id: 20120216-1857
Run Code Online (Sandbox Code Playgroud)
记录 - 显示正在进行的注射(为简洁起见,切断DEBUG和ClassNames)
Creating shared instance of singleton bean 'dataSource'
Creating instance of bean 'dataSource'
Eagerly caching bean 'dataSource' to allow for resolving potential circular references
Finished creating instance of bean 'dataSource'
Creating shared instance of singleton bean 'jdbcTemplate'
Creating instance of bean 'jdbcTemplate'
Eagerly caching bean 'jdbcTemplate' to allow …Run Code Online (Sandbox Code Playgroud)