问题1:The method findOne(Example<S>) in the type QueryByExampleExecutor<User> is not applicable for the arguments (Long)
解决方法:spring boot改成以前的版本
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.4.1.RELEASE</version>
<relativePath />
</parent>
问题2:java.net.BindException: Address already in use: bind
解决方案:
-
打开cmd命令行,执行命令netstat -ano|findstr "8443"查看8443端口是否被占用及占用此端口的PID,从下图中可以看到占用端口的进程ID(PID)为2976
-
执行命令tasklist|findstr "2796"查看此PID对应的进程名称为软件名称
如下图所示,可以看到2796对应的软件名称为VisualSVNServer.exe
-
执行命令taskkill /f /t /im VisualSVNServer.exe杀死此进程,如果出现如下错误,则可以通过Windows任务管理器来关闭进程树。
-
4
进程关闭完成后,重启启动spring boot应用,可以看到端口启用成功了。
-
原文地址:https://jingyan.baidu.com/article/a3aad71a10e0b4b1fb009696.html
-
问题3:ERROR 6040 --- [ main] c.n.d.s.t.d.RedirectingEurekaHttpClient : Request execution error
com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection refused: connect
at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187) ~[jersey-apache-client4-1.19.1.jar:1.19.1]
at com.sun.jersey.api.client.filter.GZIPContentEncodingFilter.handle(GZIPContentEncodingFilter.java:123) ~[jersey-client-1.19.1.jar:1.19.1]
at com.netflix.discovery.EurekaIdentityHeaderFilter.handle(EurekaIdentityHeaderFilter.java:27) ~[eureka-client-1.4.12.jar:1.4.12]
在网上查找方法,加入了配置方法,还添加了依赖:
结果访问eureka的时候是这样的:
解决方法:那么干脆就给它配置一个用户名和密码好了
ok!
总结:今天学的很少,有点罪恶。