按照视频的操作,本节内容出现如下问题

来源:3-6 _广告模块开发Service层图片上传功能(下)

慕妹4524825

2017-11-27

一.运行tomcat报错,

27-Nov-2017 17:44:16.122 警告 [http-nio-8081-exec-6] org.springframework.web.context.support.XmlWebApplicationContext.refresh Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String org.imooc.service.impl.AdServiceImpl.adImageSavePath; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'adImage.savePath' in string value "${adImage.savePath}"

27-Nov-2017 17:44:16.122 严重 [http-nio-8081-exec-6] org.springframework.web.servlet.DispatcherServlet.initServletBean Context initialization failed

 org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'adServiceImpl': Injection of autowired dependencies failed; nested exception is org.springframework.beans.factory.BeanCreationException: Could not autowire field: private java.lang.String org.imooc.service.impl.AdServiceImpl.adImageSavePath; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'adImage.savePath' in string value "${adImage.savePath}"


二.打开后台首页加载不了js库文件,路径按照视频的配置的,好像是识别不了${basePath}??

http://img.mukewang.com/szimg/5a1be1150001e84f16970431.jpg

http://img.mukewang.com/szimg/5a1be1150001792210440945.jpg

http://img.mukewang.com/szimg/5a1be0bc0001111c04860595.jpg

http://img.mukewang.com/szimg/5a1be0bd00016a8813410438.jpg

http://img.mukewang.com/szimg/5a1be0bd00018e1c10110269.jpg

http://img.mukewang.com/szimg/5a1be0bd0001bb0b10050302.jpg


写回答

2回答

源生活

2017-11-27

1、你看下你的properties文件的加载和配置内容正确吗?
2、basePath在你截的图里不是已经成功解析成url了吗?你从哪看出basePath没有起作用的?

0
1
慕妹4524825
已经解决好问题了。感谢了。
2017-11-27
共1条回复

源生活

2017-11-27

和basePath没关系,它的任务已经完成了,已经解析成工程的访问根路径了,是你的js文件不能加载,看下部署在tomcat后是不是有问题,在你部署的tomcat下看看路径是否正确

0
0

IT段子手详解MyBatis遇到Spring 秒学Java SSM开发大众点评

【毕设】SSM全面梳理,前后端分离,zTree 和复杂SQL打造权限系统,解惑MyBatis和RESTful

1001 学习 · 485 问题

查看课程