java.io.IOException: Invalid argument
来源:互联网 发布:网络电视怎么看3d电影 编辑:程序博客网 时间:2024/05/29 18:37
使用SNMP4J发送告警时,突然出现下面这样的异常:
java.io.IOException: Invalid argument设置定发送端绑定IP和端口,如下:
// 设置管理进程的IP和端口String address = "udp:172.16.54.77/1162";logger.info("[SnmpSender.static] Init snmpTrap.Set remote address: " + address);Address targetAddress = GenericAddress.parse(address);TransportMapping transport = null;try {UdpAddress localUdpAddress = new UdpAddress("172.16.54.78/0");transport = new DefaultUdpTransportMapping(localUdpAddress);snmpTrap = new Snmp(transport);transport.listen();} catch (IOException e) {logger.error("[SnmpSender.static] Error while init snmpTrap response: " + e.getMessage(), e);}如果在localUdpAddress中设置的IP地址为0.0.0.0,则发送告警时就会报:java.io.IOException: Invalid argument,参见如下DatagramSocket
另外,可能出现java.io.IOException: Invalid argument的情况,也可参考下:http://blog.csdn.net/clariones/article/details/6682526
- java.io.IOException: Invalid argument
- java.io.IOException: Invalid argument
- java.io.IOException: open failed: EINVAL (Invalid argument)
- java.io.IOException: open failed: EINVAL (Invalid argument)
- java.io.IOException: open failed: EINVAL (Invalid argument)
- java.io.IOException: open failed: EINVAL (Invalid argument)
- java.io.IOException: open failed: EINVAL (Invalid argument)
- 创建文件报错 java.io.IOException: Invalid argument
- java.io.IOException: open failed: EINVAL (Invalid argument)
- 加载网络图片保存到本地java.io.IOException: open failed: EINVAL (Invalid argument)
- java.io.IOException: invalid header field
- java.io.IOException: invalid header field
- java.io.IOException: invalid constant type: 15
- java.io.IOException: Invalid keystore format
- java.io.IOException: invalid constant type: 18
- java.io.IOException: invalid header field 打包时报错 java
- java.lang.RuntimeException: java.io.IOException: invalid constant type: 15
- java.lang.RuntimeException: java.io.IOException: invalid constant type: 15
- 使用 resource_limit 及 profile 限制用户连接
- JAVA对象的比较测试
- mysql设置root密码
- 【LoadRunner】URL编码和解码方法
- Javascrip对象 (dom对象) 与jquery对象的区别 转换---perfect
- java.io.IOException: Invalid argument
- SQL Server 全局变量
- Chrome插件Stylebot还原到历史版本
- eclipse中java项目改成web项目
- myeclipse svn 修改用户名和密码
- 关于Flex的DistortionEffects
- Struts2拦截器详解 (转)
- 计算机科学中最重要的32个算法
- XMPP subscription status