多服务启动遇到的bug & 接收到null报错

bug1:

java.lang.IllegalStateException: Optional int parameter ‘quantity’ is present but cannot be translated into a null value due to being declared as a primitive type. Consider declaring it as object wrapper for the corresponding primitive type.

这个错误百度说是 因为传入的值为空,而参数int不接受空值,所以改为Iteger 但是接受的值仍然是空值 然后找到传值的对应html页面他是这个样子,也就是默认值为1不可能传一个null,很随意敲了一个空格value=“1” />然后竟然可以传值了。然后我在删掉空格也没有报错。这是什么情况???总之它好了。。。。。

<input type="text" name="quantity" id=""  value="1"/>

bug2

java.lang.RuntimeException: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool

Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused: connect
Caused by: java.net.ConnectException: Connection refused: connect
2020-04-16 17:11:51.259 ERROR 37640 — [nio-8082-exec-2] o.a.c.c.C.[.[.[/].[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is java.lang.RuntimeException: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
java.lang.RuntimeException: redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
redis Could not connect to Redis at 127.0.0.1:6379: Connection refused

buger记录的不是很完整总之启动多服务时一定要设置为allow paraller run,还有可能是端口占用的问题,在application里面更改端口号也行。
在这里插入图片描述
然后就是使用redis,记得在服务器端启动起来。但是有时候他就是还会有问题。。。还很莫名其妙。。。。哈哈哈那就一遍不行再来一遍。。。。

猜你喜欢

转载自blog.csdn.net/peopleware1/article/details/105675184