[SNMP4J] Error: java.net.InetAddress: method getByAddress([B)Ljava/net/InetAddress; not found
Frank Fock
fock at agentpp.com
Tue Oct 26 22:23:11 CEST 2004
Craig,
you need Java 1.4 or later. You can test your version
by running "java -version" on the command line.
Best regards,
Frank
COkken at berkleyis.com wrote:
>
>
> I am testing out smnp4j with the following code:
>
>ScopedPDU pdu = new ScopedPDU();
> pdu.setType(PDU.INFORM);
>
> pdu.add(
> new VariableBinding(
> new OID(".1.3.6.1.4.1.9799"),
> new OctetString("This is a test
>for xPression")));
> // payload
> //pdu.add(
> // new VariableBinding(
> // new OID("1.3.6.1.2.1.2.2.1.1" +
>downIndex),
> // new Integer32(downIndex)));
> InetAddress ip = InetAddress.getByName(
>"172.19.5.160");
>
>
> UserTarget target = new UserTarget();
> IpAddress targetAddress = new IpAddress(ip);
> target.setAddress(targetAddress);
>
>
>When I try to set the address I get the following error:
>
>java.lang.NoSuchMethodError: java.net.InetAddress: method
>getByAddress([B)Ljava/net/InetAddress; not found
> at org.snmp4j.smi.IpAddress.createAnyAddress(IpAddress.java:165)
> at org.snmp4j.smi.IpAddress.<clinit>(IpAddress.java:42)
> at com.bts.snmp.util.SNMPClient.main(SNMPClient.java:60)
>Exception in thread "main"
>
>
>What version of the rt.jar do I need to be using. I have a version from
>06/03/2004 that has this method in it. That is the rt.jar I am using and I
>am still getting this error. Anything else I am doing wrong?
>
>Thanks,
>
>Craig Okken
>System Specialist
>cokken at berkleyis.com
>605-362-4465
>
>
>CONFIDENTIALITY NOTICE: This e-mail and the transmitted documents contain
>private, privileged and confidential information belonging to the sender.
>The information therein is solely for the use of the addressee. If your
>receipt of this transmission has occurred as the result of an error, please
>immediately notify us so we can arrange for the return of the documents.
>In such circumstances, you are advised that you may not disclose, copy,
>distribute or take any other action in reliance on the information
>transmitted.
>
>_______________________________________________
>SNMP4J mailing list
>SNMP4J at agentpp.org
>http://p15141779.pureserver.info/mailman/listinfo/snmp4j
>
>
>
More information about the SNMP4J
mailing list