SpringBoot踩坑日记
1.Closing JPA EntityManagerFactory for persistence unit 'default'错误导致springboot启动后终止
------------------->
2019-01-22 17:18:34.941 INFO 42978 --- [ Thread-13] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'
2019-01-22 17:18:34.945 INFO 42978 --- [ Thread-13] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
2019-01-22 17:18:35.181 INFO 42978 --- [ Thread-13] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
解决办法
在依赖中添加spring-boot-starter-web
例如Gradle在build.gradle中添加
implementation 'org.springframework.boot:spring-boot-starter-web'
问题解决
<------------------- 2019.1.22
2.Gradle加载依赖很慢,换成国内源
--------------->
repositories {
//使用国内源下载依赖
maven { url 'http://maven.aliyun.com/nexus/content/groups/public/' }
mavenCentral()
}
替换之后重新Gradle下
<----------------2019-01-23
3.Gradle加载出错,错误如下
startup failed:
build file '/Users/cuifuan/workspaces/springcloud-tools/tools-eureka/build.gradle': 4: all buildscript {} blocks must appear before any plugins {} blocks in the script
See https://docs.gradle.org/5.0/userguide/plugins.html#sec:plugins_block for information on the plugins {} block
@ line 4, column 1.
buildscript {
^
1 error
Open File
经过一番排查
//删去下面代码,如果存在,我也不知道为什么
plugins {
id 'java'
}
4.feign依赖不存在
feign 声明式调用
Feign makes writing java http clients easier
之前安装依赖
dependencies{
compile "org.springframework.cloud:spring-cloud-starter-feign"
compile "org.springframework.cloud:spring-cloud-starter-eureka"
}
springboot2.0之后
dependencies {
implementation "org.springframework.cloud:spring-cloud-starter-openfeign"
implementation 'org.springframework.cloud:spring-cloud-starter-eureka-server'
}
5. com.netflix.client.ClientException: Load balancer does not have available server for client: sp
build.gradle
dependencies {
implementation "org.springframework.cloud:spring-cloud-starter-openfeign"
//应是eureka-client
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
}
6.解决报错 javax.persistence.TransactionRequiredException: Executing an update/delete query
运行报错原因:少了一个注解:@Transactional : 要求开启事物管理
SpringBoot踩坑日记的更多相关文章
- AI相关 TensorFlow -卷积神经网络 踩坑日记之一
上次写完粗浅的BP算法 介绍 本来应该继续把 卷积神经网络算法写一下的 但是最近一直在踩 TensorFlow的坑.所以就先跳过算法介绍直接来应用场景,原谅我吧. TensorFlow 介绍 TF是g ...
- 人工智能(AI)库TensorFlow 踩坑日记之一
上次写完粗浅的BP算法 介绍 本来应该继续把 卷积神经网络算法写一下的 但是最近一直在踩 TensorFlow的坑.所以就先跳过算法介绍直接来应用场景,原谅我吧. TensorFlow 介绍 TF是g ...
- hexo博客谷歌百度收录踩坑日记
title: hexo博客谷歌百度收录踩坑日记 toc: false date: 2018-04-17 00:09:38 百度收录文件验证 无论怎么把渲染关掉或者render_skip都说我的格式错误 ...
- Hexo搭建静态博客踩坑日记(二)
前言 Hexo搭建静态博客踩坑日记(一), 我们说到利用Hexo快速搭建静态博客. 这节我们就来说一下主题的问题与主题的基本修改操作. 起步 chrome github hexo git node.j ...
- Hexo搭建静态博客踩坑日记(一)
前言 博客折腾一次就好, 找一个适合自己的博客平台, 专注于内容进行提升. 方式一: 自己买服务器, 域名, 写前端, 后端(前后分离最折腾, 不分离还好一点)... 方式二: 利用Hexo, Hug ...
- JavaScript 新手的踩坑日记
引语 在1995年5月,Eich 大神在10天内就写出了第一个脚本语言的版本,JavaScript 的第一个代号是 Mocha,Marc Andreesen 起的这个名字.由于商标问题以及很多产品已经 ...
- React Native Android配置部署踩坑日记
万事开头难 作为一只进入ECMAScript世界不久的菜鸟,已经被React Native的名气惊到了,开源一周数万星勾起了我浓烈的兴趣.新年新气象,来个HellWorld压压惊吧^_^(故意少打个' ...
- 人工智能(AI)库TensorFlow 踩坑日记之二
上次 踩坑日志之一 遗留的问题终于解决了,所以作者(也就是我)终于有脸出来写第二篇了. 首先还是贴上 卷积算法的示例代码地址 :https://github.com/tensorflow/models ...
- 微信小程序开发踩坑日记
2017.12.29 踩坑记录 引用图片名称不要使用中文,尽量使用中文命名,IDE中图片显示无异样,手机上图片可能出现不显示的情况. 2018.1.5 踩坑记录 微信小程序设置元素满屏,横向直接w ...
随机推荐
- 计算2的n次幂htm代码
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- CentOS7编译安装NodeJS
概述 在CentOS7下采用编译NodeJS二进制源码包的方式安装NodeJS 下载NodeJS安装包 你可以先下载NodeJS二进制源码安装包文件然后上传到CentOS系统,也可以通过wget命令直 ...
- 《树莓派学习指南(基于Linux)》——本章小结
本节书摘来自异步社区<树莓派学习指南(基于Linux)>一书中的第二章的本章小结,作者[英]Peter Membrey ,[澳]David Hows ,译者 张志博,孙峻文,更多章节内容可 ...
- XmlSerializer .NET 序列化、反序列化
序列化对象 要序列化对象,首先创建要序列化的对象并设置其公共属性和字段.为此,您必须确定要将XML流存储的传输格式,作为流或文件. 例如,如果XML流必须以永久形式保存,则创建一个FileStre ...
- mysql查询连接数
最近公司的测试服务器数据库经常是连接爆满,几次加大了依旧满了. 明明只有几个人在用这个数据库,但是连接数到了三四百.于是就想是谁一直开着连接不释放,于是写了个SQL查了下连接使用情况. SQL如下: ...
- CF思维联系–CodeForces - 223 C Partial Sums(组合数学的先线性递推)
ACM思维题训练集合 You've got an array a, consisting of n integers. The array elements are indexed from 1 to ...
- USACO Training Section 1.2 挤牛奶Milking Cows
题目描述 三个农民每天清晨5点起床,然后去牛棚给3头牛挤奶.第一个农民在300秒(从5点开始计时)给他的牛挤奶,一直到1000秒.第二个农民在700秒开始,在 1200秒结束.第三个农民在1500秒开 ...
- P1465 序言页码 Preface Numbering (手推)
题目描述 一类书的序言是以罗马数字标页码的.传统罗马数字用单个字母表示特定的数值,以下是标准数字表: I 1 V 5 X 10 L 50 C 100 D 500 M 1000 最多3个同样的可以表示为 ...
- 图论--2-SAT--暴力染色法求字典序最小模版
#include <cstdio> #include <cstring> #include <stack> #include <queue> #incl ...
- Jmeter系列(9)- jmeter插件入门篇
如果你想从头学习Jmeter,可以看看这个系列的文章哦 https://www.cnblogs.com/poloyy/category/1746599.html 前言 jmeter4.0以上,如现在最 ...