Spring Cloud异常整理

0

http://start.spring.io/打包下来的程序运行时提示:

NoSuchMethodError: org.springframework.boot.builder.SpringApplicationBuilder.<init>

网上我看到说的是Srping Boot的版本和Spring Cloud的版本冲突导致,但是这个是从官网下载的demo不应该出现这个问题。

最后我有从新使用mvn spring-boot:run命令在控制台跑才发现问题,控制台提示:

[INFO] Changes detected - recompiling the module!
[INFO] Compiling 1 source file to C:\Users\Administrator\Desktop\demo\target\classes
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] 读取C:\Users\Administrator\.m2\repository\org\springframework\cloud\spring-cloud-context\2.0.0.M9\spring-cloud-c
ontext-2.0.0.M9.jar时出错; ZipFile invalid LOC header (bad signature)
[ERROR] 读取C:\Users\Administrator\.m2\repository\org\springframework\cloud\spring-cloud-commons\2.0.0.M9\spring-cloud-c
ommons-2.0.0.M9.jar时出错; ZipFile invalid LOC header (bad signature)
[ERROR] /C:/Users/Administrator/Desktop/demo/src/main/java/com/example/demo/DemoApplication.java:[1,1] 无法访问com.examp
le.demo
  invalid distance too far back
[INFO] 3 errors
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 8.585s
[INFO] Finished at: Wed Apr 11 14:26:13 CST 2018
[INFO] Final Memory: 24M/87M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.7.0:compile (default-compile) on project
 demo: Compilation failure: Compilation failure:
[ERROR] 读取C:\Users\Administrator\.m2\repository\org\springframework\cloud\spring-cloud-context\2.0.0.M9\spring-cloud-c
ontext-2.0.0.M9.jar时出错; ZipFile invalid LOC header (bad signature)
[ERROR] 读取C:\Users\Administrator\.m2\repository\org\springframework\cloud\spring-cloud-commons\2.0.0.M9\spring-cloud-c
ommons-2.0.0.M9.jar时出错; ZipFile invalid LOC header (bad signature)
[ERROR] /C:/Users/Administrator/Desktop/demo/src/main/java/com/example/demo/DemoApplication.java:[1,1] 无法访问com.examp
le.demo
[ERROR] invalid distance too far back
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

原来是昨天公司网络问题,导致jar没有下载完整,所以出现这个问题。
解决办法就是找到上面的路径,删除文件夹重新下载就可以了。

Disabling contextual LOB creation as createClob() method threw error : java.lang.reflect.InvocationTargetException

配置使用了连接池,添加一下配置:

spring.jpa.properties.hibernate.temp.use_jdbc_metadata_defaults=false

使用hystrix-dashboard时发现没有数据,一直loading是因为你没有访问有监控的连接。
而且要公开端点不然会提示找不到数据:Unable to connect to Command Metric Stream

2.x后端点的路径改了:`http://localhost:9999/actuator/hystrix.stream

如果整合了turbine一直提示loading,那么可能是因为没有配置监控那些消费者导致,配置项:turbine.app-config