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踩坑日记—— java.lang.IllegalStateException: PathVariable annotation was empty on param 0.
Feign报错:java.lang.IllegalStateException: PathVariable annotation was empty on param 0.错误日志:Error starting ApplicationContext. To display the conditions report re-run your application with ‘debug’ ...
python 给函数传对象 python 函数传递
Python中,函数参数由实参传递给形参的过程,是由参数传递机制来控制的。根据实际参数的类型不同,函数参数的传递方式分为值传递和引用传递(又称为地址传递)。Python函数参数的值传递机制所谓值传递,实际上就是将实际参数值的副本(复制品)传入函数,而参数本身不会受到任何影响。下面程序演示了函数参数进行值传递的效果:def swap(a , b) :
# 下面代码实现a、b变量的值交换
a, b =
python 远程服务rpc python 远程执行命令
一、远程执行命令模块subprocess Python可以使用subprocess下的Popen类中的封装的方法来执行命令 构造方法 popen() 创建popen类的实例化对象
obj = Subprocess.Popen(data,shell=True,stdout=subprocess.PIPE)data 命令内容shell 开启shellstdout 重定向结果输出管道