8月 222017
 

问题:

配置类中明确定义了DataSource bean,但是在另一个类中Autowired的一个jdbcTemplate怎么都装配失败,调试发现,DataSource Bean定义的太晚了,如果提前到jdbcTemplate定义的那个类中就没问题了

另外的解决办法: 其实我们完全可以在配置类上 :

这样的话,只需要在 application.properties 中定义如下即可:

 

 Posted by at 下午 5:22

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">

(required)

(required)

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据