Problem with ADL_parser

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

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 {
     ADLParser parser = new ADLParser(new File(dir,
                 "adl-test-entry.most_minimal.draft.adl"));
     Archetype archetype = parser.parse();
     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.

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:

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:
    <SYM_CONCEPT> ...

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

Thanks

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:

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

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)

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)"

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)
        at java.lang.ClassLoader.defineClass0(Native Method)
        at java.lang.ClassLoader.defineClass(Unknown Source)
        at java.security.SecureClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.defineClass(Unknown Source)
        at java.net.URLClassLoader.access$100(Unknown Source)
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClassInternal(Unknown Source)

I have all these libraries in ADL_parser folder.

Am I doing anything wrong?

Thanks and regards

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)

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)"

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

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/).

- thomas

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

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)
    Joakim Fredriksson & Jonas Andersson (Joint master thesis project, 2x20 weeks)

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

3. Archetype storage/search/retrieval portal
    We act as customers in a "Software Engineering Project" course.
    (A group of seven computer science students, 1300 man hours,
     a lot of documentation requirements, an estimated maximum of
     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 :slight_smile:

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/

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

  - - -

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)
     Joakim Fredriksson & Jonas Andersson
     (Joint master thesis project, 2x20 weeks)

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

3. Archetype storage/search/retrieval portal
     We act as customers in a "Software Engineering Project" course.
     (A group of seven computer science students, 1300 man hours,
      a lot of documentation requirements, an estimated maximum of
      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 :slight_smile:

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/

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). 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. This portal screen is dynamically built from archetype meta-data.

- thomas beale

Erik Sundvall wrote:

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. 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/

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

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. 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/