[SNMP4J] NoSuchMethodError in TestAgent

Dysli Metref Etienne Etienne.DysliMetref at gemalto.com
Tue Feb 4 10:05:51 CET 2014


Hi list,

I am trying SNMP4J by simply running the org.snmp4j.agent.test.TestAgent class in a JUnit test, but I get the following exception:

java.lang.NoSuchMethodError: org.snmp4j.security.SecurityProtocols.addDefaultProtocols()V
 at org.snmp4j.agent.BaseAgent.initMessageDispatcher(BaseAgent.java:384)
 at org.snmp4j.agent.BaseAgent.init(BaseAgent.java:145)
 at org.snmp4j.agent.test.TestAgent.main(TestAgent.java:458)
 at snmp.SimpleAgentTest.tryTestAgent(SimpleAgentTest.java:35)

Here is the test method:
@Test
public void tryTestAgent() throws IOException {
  String[] args = {"127.0.0.1/1610"};
  TestAgent.main(args);
}

I am running this on OpenJDK 7 with Maven 3.0.4, snmp4j 2.2.4, snmp4j-agent 2.1.0. Am I running TestAgent the wrong way or is something wrong with my environment?

Sincerely,
   Etienne

This message and any attachments are intended solely for the addressees and may contain confidential information. Any unauthorized use or disclosure, either whole or partial, is prohibited.
E-mails are susceptible to alteration. Our company shall not be liable for the message if altered, changed or falsified. If you are not the intended recipient of this message, please delete it and notify the sender.
Although all reasonable efforts have been made to keep this transmission free from viruses, the sender will not be liable for damages caused by a transmitted virus



More information about the SNMP4J mailing list