[SNMP4J] Help,

Ge Zuo zuoge99 at gmail.com
Fri Jul 27 04:12:38 CEST 2007


Hi, I have a big problemn about SNMP4J.The case is that.
I wrote a SNMP server and listen at 162 port. and there is a SNMP sender, it
is wrote by C or C++. I can get AuthKey, PrivKey. But when it run to the
following code it will throw exception.

if (status == SnmpConstants.SNMPv3_USM_OK) {
        try {
          BERInputStream scopedPduStream =
              new BERInputStream(scopedPDU.rewind());
         * **scopedPdu.decodeBER(scopedPduStream);
*          sendPduHandle.setTransactionID(scopedPdu.getRequestID
().getValue());

          // add the engine ID to the local cache.
          addEngineID(transportAddress, securityEngineID);
        }
        catch (IOException iox) {
          logger.warn("ASN.1 parse error: "+iox.getMessage());
          if (logger.isDebugEnabled()) {
            iox.printStackTrace();
          }
          CounterEvent event = new CounterEvent(this,
                                                SnmpConstants.
                                                snmpInASNParseErrs);
          fireIncrementCounter(event);
          return SnmpConstants.SNMP_MP_PARSE_ERROR;
        }

And, it will log "ASN.1 parse error: Wrong ASN.1 type. Not a string xx at
position 3."  or " ASN.1 parse error: Data length > 4 byte are not
supported".

I was try to solved the problem for 4 days. but I still can found reason. I
need you help very urgent.

Pleas tell me what should i careful about. Thank you very much.



More information about the SNMP4J mailing list