org.asnlab.asndt.runtime.error.InvalidTagException in ASN1

90 views
Skip to first unread message

Unnikrishnan Parambath

unread,
Jul 15, 2014, 6:46:11 AM7/15/14
to asn1-develo...@googlegroups.com
Hi

I have Java project which uses ASN1 decoding.
Currently I am facing below listed error whenever I tried to use
ASN1 decoding function. I really didn't got why this exception
has been happening.

Exception in thread "main" org.asnlab.asndt.runtime.error.InvalidTagException
    at org.asnlab.asndt.runtime.type.AsnType.k(zb:215)
    at org.asnlab.asndt.runtime.type.ByteBuffer.decode(pc:15)
    at org.asnlab.asndt.runtime.type.AsnType.decode(zb:256)
    at org.asnlab.asndt.runtime.type.AsnType.decode(zb:422)
    at EUTRA_RRC_Definitions.DL_DCCH_Message.ber_decode(DL_DCCH_Message.java:31)
    at MyTest.main(MyTest.java:32).
   
   
Let me share the steps which I have done below.

1. Create An ASN1 project using attached ASN1 file.
2. Created a simple Java application with single file(MyTest.java) attached.
3.Then copied all the generated Java source files (output folder of ASN1 project) in
  Java project.
4.My primary aim is to decode only "DL_DCCH_Message" structure information
as defined in the ASN1 file. so just tried to call decoding function in the attached
DL_DCCH_Message.java file.But above noted exception is encountered.

ASN1 input source file and generated java file, and Java project file are attached.
Let me inform you that I also tried to do encoding , but same problem is coming.
So could you please guide me to solve this problem.

    ASN1 input source file ------> EUTRA-RRC-Definitions.asn
    Java application project file ----> MyTest.java
    ASN1 output file ---------> DL_DCCH_Message.java


BRs
Unny

EUTRA-RRC-Definitions.asn
DL_DCCH_Message.java
MyTest.java

Mukhammad Wildan

unread,
Aug 20, 2014, 9:11:37 AM8/20/14
to asn1-develo...@googlegroups.com
does anyone answered your question? having same problem here.. 

Zhiren Hu

unread,
Aug 20, 2014, 6:20:28 PM8/20/14
to asn1-develo...@googlegroups.com
Hi Unny,

I think your  message is not in BER encoding rules, try decode using PER ?



Regards,
Zhiren Hu

--
You received this message because you are subscribed to the Google Groups "ASN.1 Development Tools" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asn1-development-...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Zhiren Hu

unread,
Aug 20, 2014, 6:33:26 PM8/20/14
to asn1-develo...@googlegroups.com
Decoding example :

byte[] array = ...

Buffer buffer = Buffer.wrap(array, EncodingRules.ALIGNED_PACKED_ENCODING_RULES);

XXX_PDU pdu = (XXX_PDU) XXX_PDU.TYPE.decode(buffer, XXX_PDU.CONVERTER);

XXX_PDU.TYPE.print(pdu, XXX_PDU.CONVERTERSystem.out);

Reply all
Reply to author
Forward
0 new messages