[SNMP4J] TcpAddress issue

Frank Fock fock at agentpp.com
Thu Apr 30 17:10:38 CEST 2015


Hi Joe,

There is no obvious error in what you wrote. So could you please provide us
the SNMP4J related part of the stack trace? This might help to find the 
root cause.

What happened in the past was often when people tried to test a simple 
setup,
that the main thread finished and closed the Snmp class (stopping all 
transport
listeners) before the request was send out. But since you seem to be using
a synchronous call, this seems to be unlikely here.

Best regards,
Frank

Am 30.04.2015 um 15:28 schrieb joe.sulewski at L-3com.com:
> Hello,
>
> I'm trying to send data over TCP due to some parts of our network that have high unreliability.  I'm using version 2.2.3 of the SNMP4J library and I'm getting an error trying to send over tcp.
>
> I setup the TransportMapping like so:
> TcpAddress address = new TcpAddress(Inet4Address.getByName(NetTools.getLocalIPAddress()),1161);
> transport = new DefaultTcpTransportMapping(address);
>
> SNMP4JSettings.setExtensibilityEnabled(false);
> snmp = new Snmp(transport);
> transport.listen();
>
>
> To send data I perform the following:
> snmpSettings.setSNMPPort(1161);
> targetAddress = GenericAddress.parse("TCP:" + snmpSettings.getAddress() + "/" + snmpSettings.getSNMPPort());
>
> target = new CommunityTarget();
> target.setCommunity(new OctetString(snmpSettings.getCommunity()));
> target.setAddress(targetAddress);
> target.setRetries(snmpSettings.getRetries());
> target.setTimeout(snmpSettings.getTimeout());
> target.setVersion(SnmpConstants.version2c);
>
> snmp.get(pdu, target);
>
> The get throws the following error: Unsupported address class (transport mapping): org.snmp4j.smi.TcpAddress
>
> When I run in the debugger I looked at the snmp variable and the snmp->messageDispatcher->transportMappings table is:
> {class org.snmp4j.smi.TcpAddress=[org.snmp4j.transport.DefaultTcpTransportMapping at 969d5c]}
>
> The SNMP object appears to be setup correctly but yet I get the unsupported address class.  I must be missing something obvious
>
> I appreciate any pointers.
>
> Thanks,
> Joe
> _______________________________________________
> SNMP4J mailing list
> SNMP4J at agentpp.org
> https://oosnmp.net/mailman/listinfo/snmp4j

-- 
---
AGENT++
Maximilian-Kolbe-Str. 10
73257 Koengen, Germany
https://agentpp.com
Phone: +49 7024 8688230
Fax:   +49 7024 8688231




More information about the SNMP4J mailing list