java.lang.IllegalArgumentException: hostname can't be null这个异常的解决办法分析

HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: hostname can't be null


type Exception report

message Request processing failed; nested exception is java.lang.IllegalArgumentException: hostname can't be null

description The server encountered an internal error that prevented it from fulfilling this request.

exception

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalArgumentException: hostname can't be null
	org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:978)
	org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:868)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
	org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
	org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
	org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88)
	org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

root cause

java.lang.IllegalArgumentException: hostname can't be null
	java.net.InetSocketAddress.checkHost(InetSocketAddress.java:149)
	java.net.InetSocketAddress.(InetSocketAddress.java:216)
	redis.clients.jedis.Connection.connect(Connection.java:142)
	redis.clients.jedis.BinaryClient.connect(BinaryClient.java:75)
	redis.clients.jedis.Connection.sendCommand(Connection.java:77)





我一开始测试的时候是没问题的但是实际运用这个jedis去自动增长主键时,却报了这个错误,后来查阅资料才发现原来是忘记写数据类型了

解决办法如下

        
            
            
        





你可能感兴趣的:(Exception)