# Doubt parsing ADL file **Category:** [Reference Implementation: Java (archive)](https://discourse.openehr.org/c/reference-implementation-java-archive/154) **Created:** 2015-05-06 16:43 UTC **Views:** 3 **Replies:** 5 **URL:** https://discourse.openehr.org/t/doubt-parsing-adl-file/15366 --- ## Post #1 by @Duarte_Ferreira Hi, I’m using the java-libs to parse some adl files from the Clinical Knowledge Manager(CKM). I’m getting some crashes due to stackoverflow when trying to do Archetype.toString(). When I checked the Archetype I saw a loop. The field Archetype.description.parentResourse was pointing back at the Archetype. My confusion seems to be in the function org.openehr.rm.common.resource.AuthoredResource.setDescription(). I don’t understand why : if (description != null && description.getParentResource() != this) { description.setParentResource(this); } In this code we send “this” to be set as its own parentResource in the description. Can anyone help me understand why this is happening? Best, Duarte Ferreira --- ## Post #2 by @pablo The Resource contains the Description, so, Description.parent = Resource See [http://openehr.org/releases/1.0.2/architecture/rm/common_im.pdf](http://openehr.org/releases/1.0.2/architecture/rm/common_im.pdf) page 60 --- ## Post #3 by @system Hi Can you point us to one of the archetypes ? Open the archetype in ckm and click the envelope button on the toolbar to get the link --- ## Post #4 by @Duarte_Ferreira Thanks, I’ll check the documentation. Best, Duarte Ferreira --- ## Post #5 by @Duarte_Ferreira I’m using the [http://www.openehr.org/ckm/#showArchetype_1013.1.130](http://www.openehr.org/ckm/#showArchetype_1013.1.130) as an example. Best, Duarte Ferreira --- ## Post #6 by @system Hi, If you want to get an archetype object serialized into ADL format use the ADLSerializer class (i.e. new ADLSerializer().output(archetype); ). Cheers, iago --- **Canonical:** https://discourse.openehr.org/t/doubt-parsing-adl-file/15366 **Original content:** https://discourse.openehr.org/t/doubt-parsing-adl-file/15366