多服務啓動遇到的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
在這裏插入圖片描述
然後就是使用redis,記得在服務器端啓動起來。但是有時候他就是還會有問題。。。還很莫名其妙。。。。哈哈哈那就一遍不行再來一遍。。。。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章