Menu

#34 SEQ -> CHOICE -> SEQ-> SEQ throws IllegalArgumentException

open
nobody
None
5
2008-12-12
2008-12-12
Gerote
No

EXCEPTION
---------
java.lang.IllegalArgumentException: Sequence 'class com.test.Msg3.Type1' size is incorrect! Must be: 0. Received: 7
at org.bn.coders.ber.BERDecoder.decodeSequence(BERDecoder.java:124)
at org.bn.metadata.ASN1SequenceMetadata.decode(ASN1SequenceMetadata.java:61)
at org.bn.coders.Decoder.decodePreparedElement(Decoder.java:162)
at org.bn.coders.Decoder.decodeClassType(Decoder.java:47)
at org.bn.coders.Decoder.decodeSequenceField(Decoder.java:311)
at org.bn.coders.Decoder.decodeSequence(Decoder.java:250)
at org.bn.coders.ber.BERDecoder.decodeSequence(BERDecoder.java:118)
at org.bn.metadata.ASN1SequenceMetadata.decode(ASN1SequenceMetadata.java:61)
at org.bn.coders.Decoder.decodePreparedElement(Decoder.java:162)
at org.bn.coders.Decoder.decodeClassType(Decoder.java:47)
at org.bn.coders.Decoder.decodeChoice(Decoder.java:345)
at org.bn.coders.ber.BERDecoder.decodeChoice(BERDecoder.java:329)
at org.bn.metadata.ASN1ChoiceMetadata.decode(ASN1ChoiceMetadata.java:52)
at org.bn.coders.Decoder.decodePreparedElement(Decoder.java:162)
at org.bn.coders.Decoder.decodeClassType(Decoder.java:47)
at org.bn.coders.Decoder.decodeSequenceField(Decoder.java:311)
at org.bn.coders.Decoder.decodeSequence(Decoder.java:250)
at org.bn.coders.ber.BERDecoder.decodeSequence(BERDecoder.java:118)
at org.bn.metadata.ASN1SequenceMetadata.decode(ASN1SequenceMetadata.java:61)
at org.bn.coders.Decoder.decodePreparedElement(Decoder.java:162)
at org.bn.coders.Decoder.decode(Decoder.java:37)

ASN.1 DEFINITION
----------------
Msg1 ::= SEQUENCE {
fld1 OBJECT IDENTIFIER,
fld2 Msg2
}

Msg2 ::= CHOICE {
fld1 [1] m1,
fld2 [2] m2,
fld3 [3] m3,
fld4 [5] m5,
fld6 [6] m6,
fld7 [7] m7,
fld8 [8] m8,
fld9 [9] Msg3,
fld10 [10] m10,
fld12 [12] m11,
fld13 [13] m12,
fld14 [14] m14,
fld15 [15] m15,
fld16 [16] m16,
fld17 [17] m17,
fld18 [18] m18,
fld19 [19] m19,
fld20 [20] m20,
fld21 [21] m21,
fld24 [24] m24
}

Msg3 ::= SEQUENCE {
fld0 [0] VisibleString (SIZE (1..25)),
fld1 [1] VisibleString (SIZE (1..15)) OPTIONAL,
fld2 [2] GeneralizedTime,
fld3 [3] VisibleString (SIZE (1..15)) OPTIONAL,
fld4 [4] VisibleString (SIZE (1..15)) OPTIONAL,
fld5 [5] Type1 OPTIONAL,
...
}

Type1 ::= SEQUENCE {
fld0 [0] UTF8String,
fld1 [1] UTF8String OPTIONAL
}

Discussion

  • Nobody/Anonymous

    hi I resolved this problem

     
  • Nobody/Anonymous

    Hi,
    I too got the same kind of error, and its decoder problem i think.
    Can some one tell me, how to process to upload the changed sources.

     
  • Nobody/Anonymous

    Hi,
    I too got the same kind of error, and its decoder problem i think.
    Can some one tell me, how to process to upload the changed sources.

     
  • phani anumolu

    phani anumolu - 2009-02-26

    Hi,

    I too got the same kind of error, and its decoder problem i think.
    I did some code change in the provided java sources, and it is working fine for my ASN file.
    I belive this solution would work for these kind of exceptions.

    Can some one tell me, the process to upload the changed sources.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.