本文主要是介绍Caused by: java.lang.IllegalArgumentException: hostname can't be null,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
错误信息:
Caused by: java.lang.IllegalArgumentException: hostname can't be nullat java.net.InetSocketAddress.checkHost(InetSocketAddress.java:149)at java.net.InetSocketAddress.<init>(InetSocketAddress.java:216)at com.orange.config.FoticConfig.foticFTPService(FoticConfig.java:27)at com.orange.config.FoticConfig$$EnhancerBySpringCGLIB$$97899c8f.CGLIB$foticFTPService$2(<generated>)at com.orange.config.FoticConfig$$EnhancerBySpringCGLIB$$97899c8f$$FastClassBySpringCGLIB$$428e4182.invoke(<generated>)at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:361)at com.orange.config.FoticConfig$$EnhancerBySpringCGLIB$$97899c8f.foticFTPService(<generated>)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)... 48 common frames omitted
其中一种原因:
配置文件内的IP没配置上或ip为null,导致第三方连接失败,可以看看控制台报错的上方应该有具体的报错类说明
解决方式:
查阅下自己的配置文件是否都已配置,是否为null,是的话修改下即可
注:我的问题在于spring boot2.0的yml文件没配置ftp的ip连接地址
这篇关于Caused by: java.lang.IllegalArgumentException: hostname can't be null的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!