# Problem with ADL\_parser

**URL:** https://discourse.openehr.org/t/problem-with-adl-parser/14499
**Category:** Technical (archive)
**Created:** [22 August 2005 07:14 UTC](https://discourse.openehr.org/t/problem-with-adl-parser/14499 "2005-08-22T07:14:53Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Javier\_Viguera\_Munoz](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/j/f475e1/32.png) [@Javier\_Viguera\_Munoz](https://discourse.openehr.org/u/Javier_Viguera_Munoz)
#### Post date: [22 August 2005 07:14 UTC](https://discourse.openehr.org/t/problem-with-adl-parser/14499/1 "2005-08-22T07:14:53Z")

</div>

Hello!!

I have been working with the release of pure Java ADL parser, but when I try to parse any adl file (for instance, adl-test-entry.most\_minimal.test.adl, located in the res/test folder of the release) my IDE (Eclipse) throws a ParseException saying that the structure of the file isn't the expected.  
I'm using the version 1.2.4 of openehr java kernel and windows XP. I have tried with other adl files with different adl version, but the result is the same.

What can be happening?

Thanks and regards

Javier Viguera

---

<div class="post-metadata">

### Author: ![rong.chen](https://discourse.openehr.org/user_avatar/discourse.openehr.org/rong.chen/32/515_2.png) [@rong.chen](https://discourse.openehr.org/u/rong.chen)
#### Post date: [22 August 2005 09:49 UTC](https://discourse.openehr.org/t/problem-with-adl-parser/14499/2 "2005-08-22T09:49:09Z")

</div>

Javier Viguera Muñoz wrote:

> Hello!!
> 
> I have been working with the release of pure Java ADL parser, but when I try to parse any adl file (for instance, adl-test-entry.most\_minimal.test.adl, located in the res/test folder of the release) my IDE (Eclipse) throws a ParseException saying that the structure of the file isn't the expected.

The following test case run successfully:

public void testParse() throws Exception {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ADLParser parser = new ADLParser(new File(dir,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"adl-test-entry.most\_minimal.draft.adl"));  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Archetype archetype = parser.parse();  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;assertNotNull(archetype);  
}

And all other adl files under res/test are directly used by unit tests.

Please attach the error message so we can have a close look.

> I'm using the version 1.2.4 of openehr java kernel and windows XP. I

openehr-kernel-1.2.3 should be used instead, although v1.2.4 should work as well.

---

<div class="post-metadata">

### Author: ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)
#### Post date: [22 August 2005 10:57 UTC](https://discourse.openehr.org/t/problem-with-adl-parser/14499/3 "2005-08-22T10:57:27Z")

</div>

In general I would suggest that these kinds of posts be on the openehr-implementers list rather than the technical one. This list has hundreds of subscribers who probably don't want to read very detailed posts about programming.

thanks,

- thomas beale

Rong Chen wrote:

---

<div class="post-metadata">

### Author: ![Javier\_Viguera\_Munoz](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/j/f475e1/32.png) [@Javier\_Viguera\_Munoz](https://discourse.openehr.org/u/Javier_Viguera_Munoz)
#### Post date: [22 August 2005 19:15 UTC](https://discourse.openehr.org/t/problem-with-adl-parser/14499/4 "2005-08-22T19:15:05Z")

</div>

Hello Ron!!

The error message is the following:

Parsing: dl-test-entry.most\_minimal.draft.adl

log4j:WARN No appenders could be found for logger (org.openehr.am.archetype.Archetype).  
log4j:WARN Please initialize the log4j system properly.  
se.acode.openehr.parser.ParseException: Encountered "\<EOF\>" at line 16, column 1.  
Was expecting:  
&nbsp;&nbsp;&nbsp;&nbsp;\<SYM\_CONCEPT\> ...

If I try to parse other adl file the result is the same. Any idea?

Thanks

---

<div class="post-metadata">

### Author: ![rong.chen](https://discourse.openehr.org/user_avatar/discourse.openehr.org/rong.chen/32/515_2.png) [@rong.chen](https://discourse.openehr.org/u/rong.chen)
#### Post date: [22 August 2005 21:53 UTC](https://discourse.openehr.org/t/problem-with-adl-parser/14499/5 "2005-08-22T21:53:35Z")

</div>

How does the unit test run?

Can you try "maven clean test" from the console and see if all tests pass?

Cheers,

Rong

Javier Viguera Muñoz wrote:

---

<div class="post-metadata">

### Author: ![rong.chen](https://discourse.openehr.org/user_avatar/discourse.openehr.org/rong.chen/32/515_2.png) [@rong.chen](https://discourse.openehr.org/u/rong.chen)
#### Post date: [24 August 2005 20:11 UTC](https://discourse.openehr.org/t/problem-with-adl-parser/14499/6 "2005-08-24T20:11:30Z")

</div>

Javier Viguera Muñoz wrote:

> Hello Ron!!
> 
> I hadn't read the post of Tom, so following his advice, I send the post again but in the implementers list.
> 
> The error message is the following:
> 
> Parsing: dl-test-entry.most\_minimal.draft.adl
> 
> log4j:WARN No appenders could be found for logger (org.openehr.am.archetype.Archetype).  
> log4j:WARN Please initialize the log4j system properly.  
> se.acode.openehr.parser.ParseException: Encountered "\<EOF\>" at line 16, column 1.  
> Was expecting:  
> \<SYM\_CONCEPT\> ...
> 
> If I try to parse other adl file the result is the same. Any idea?

Not sure. It seems to be a platform specific issue, but it does work on my Win2K desktop.

Can you please confirm that all unit tests pass on your WinXP? Just cd to the top directory and type "maven clean javacc test".

You can also try to run the parser from console instead of Eclipse, just include commons-lang, commons-collections, log4j, openehr-kernel in your classpath and type "java se.acode.openehr.parser.ADLParser [adl\_file]". If the parsing is successful, you should see a screen dump of the archetype object model.

Let me know how does it go.

Rong

---

<div class="post-metadata">

### Author: ![Javier\_Viguera\_Munoz](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/j/f475e1/32.png) [@Javier\_Viguera\_Munoz](https://discourse.openehr.org/u/Javier_Viguera_Munoz)
#### Post date: [25 August 2005 18:40 UTC](https://discourse.openehr.org/t/problem-with-adl-parser/14499/7 "2005-08-25T18:40:12Z")

</div>

Hello Rong,

I did that you said and these are the results:

The source code of the adl parser(src,docs and res folders) is under ADL\_parser folder, so I typed:

D:\Proyecto\_fin\_de\_Carrera\ADL parser\Definitivo\ADL\_parser\>maven clear javacc test  
\_\_ \_\_

> \/ |\_\_ \_Apache\_\_ \_\_\_  
> \>\/| / \_` \ V / -\_) ' \ ~ intelligent projects ~  
> \_| |\_\_\_,\_|\_/\_\_\_|\_||\_| v. 1.1-beta-1

Intentando descargar openehr-kernel-1.2.3.jar.  
Ã­ATENCION!: Ã­Imposible descargar openehr-kernel-1.2.3.jar!  
Ã­El proceso no puede seguir! Falta la siguiente dependencia:

openehr-kernel-1.2.3.jar (try downloading from [http://www.acode.se](http://www.acode.se))

Total time : 3 seconds  
Finished at : jueves 25 de agosto de 2005 20:21:25 CEST

The text is in spanish, but it mean:  
"it's not possible to download openehr-kernel-1.2.3-jar  
The process cannot continue. The next dependency is missing:  
openehr-kernel-1.2.3.jar (try downloading from [http://www.acode.se](http://www.acode.se))"

If I try to run the parser from console the error message is the following:

D:\Proyecto\_fin\_de\_Carrera\ADL parser\Definitivo\>java -classpath openehr-kernel-1.2.4.jar;adl-parser-1.0.1.jar;commons-lang-2.1.jar;log4j-1.2.11.jar;commons-c  
ollections-3.0.jar se.acode.openehr.parser.ADLParser adl-test-entry.most\_minimal  
.draft.adl  
Exception in thread "main" java.lang.UnsupportedClassVersionError: se/acode/open  
ehr/parser/ADLParser (Unsupported major.minor version 49.0)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.lang.ClassLoader.defineClass0(Native Method)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.lang.ClassLoader.defineClass(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.security.SecureClassLoader.defineClass(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.net.URLClassLoader.defineClass(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.net.URLClassLoader.access$100(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.net.URLClassLoader$1.run(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.security.AccessController.doPrivileged(Native Method)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.net.URLClassLoader.findClass(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.lang.ClassLoader.loadClass(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.lang.ClassLoader.loadClass(Unknown Source)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;at java.lang.ClassLoader.loadClassInternal(Unknown Source)

I have all these libraries in ADL\_parser folder.

Am I doing anything wrong?

Thanks and regards

---

<div class="post-metadata">

### Author: ![rong.chen](https://discourse.openehr.org/user_avatar/discourse.openehr.org/rong.chen/32/515_2.png) [@rong.chen](https://discourse.openehr.org/u/rong.chen)
#### Post date: [25 August 2005 19:20 UTC](https://discourse.openehr.org/t/problem-with-adl-parser/14499/8 "2005-08-25T19:20:07Z")

</div>

Javier Viguera Muñoz wrote:

> Hello Rong,
> 
> I did that you said and these are the results:
> 
> The source code of the adl parser(src,docs and res folders) is under ADL\_parser folder, so I typed:
> 
> D:\Proyecto\_fin\_de\_Carrera\ADL parser\Definitivo\ADL\_parser\>maven clear javacc test  
> \_\_ \_\_  
> \> \/ |\_\_ \_Apache\_\_ \_\_\_  
> \> \>\/| / \_` \ V / -\_) ' \ ~ intelligent projects ~  
> \>\_| |\_\_\_,\_|\_/\_\_\_|\_||\_| v. 1.1-beta-1
> 
> Intentando descargar openehr-kernel-1.2.3.jar.  
> íATENCION!: íImposible descargar openehr-kernel-1.2.3.jar!  
> íEl proceso no puede seguir! Falta la siguiente dependencia:
> 
> openehr-kernel-1.2.3.jar (try downloading from [http://www.acode.se](http://www.acode.se))
> 
> Total time : 3 seconds  
> Finished at : jueves 25 de agosto de 2005 20:21:25 CEST
> 
> The text is in spanish, but it mean:  
> "it's not possible to download openehr-kernel-1.2.3-jar  
> The process cannot continue. The next dependency is missing:  
> openehr-kernel-1.2.3.jar (try downloading from [http://www.acode.se](http://www.acode.se))"

You need to manually put openehr-kernel-1.2.3.jar into your local maven repository. Perhaps in the future all jars could be hosted by openehr site to enable auto-download by maven.

> If I try to run the parser from console the error message is the following:
> 
> D:\Proyecto\_fin\_de\_Carrera\ADL parser\Definitivo\>java -classpath openehr-kernel-1.2.4.jar;adl-parser-1.0.1.jar;commons-lang-2.1.jar;log4j-1.2.11.jar;commons-c
> 
> ollections-3.0.jar se.acode.openehr.parser.ADLParser

You need to have commons-collection-2.1.jar instead of 3.0, see project.xml for dependency details.

Cheers,

Rong

---

<div class="post-metadata">

### Author: ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)
#### Post date: [25 August 2005 22:34 UTC](https://discourse.openehr.org/t/problem-with-adl-parser/14499/9 "2005-08-25T22:34:07Z")

</div>

Rong Chen wrote:

> Javier Viguera Muñoz wrote:
> 
> You need to manually put openehr-kernel-1.2.3.jar into your local maven repository. Perhaps in the future all jars could be hosted by openehr site to enable auto-download by maven.

Let me know what needs to be hosted where - we can put it into the oe\_distrib repository ([http://my.openehr.org/wsvn/oe\_distrib/](http://my.openehr.org/wsvn/oe_distrib/)).

- thomas

---

<div class="post-metadata">

### Author: ![Javier\_Viguera\_Munoz](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/j/f475e1/32.png) [@Javier\_Viguera\_Munoz](https://discourse.openehr.org/u/Javier_Viguera_Munoz)
#### Post date: [6 September 2005 07:10 UTC](https://discourse.openehr.org/t/problem-with-adl-parser/14499/10 "2005-09-06T07:10:10Z")

</div>

Hello Rong!!  
First of all, sorry for my insistence, but I have to finish my project soon. I am writting to your personal email address because I have problems with the implementers list of openEHR.

Did you receive my last mail with the result of my tests?.  
The results were the following:

The test of source code works fine (maven clean javacc test)  
Parsing an adl file from the console works too.  
However, from Eclipse doesn't work and the error message is the same.  
Do you know why?

Thanks and regards.  
Javier Viguera

---

<div class="post-metadata">

### Author: ![erik.sundvall](https://discourse.openehr.org/user_avatar/discourse.openehr.org/erik.sundvall/32/1961_2.png) [@erik.sundvall](https://discourse.openehr.org/u/erik.sundvall)
#### Post date: [13 September 2005 13:58 UTC](https://discourse.openehr.org/t/problem-with-adl-parser/14499/11 "2005-09-13T13:58:59Z")

</div>

Hello!

At Linköpings universitet we have now started three student projects related to openEHR.

1. EHR-portal for patients (web based read-only access)  
&nbsp;&nbsp;&nbsp;&nbsp;Joakim Fredriksson & Jonas Andersson (Joint master thesis project, 2x20 weeks)

2. Alternative java-based archetype editor (inspired by the exisitng two)  
&nbsp;&nbsp;&nbsp;&nbsp;Johan Hjalmarsson & Mattias Forss (Joint master thesis project, 2x20 weeks)

3. Archetype storage/search/retrieval portal  
&nbsp;&nbsp;&nbsp;&nbsp;We act as customers in a "Software Engineering Project" course.  
&nbsp;&nbsp;&nbsp;&nbsp;(A group of seven computer science students, 1300 man hours,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a lot of documentation requirements, an estimated maximum of  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1500-2000 lines of code can be produced.)

Questions are of course welcome! We'll probably be sending a lot of questions to this list since this is our first coding-centered activity related to openEHR, please have patience with us 🙂

Best Regards,  
Mikael Nyström & Erik Sundvall (PhD students)  
PhD Håkan Petersson & Prof. Hans Åhlfeldt  
Medical Informatics group at the Department of Biomedical Engineering  
Linköpings universitet, Sweden  
[http://www.imt.liu.se/mi/](http://www.imt.liu.se/mi/)

---

<div class="post-metadata">

### Author: ![erik.sundvall](https://discourse.openehr.org/user_avatar/discourse.openehr.org/erik.sundvall/32/1961_2.png) [@erik.sundvall](https://discourse.openehr.org/u/erik.sundvall)
#### Post date: [20 September 2005 07:34 UTC](https://discourse.openehr.org/t/problem-with-adl-parser/14499/12 "2005-09-20T07:34:48Z")

</div>

Re-posting messages that I sent to the openehr-implementers list  
a week ago (no response). Maybe they fit better on this list.

&nbsp;&nbsp;- - -

Hello!

At Linköpings universitet we have now started three student projects  
related to openEHR.

1. EHR-portal for patients (web based read-only access)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Joakim Fredriksson & Jonas Andersson  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Joint master thesis project, 2x20 weeks)

2. Alternative java-based archetype editor (inspired by the exisitng two)  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Johan Hjalmarsson & Mattias Forss  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Joint master thesis project, 2x20 weeks)

3. Archetype storage/search/retrieval portal  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;We act as customers in a "Software Engineering Project" course.  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(A group of seven computer science students, 1300 man hours,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;a lot of documentation requirements, an estimated maximum of  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1500-2000 lines of code can be produced.)

Questions are of course welcome! We'll probably be sending a lot of  
questions to this list since this is our first coding-centered activity  
related to openEHR, please have patience with us 🙂

Best Regards,  
Mikael Nyström & Erik Sundvall (PhD students)  
PhD Håkan Petersson & Prof. Hans Åhlfeldt  
Medical Informatics group at the Department of Biomedical Engineering  
Linköpings universitet, Sweden  
[http://www.imt.liu.se/mi/](http://www.imt.liu.se/mi/)

---

<div class="post-metadata">

### Author: ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)
#### Post date: [20 September 2005 13:35 UTC](https://discourse.openehr.org/t/problem-with-adl-parser/14499/13 "2005-09-20T13:35:08Z")

</div>

Hi Erik,

for the archetype editor, do those students want to work on the existing code or write new code? There is already an effort underway (see [http://svn.openehr.org/knowledge\_tools\_java/TRUNK/project\_page.htm](http://svn.openehr.org/knowledge_tools_java/TRUNK/project_page.htm)). Let me know if you want to collaborate, and we can arrange it. There are large areas not done, so I think there is a good opportunity for masters level thinking and development. The existing editor currently talks to the JNI-wrapped Eiffel parser, but we are also consindering making it talk to the a-code java parser.

For the 3rd project, there is also work underway, which your students may like to talk about - see [http://www.dualitysystems.com.au/archetypefinder/archetypefinder](http://www.dualitysystems.com.au/archetypefinder/archetypefinder). This portal screen is dynamically built from archetype meta-data.

- thomas beale

Erik Sundvall wrote:

---

<div class="post-metadata">

### Author: ![erik.sundvall](https://discourse.openehr.org/user_avatar/discourse.openehr.org/erik.sundvall/32/1961_2.png) [@erik.sundvall](https://discourse.openehr.org/u/erik.sundvall)
#### Post date: [23 September 2005 13:56 UTC](https://discourse.openehr.org/t/problem-with-adl-parser/14499/14 "2005-09-23T13:56:59Z")

</div>

Hi!

> for the archetype editor, do those students want to work on the existing code or write new code? There is already an effort underway

We are aware of the .NET version and UCL's corresponding Java project. Both those projects are used for inspiration and ideas. The students are allowed to use whatever they find useful in those projects.

In our computer science master projects there must be a substantial design phase, so mainly implementing systems designed by others is not enough, they have to design large parts themselves. I believe their final product will reuse ideas from the existing editors but it will probably also contain new features and alternative ways of preforming archetype design tasks.

> The existing editor currently talks to the JNI-wrapped Eiffel parser, but we are also consindering making it talk to the a-code java parser.

Their plan is to use the Java based parser from the start. (That has the additional benefit of avoiding platform dependendency)

By the way, are there any important features missing in the Java based parser that are available in the .NET version? If so, are they hard to fix?

> For the 3rd project, there is also work underway, which your students may like to talk about - see [http://www.dualitysystems.com.au/archetypefinder/archetypefinder](http://www.dualitysystems.com.au/archetypefinder/archetypefinder). This portal screen is dynamically built from archetype meta-data.

Great, thanks! I'm sure they will find it useful. Is the portal solution Open Source?

Best Regards,  
Erik Sundvall, IMT, LiU, Sweden  
[http://www.imt.liu.se/mi/](http://www.imt.liu.se/mi/)

---

<div class="post-metadata">

### Author: ![sebastian.garde](https://discourse.openehr.org/user_avatar/discourse.openehr.org/sebastian.garde/32/3070_2.png) [@sebastian.garde](https://discourse.openehr.org/u/sebastian.garde)
#### Post date: [26 September 2005 06:34 UTC](https://discourse.openehr.org/t/problem-with-adl-parser/14499/15 "2005-09-26T06:34:12Z")

</div>

Dear Eric,

At the moment we started a second development cycle for the  
Archetypefinder, but once we have a more advanced version out there  
(targeted for the end of the year), it is possible that we decide to  
make it available as open source. In the meantime if you'd like to  
collaborate in any form on this project let us know.

Kind regards,  
Sebastian

Dr Sebastian Garde  
Faculty of Informatics and Communication  
Central Queensland University  
Rockhampton Qld 4702, Australia

s.garde@cqu.edu.au  
Ph +61 (0)7 4930 6542  
Fax +61 (0)7 4930 9729  
[http://infocom.cqu.edu.au/hi](http://infocom.cqu.edu.au/hi)

> For the 3rd project, there is also work underway, which your students  
> may like to talk about - see  
> [http://www.dualitysystems.com.au/archetypefinder/archetypefinder](http://www.dualitysystems.com.au/archetypefinder/archetypefinder). This

> portal screen is dynamically built from archetype meta-data.

Great, thanks! I'm sure they will find it useful. Is the portal solution  
Open Source?

Best Regards,  
Erik Sundvall, IMT, LiU, Sweden  
[http://www.imt.liu.se/mi/](http://www.imt.liu.se/mi/)
