spring boot项目部署Linux时,运行tomcat启动报错
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
1 | Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled. |
查看linux服务器中/webapps/ROOT/WEB-INF/classes下的项目文件,发现不存在application.properties文件
设置由于pom文件里面配置< resources >时未设置打包.properties文件,导致tomcat读取不到.properties文件的配置信息。
在< resources >中加入扫描.properties文件即可 注意往下看
1 | <resource> |
如果只配置.properties文件可能会导致进入tomcat运行成功后访问项目静态资源文件报错。
异常:This application has no explicit mapping for /error, so you are seeing this as a fallback.
javax.servlet.ServletException: Circular view path [login]: would dispatch back to the current handler URL [/login] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)
此时需要设置扫描src/main/resources下的全部文件
1 | <build> |
BUG集合 Linux Tomcat Spring Boot
本博客所有文章除特别声明外,均采用 CC BY-SA 3.0协议 。转载请注明出处!