[SNMP4J] TestAgent and BaseAgent Example

Frank Fock fock at agentpp.com
Thu Jun 16 21:10:15 CEST 2005


Hi Murali,

I know that I should have update SNMP4JAgent already to fix this
problem. Here is the fix (that I posted already on the list) which has
to be applied to MOScalar.java:

  private static boolean isVolatileByDefault(Variable value) {
    if (value == null) {
      return true;
    }
    switch (value.getSyntax()) {
      case SMIConstants.SYNTAX_COUNTER32:
      case SMIConstants.SYNTAX_COUNTER64: {
        return true;
      }
      default:
        return false;
    }
  }

SNMP4J 1.6 and the first beta of SNMP4J-Agent will be released
in a few weeks. These versions will then already prepared to support
SNMP4J-AgentX.

Best regards,
Frank

Muralidharan Narayanan wrote:

>Can anyone help me with the below error I am getting upon running the
>TestAgent example from SNMP-Agent download? I just downloaded and executed
>the example but not sure why the null pointer exception occurred.
>
>Thanks for help
>Murali
>
>
>0 [main] INFO org.snmp4j.agent.BaseAgent  - Engine boots is: 11
>48 [main] INFO org.snmp4j.agent.BaseAgent  - Wrote boot counter: 12
>128 [main] DEBUG org.snmp4j.security.Salt  - Initialized Salt to
>51d1e8c1bc8ee7dc.
>Exception in thread "main" java.lang.NullPointerException
>	at org.snmp4j.agent.mo.MOScalar.isVolatileByDefault(MOScalar.java:54)
>	at org.snmp4j.agent.mo.MOScalar.<init>(MOScalar.java:50)
>	at
>org.snmp4j.agent.mo.snmp.SnmpFrameworkMIB$1.<init>(SnmpFrameworkMIB.java:56)
>	at
>org.snmp4j.agent.mo.snmp.SnmpFrameworkMIB.createMOs(SnmpFrameworkMIB.java:58
>)
>	at
>org.snmp4j.agent.mo.snmp.SnmpFrameworkMIB.<init>(SnmpFrameworkMIB.java:52)
>	at org.snmp4j.agent.BaseAgent.init(BaseAgent.java:81)
>	at org.snmp4j.agent.test.TestAgent.main(TestAgent.java:270)
>
>
>_______________________________________________
>SNMP4J mailing list
>SNMP4J at agentpp.org
>http://lists.agentpp.org/mailman/listinfo/snmp4j
>
>  
>





More information about the SNMP4J mailing list