Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » java.lang.NoClassDefFoundError: org/eclipse/ocl/internal/parser/OCLParser
java.lang.NoClassDefFoundError: org/eclipse/ocl/internal/parser/OCLParser [message #47175] Thu, 20 December 2007 08:48 Go to next message
Eclipse User
Originally posted by: wah.zurich.ibm.com

Hi,

I have followed the excellent article on generating Java code from
EMF/OCL models
( http://www.eclipse.org/articles/article.php?file=Article-EMF -Codegen-with-OCL/index.html).


Code generation works fine, and a validator class is generated that
looks reasonable.

To test the generated OCL constraints, I have created a test class from
which I invoke

validator.validateMyClass_myConstraint(c, new BasicDiagnostic(), new
HashMap<Object, Object>())

This method call results in the NoClassDefFoundError shown in the
subject line.

Two questions:
1. Is it ok to invoke the validator function with a new object of class
BasicDiagnostic and an empty map? Where can I find documentation on how
to set these parameters?

2. I execute my test class in the same workspace where my generated
source files are - may this cause the error?

Thanks,

Michael
Re: java.lang.NoClassDefFoundError: org/eclipse/ocl/internal/parser/OCLParser [message #47203 is a reply to message #47175] Thu, 20 December 2007 08:59 Go to previous messageGo to next message
Eclipse User
Originally posted by: cdamus.ca.ibm.com

Hi, Michael,

See some replies in-line, below.

HTH,

Christian

Michael Wahler wrote:

> Hi,
>
> I have followed the excellent article on generating Java code from
> EMF/OCL models
>
( http://www.eclipse.org/articles/article.php?file=Article-EMF -Codegen-with-OCL/index.html).
>
>
> Code generation works fine, and a validator class is generated that
> looks reasonable.
>
> To test the generated OCL constraints, I have created a test class from
> which I invoke
>
> validator.validateMyClass_myConstraint(c, new BasicDiagnostic(), new
> HashMap<Object, Object>())
>
> This method call results in the NoClassDefFoundError shown in the
> subject line.
>
> Two questions:
> 1. Is it ok to invoke the validator function with a new object of class
> BasicDiagnostic and an empty map? Where can I find documentation on how
> to set these parameters?

The usual way to perform validation is to use the validation operations
provided by the Diagnostician.INSTANCE.


> 2. I execute my test class in the same workspace where my generated
> source files are - may this cause the error?

Yes. This indicates that you compiled your code against OCL version 1.1 and
are running it against OCL version 1.2 (or, so it would seem, because the
org.eclipse.ocl.internal.parser package no longer exists in 1.2).


> Thanks,
>
> Michael
Re: java.lang.NoClassDefFoundError: org/eclipse/ocl/internal/parser/OCLParser [message #47227 is a reply to message #47203] Thu, 20 December 2007 09:12 Go to previous messageGo to next message
Eclipse User
Originally posted by: wah.zurich.ibm.com

Christian,

thanks a lot, it was indeed a problem caused by different versions of
the OCL plug-ins.

Now it works, and I have to say that I am really impressed of the
current OCL support in EMF/MDT! The next thing that I will try out is
going from a UML model from RSA via Ecore to Java - if it works, it
would be an awesome Christmas present :)

Michael
Re: java.lang.NoClassDefFoundError: org/eclipse/ocl/internal/parser/OCLParser [message #47258 is a reply to message #47227] Thu, 20 December 2007 09:26 Go to previous message
Eclipse User
Originally posted by: cdamus.ca.ibm.com

Hi, Michael,

I'm glad it's working for you. And thanks for the vote of confidence!

As far as I know, RSA's *.emx genmodel importer works just swell. Merry
Christmas!

Cheers,

Christian

Michael Wahler wrote:

> Christian,
>
> thanks a lot, it was indeed a problem caused by different versions of
> the OCL plug-ins.
>
> Now it works, and I have to say that I am really impressed of the
> current OCL support in EMF/MDT! The next thing that I will try out is
> going from a UML model from RSA via Ecore to Java - if it works, it
> would be an awesome Christmas present :)
>
> Michael
Previous Topic:eContainer()
Next Topic:subtle OCL Error detected: operations with return type EEList<? extends EClass1> not correctly
Goto Forum:
  


Current Time: Wed Apr 16 19:05:53 EDT 2014

Powered by FUDForum. Page generated in 0.01638 seconds