Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » OCL Query Plugins Required
OCL Query Plugins Required [message #53613] Wed, 27 September 2006 13:33 Go to next message
Kamesh Sampath is currently offline Kamesh SampathFriend
Messages: 191
Registered: July 2009
Senior Member
I am trying to write an OCL query using the EMF Query tutorial , I am not
able find the class IOclQueryHelper and QueryHelper .

I have added the following plugins to my plugin dependencies ,

org.eclipse.emf.query
org.eclipse.emf.query.ocl
org.eclipse.emf.ocl

Are there any more plugins need to be added ?

Kamesh
Re: OCL Query Plugins Required [message #53823 is a reply to message #53613] Thu, 28 September 2006 12:00 Go to previous messageGo to next message
Kamesh Sampath is currently offline Kamesh SampathFriend
Messages: 191
Registered: July 2009
Senior Member
Can anyone help me please . I am struck .

I am also getting a NoClassDefFound Error when i I run my OCL Expression .

I guess it will be better to add few lines to EMF document or tutorials
on the plugins required us before executing the examples .

Kamesh

Kamesh Sampath wrote:
> I am trying to write an OCL query using the EMF Query tutorial , I am
> not able find the class IOclQueryHelper and QueryHelper .
> I have added the following plugins to my plugin dependencies ,
> org.eclipse.emf.query
> org.eclipse.emf.query.ocl
> org.eclipse.emf.ocl
>
> Are there any more plugins need to be added ?
>
> Kamesh
>


--

Kamesh Sampath
Re: OCL Query Plugins Required [message #53850 is a reply to message #53823] Thu, 28 September 2006 12:31 Go to previous messageGo to next message
Chris Lenz is currently offline Chris LenzFriend
Messages: 214
Registered: July 2009
Senior Member
import org.eclipse.emf.ocl.helper.HelperUtil;
import org.eclipse.emf.ocl.helper.IOCLHelper;

they are in org.eclipse.emf.ocl maybe you have an older version.
Whar class is not found??
Chris

Kamesh Sampath schrieb:
> Can anyone help me please . I am struck .
>
> I am also getting a NoClassDefFound Error when i I run my OCL Expression .
>
> I guess it will be better to add few lines to EMF document or tutorials
> on the plugins required us before executing the examples .
>
> Kamesh
>
> Kamesh Sampath wrote:
>> I am trying to write an OCL query using the EMF Query tutorial , I am
>> not able find the class IOclQueryHelper and QueryHelper .
>> I have added the following plugins to my plugin dependencies ,
>> org.eclipse.emf.query
>> org.eclipse.emf.query.ocl
>> org.eclipse.emf.ocl
>>
>> Are there any more plugins need to be added ?
>>
>> Kamesh
>>
>
>
Re: OCL Query Plugins Required [message #53874 is a reply to message #53850] Thu, 28 September 2006 12:37 Go to previous messageGo to next message
Kamesh Sampath is currently offline Kamesh SampathFriend
Messages: 191
Registered: July 2009
Senior Member
Chris,

My IOCLHelper is resolved, thanks for help. as you had said i just
updated my plugins to 1.0.1 .

By the way am just learning to use EMF OCL , so if there is any syntical
problem please do execuse me . I just want to set the environment for
running the OCL and slowly start learing the other OCL stuff.

I am running the following code snipper from my *.tests plugin's
XYZExample.java

Code Snippet of what am doing ?

// EMFT query
Map extents = new HashMap();
Set fbs = new HashSet();
extents.put(
StrutsconfigPackage.eINSTANCE.getFormBeanType(),
fbs);
String expr = "FormBeans.allInstances()->collect(a :
FormBeanType | a.name)-> asSet()";

Query query = QueryFactory.eINSTANCE.createQuery(expr,

StrutsconfigPackage.eINSTANCE.getFormBeanType());

query.setExtentMap(extents);

Collection result = query.evaluate(root.getFormBeans()
.getFormBeans());

but when i create a and run the OCL expression am getting the following
error ,

Exception in thread "main" java.lang.NoClassDefFoundError:
lpg/lpgjavaruntime/RuleAction
at java.lang.ClassLoader.defineClass1(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)
at
org.eclipse.emf.ocl.expressions.util.ExpressionsUtil.createP arser(ExpressionsUtil.java:680)
at
org.eclipse.emf.ocl.expressions.util.ExpressionsUtil.createP arser(ExpressionsUtil.java:663)
at
org.eclipse.emf.ocl.expressions.util.ExpressionsUtil.createQ uery(ExpressionsUtil.java:177)
at
org.eclipse.emf.ocl.expressions.util.ExpressionsUtil.createQ uery(ExpressionsUtil.java:156)
at
org.eclipse.emf.ocl.query.impl.QueryUtil.makeOCLQuery(QueryU til.java:66)
at
org.eclipse.emf.ocl.query.impl.QueryFactoryImpl.createQuery( QueryFactoryImpl.java:127)
at
in.org.shakti.strutsconfig.tests.StrutsconfigExample.main(St rutsconfigExample.java:169)

Your help in this regard is highly appericated ..

Thank you.

Kamesh


Chris Lenz wrote:
> import org.eclipse.emf.ocl.helper.HelperUtil;
> import org.eclipse.emf.ocl.helper.IOCLHelper;
>
> they are in org.eclipse.emf.ocl maybe you have an older version.
> Whar class is not found??
> Chris
>
> Kamesh Sampath schrieb:
>
>> Can anyone help me please . I am struck .
>>
>> I am also getting a NoClassDefFound Error when i I run my OCL Expression .
>>
>> I guess it will be better to add few lines to EMF document or tutorials
>> on the plugins required us before executing the examples .
>>
>> Kamesh
>>
>> Kamesh Sampath wrote:
>>
>>> I am trying to write an OCL query using the EMF Query tutorial , I am
>>> not able find the class IOclQueryHelper and QueryHelper .
>>> I have added the following plugins to my plugin dependencies ,
>>> org.eclipse.emf.query
>>> org.eclipse.emf.query.ocl
>>> org.eclipse.emf.ocl
>>>
>>> Are there any more plugins need to be added ?
>>>
>>> Kamesh
>>>
>>>
>>


--

Kamesh Sampath
Re: OCL Query Plugins Required [message #53915 is a reply to message #53613] Thu, 28 September 2006 13:04 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Kamesh,

The references to IOclQueryHelper and QueryHelper types in the tutorial are
in error. These were an older incarnation of the query API; they never did
exist in the org.eclipse.emf.query* APIs.

Would you mind raising a bug for this?

The discussion of the SELECT and OclCOnstraintCondition APIs in the
"Advanced Querying" section of the tutorial is more accurate.

HTH,

Christian


Kamesh Sampath wrote:

> I am trying to write an OCL query using the EMF Query tutorial , I am not
> able find the class IOclQueryHelper and QueryHelper .
>
> I have added the following plugins to my plugin dependencies ,
>
> org.eclipse.emf.query
> org.eclipse.emf.query.ocl
> org.eclipse.emf.ocl
>
> Are there any more plugins need to be added ?
>
> Kamesh
Re: OCL Query Plugins Required [message #53935 is a reply to message #53613] Thu, 28 September 2006 13:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Kamesh,

I forgot to mention that these are the only plug-ins required for querying
with OCL using the EMF Query API.

Cheers,

Christian


Kamesh Sampath wrote:

> I am trying to write an OCL query using the EMF Query tutorial , I am not
> able find the class IOclQueryHelper and QueryHelper .
>
> I have added the following plugins to my plugin dependencies ,
>
> org.eclipse.emf.query
> org.eclipse.emf.query.ocl
> org.eclipse.emf.ocl
>
> Are there any more plugins need to be added ?
>
> Kamesh
Re: OCL Query Plugins Required [message #53947 is a reply to message #53874] Thu, 28 September 2006 13:16 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Kamesh,

The IOCLHelper and Query interfaces in the EMFT OCL project are only
coincidentally similar in name to those that you were referred to by the
EMFT Query tutorial (and which do not exist). These are in no way a
replacement for that other API.

Regarding the NoClassDefFoundError on the RuleAction: are you running your
example below in an Eclipse instance? If not, the you will have to extract
the lpgjavaruntime.jar file from the emft-ocl-SDK-1.0.1.jar file (or
whatever version you are using) and put it on your classpath. This is the
LALR Parser Generator library that EMFT OCL uses for parsing OCL
expressions. We have a bug open to provide stand-alone builds of EMFT OCL
as EMF does for EMF, XSD, and SDO.

Once you have that straightened out, there may also be a few problems in
your snippet, below (comments in-line).

HTH,

Christian


Kamesh Sampath wrote:

> Chris,
>
> My IOCLHelper is resolved, thanks for help. as you had said i just
> updated my plugins to 1.0.1 .
>
> By the way am just learning to use EMF OCL , so if there is any syntical
> problem please do execuse me . I just want to set the environment for
> running the OCL and slowly start learing the other OCL stuff.
>
> I am running the following code snipper from my *.tests plugin's
> XYZExample.java
>
> Code Snippet of what am doing ?
>
> // EMFT query
> Map extents = new HashMap();
> Set fbs = new HashSet();
> extents.put(
>
StrutsconfigPackage.eINSTANCE.getFormBeanType(),
> fbs);

This is good, but I don't see any FormBeanTypes being added to the 'fbs'
set, so your extent is empty.

> String expr = "FormBeans.allInstances()->collect(a :
> FormBeanType | a.name)-> asSet()";

The 'allInstances()' operation must be applied to the name of the
EClassifier, which from the StrutsconfigPackage above looks like it would
be 'FormBeanType', not 'FormBeans'.

>
> Query query = QueryFactory.eINSTANCE.createQuery(expr,
>
> StrutsconfigPackage.eINSTANCE.getFormBeanType());
>
> query.setExtentMap(extents);
>
> Collection result = query.evaluate(root.getFormBeans()
> .getFormBeans());

In this case, because the expression invokes a static operation, I think you
may actually not need a context element (null would do). Otherwise, the
expected input to the Query.evaluate() method is just a form-bean object,
not a collection. It looks like this collection should be your "extent" in
the extent-map. :-)

>
> but when i create a and run the OCL expression am getting the following
> error ,
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> lpg/lpgjavaruntime/RuleAction
> at java.lang.ClassLoader.defineClass1(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)
> at
>
org.eclipse.emf.ocl.expressions.util.ExpressionsUtil.createP arser(ExpressionsUtil.java:680)
> at
>
org.eclipse.emf.ocl.expressions.util.ExpressionsUtil.createP arser(ExpressionsUtil.java:663)
> at
>
org.eclipse.emf.ocl.expressions.util.ExpressionsUtil.createQ uery(ExpressionsUtil.java:177)
> at
>
org.eclipse.emf.ocl.expressions.util.ExpressionsUtil.createQ uery(ExpressionsUtil.java:156)
> at
> org.eclipse.emf.ocl.query.impl.QueryUtil.makeOCLQuery(QueryU til.java:66)
> at
>
org.eclipse.emf.ocl.query.impl.QueryFactoryImpl.createQuery( QueryFactoryImpl.java:127)
> at
>
in.org.shakti.strutsconfig.tests.StrutsconfigExample.main(St rutsconfigExample.java:169)
>
> Your help in this regard is highly appericated ..
>
> Thank you.
>
> Kamesh
>
>
> Chris Lenz wrote:
>> import org.eclipse.emf.ocl.helper.HelperUtil;
>> import org.eclipse.emf.ocl.helper.IOCLHelper;
>>
>> they are in org.eclipse.emf.ocl maybe you have an older version.
>> Whar class is not found??
>> Chris
>>
>> Kamesh Sampath schrieb:
>>
>>> Can anyone help me please . I am struck .
>>>
>>> I am also getting a NoClassDefFound Error when i I run my OCL Expression
>>> .
>>>
>>> I guess it will be better to add few lines to EMF document or tutorials
>>> on the plugins required us before executing the examples .
>>>
>>> Kamesh
>>>
>>> Kamesh Sampath wrote:
>>>
>>>> I am trying to write an OCL query using the EMF Query tutorial , I am
>>>> not able find the class IOclQueryHelper and QueryHelper .
>>>> I have added the following plugins to my plugin dependencies ,
>>>> org.eclipse.emf.query
>>>> org.eclipse.emf.query.ocl
>>>> org.eclipse.emf.ocl
>>>>
>>>> Are there any more plugins need to be added ?
>>>>
>>>> Kamesh
>>>>
>>>>
>>>
>
>
Re: OCL Query Plugins Required [message #54115 is a reply to message #53935] Thu, 28 September 2006 13:35 Go to previous message
Kamesh Sampath is currently offline Kamesh SampathFriend
Messages: 191
Registered: July 2009
Senior Member
Hi Christian,

I will raise the bug for the same in the bugzilla .

Thanks.

Regards,
Kamesh


Christian W. Damus wrote:
> Hi, Kamesh,
>
> I forgot to mention that these are the only plug-ins required for querying
> with OCL using the EMF Query API.
>
> Cheers,
>
> Christian
>
>
> Kamesh Sampath wrote:
>
>
>> I am trying to write an OCL query using the EMF Query tutorial , I am not
>> able find the class IOclQueryHelper and QueryHelper .
>>
>> I have added the following plugins to my plugin dependencies ,
>>
>> org.eclipse.emf.query
>> org.eclipse.emf.query.ocl
>> org.eclipse.emf.ocl
>>
>> Are there any more plugins need to be added ?
>>
>> Kamesh
>>
>
>


--

Kamesh Sampath
Re: OCL Query Plugins Required [message #592430 is a reply to message #53613] Thu, 28 September 2006 12:00 Go to previous message
Kamesh Sampath is currently offline Kamesh SampathFriend
Messages: 191
Registered: July 2009
Senior Member
Can anyone help me please . I am struck .

I am also getting a NoClassDefFound Error when i I run my OCL Expression .

I guess it will be better to add few lines to EMF document or tutorials
on the plugins required us before executing the examples .

Kamesh

Kamesh Sampath wrote:
> I am trying to write an OCL query using the EMF Query tutorial , I am
> not able find the class IOclQueryHelper and QueryHelper .
> I have added the following plugins to my plugin dependencies ,
> org.eclipse.emf.query
> org.eclipse.emf.query.ocl
> org.eclipse.emf.ocl
>
> Are there any more plugins need to be added ?
>
> Kamesh
>


--

Kamesh Sampath
Re: OCL Query Plugins Required [message #592439 is a reply to message #53823] Thu, 28 September 2006 12:31 Go to previous message
Chris Lenz is currently offline Chris LenzFriend
Messages: 214
Registered: July 2009
Senior Member
import org.eclipse.emf.ocl.helper.HelperUtil;
import org.eclipse.emf.ocl.helper.IOCLHelper;

they are in org.eclipse.emf.ocl maybe you have an older version.
Whar class is not found??
Chris

Kamesh Sampath schrieb:
> Can anyone help me please . I am struck .
>
> I am also getting a NoClassDefFound Error when i I run my OCL Expression .
>
> I guess it will be better to add few lines to EMF document or tutorials
> on the plugins required us before executing the examples .
>
> Kamesh
>
> Kamesh Sampath wrote:
>> I am trying to write an OCL query using the EMF Query tutorial , I am
>> not able find the class IOclQueryHelper and QueryHelper .
>> I have added the following plugins to my plugin dependencies ,
>> org.eclipse.emf.query
>> org.eclipse.emf.query.ocl
>> org.eclipse.emf.ocl
>>
>> Are there any more plugins need to be added ?
>>
>> Kamesh
>>
>
>
Re: OCL Query Plugins Required [message #592447 is a reply to message #53850] Thu, 28 September 2006 12:37 Go to previous message
Kamesh Sampath is currently offline Kamesh SampathFriend
Messages: 191
Registered: July 2009
Senior Member
Chris,

My IOCLHelper is resolved, thanks for help. as you had said i just
updated my plugins to 1.0.1 .

By the way am just learning to use EMF OCL , so if there is any syntical
problem please do execuse me . I just want to set the environment for
running the OCL and slowly start learing the other OCL stuff.

I am running the following code snipper from my *.tests plugin's
XYZExample.java

Code Snippet of what am doing ?

// EMFT query
Map extents = new HashMap();
Set fbs = new HashSet();
extents.put(
StrutsconfigPackage.eINSTANCE.getFormBeanType(),
fbs);
String expr = "FormBeans.allInstances()->collect(a :
FormBeanType | a.name)-> asSet()";

Query query = QueryFactory.eINSTANCE.createQuery(expr,

StrutsconfigPackage.eINSTANCE.getFormBeanType());

query.setExtentMap(extents);

Collection result = query.evaluate(root.getFormBeans()
.getFormBeans());

but when i create a and run the OCL expression am getting the following
error ,

Exception in thread "main" java.lang.NoClassDefFoundError:
lpg/lpgjavaruntime/RuleAction
at java.lang.ClassLoader.defineClass1(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)
at
org.eclipse.emf.ocl.expressions.util.ExpressionsUtil.createP arser(ExpressionsUtil.java:680)
at
org.eclipse.emf.ocl.expressions.util.ExpressionsUtil.createP arser(ExpressionsUtil.java:663)
at
org.eclipse.emf.ocl.expressions.util.ExpressionsUtil.createQ uery(ExpressionsUtil.java:177)
at
org.eclipse.emf.ocl.expressions.util.ExpressionsUtil.createQ uery(ExpressionsUtil.java:156)
at
org.eclipse.emf.ocl.query.impl.QueryUtil.makeOCLQuery(QueryU til.java:66)
at
org.eclipse.emf.ocl.query.impl.QueryFactoryImpl.createQuery( QueryFactoryImpl.java:127)
at
in.org.shakti.strutsconfig.tests.StrutsconfigExample.main(St rutsconfigExample.java:169)

Your help in this regard is highly appericated ..

Thank you.

Kamesh


Chris Lenz wrote:
> import org.eclipse.emf.ocl.helper.HelperUtil;
> import org.eclipse.emf.ocl.helper.IOCLHelper;
>
> they are in org.eclipse.emf.ocl maybe you have an older version.
> Whar class is not found??
> Chris
>
> Kamesh Sampath schrieb:
>
>> Can anyone help me please . I am struck .
>>
>> I am also getting a NoClassDefFound Error when i I run my OCL Expression .
>>
>> I guess it will be better to add few lines to EMF document or tutorials
>> on the plugins required us before executing the examples .
>>
>> Kamesh
>>
>> Kamesh Sampath wrote:
>>
>>> I am trying to write an OCL query using the EMF Query tutorial , I am
>>> not able find the class IOclQueryHelper and QueryHelper .
>>> I have added the following plugins to my plugin dependencies ,
>>> org.eclipse.emf.query
>>> org.eclipse.emf.query.ocl
>>> org.eclipse.emf.ocl
>>>
>>> Are there any more plugins need to be added ?
>>>
>>> Kamesh
>>>
>>>
>>


--

Kamesh Sampath
Re: OCL Query Plugins Required [message #592469 is a reply to message #53613] Thu, 28 September 2006 13:04 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Kamesh,

The references to IOclQueryHelper and QueryHelper types in the tutorial are
in error. These were an older incarnation of the query API; they never did
exist in the org.eclipse.emf.query* APIs.

Would you mind raising a bug for this?

The discussion of the SELECT and OclCOnstraintCondition APIs in the
"Advanced Querying" section of the tutorial is more accurate.

HTH,

Christian


Kamesh Sampath wrote:

> I am trying to write an OCL query using the EMF Query tutorial , I am not
> able find the class IOclQueryHelper and QueryHelper .
>
> I have added the following plugins to my plugin dependencies ,
>
> org.eclipse.emf.query
> org.eclipse.emf.query.ocl
> org.eclipse.emf.ocl
>
> Are there any more plugins need to be added ?
>
> Kamesh
Re: OCL Query Plugins Required [message #592482 is a reply to message #53613] Thu, 28 September 2006 13:05 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Kamesh,

I forgot to mention that these are the only plug-ins required for querying
with OCL using the EMF Query API.

Cheers,

Christian


Kamesh Sampath wrote:

> I am trying to write an OCL query using the EMF Query tutorial , I am not
> able find the class IOclQueryHelper and QueryHelper .
>
> I have added the following plugins to my plugin dependencies ,
>
> org.eclipse.emf.query
> org.eclipse.emf.query.ocl
> org.eclipse.emf.ocl
>
> Are there any more plugins need to be added ?
>
> Kamesh
Re: OCL Query Plugins Required [message #592493 is a reply to message #53874] Thu, 28 September 2006 13:16 Go to previous message
Eclipse UserFriend
Originally posted by: cdamus.ca.ibm.com

Hi, Kamesh,

The IOCLHelper and Query interfaces in the EMFT OCL project are only
coincidentally similar in name to those that you were referred to by the
EMFT Query tutorial (and which do not exist). These are in no way a
replacement for that other API.

Regarding the NoClassDefFoundError on the RuleAction: are you running your
example below in an Eclipse instance? If not, the you will have to extract
the lpgjavaruntime.jar file from the emft-ocl-SDK-1.0.1.jar file (or
whatever version you are using) and put it on your classpath. This is the
LALR Parser Generator library that EMFT OCL uses for parsing OCL
expressions. We have a bug open to provide stand-alone builds of EMFT OCL
as EMF does for EMF, XSD, and SDO.

Once you have that straightened out, there may also be a few problems in
your snippet, below (comments in-line).

HTH,

Christian


Kamesh Sampath wrote:

> Chris,
>
> My IOCLHelper is resolved, thanks for help. as you had said i just
> updated my plugins to 1.0.1 .
>
> By the way am just learning to use EMF OCL , so if there is any syntical
> problem please do execuse me . I just want to set the environment for
> running the OCL and slowly start learing the other OCL stuff.
>
> I am running the following code snipper from my *.tests plugin's
> XYZExample.java
>
> Code Snippet of what am doing ?
>
> // EMFT query
> Map extents = new HashMap();
> Set fbs = new HashSet();
> extents.put(
>
StrutsconfigPackage.eINSTANCE.getFormBeanType(),
> fbs);

This is good, but I don't see any FormBeanTypes being added to the 'fbs'
set, so your extent is empty.

> String expr = "FormBeans.allInstances()->collect(a :
> FormBeanType | a.name)-> asSet()";

The 'allInstances()' operation must be applied to the name of the
EClassifier, which from the StrutsconfigPackage above looks like it would
be 'FormBeanType', not 'FormBeans'.

>
> Query query = QueryFactory.eINSTANCE.createQuery(expr,
>
> StrutsconfigPackage.eINSTANCE.getFormBeanType());
>
> query.setExtentMap(extents);
>
> Collection result = query.evaluate(root.getFormBeans()
> .getFormBeans());

In this case, because the expression invokes a static operation, I think you
may actually not need a context element (null would do). Otherwise, the
expected input to the Query.evaluate() method is just a form-bean object,
not a collection. It looks like this collection should be your "extent" in
the extent-map. :-)

>
> but when i create a and run the OCL expression am getting the following
> error ,
>
> Exception in thread "main" java.lang.NoClassDefFoundError:
> lpg/lpgjavaruntime/RuleAction
> at java.lang.ClassLoader.defineClass1(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)
> at
>
org.eclipse.emf.ocl.expressions.util.ExpressionsUtil.createP arser(ExpressionsUtil.java:680)
> at
>
org.eclipse.emf.ocl.expressions.util.ExpressionsUtil.createP arser(ExpressionsUtil.java:663)
> at
>
org.eclipse.emf.ocl.expressions.util.ExpressionsUtil.createQ uery(ExpressionsUtil.java:177)
> at
>
org.eclipse.emf.ocl.expressions.util.ExpressionsUtil.createQ uery(ExpressionsUtil.java:156)
> at
> org.eclipse.emf.ocl.query.impl.QueryUtil.makeOCLQuery(QueryU til.java:66)
> at
>
org.eclipse.emf.ocl.query.impl.QueryFactoryImpl.createQuery( QueryFactoryImpl.java:127)
> at
>
in.org.shakti.strutsconfig.tests.StrutsconfigExample.main(St rutsconfigExample.java:169)
>
> Your help in this regard is highly appericated ..
>
> Thank you.
>
> Kamesh
>
>
> Chris Lenz wrote:
>> import org.eclipse.emf.ocl.helper.HelperUtil;
>> import org.eclipse.emf.ocl.helper.IOCLHelper;
>>
>> they are in org.eclipse.emf.ocl maybe you have an older version.
>> Whar class is not found??
>> Chris
>>
>> Kamesh Sampath schrieb:
>>
>>> Can anyone help me please . I am struck .
>>>
>>> I am also getting a NoClassDefFound Error when i I run my OCL Expression
>>> .
>>>
>>> I guess it will be better to add few lines to EMF document or tutorials
>>> on the plugins required us before executing the examples .
>>>
>>> Kamesh
>>>
>>> Kamesh Sampath wrote:
>>>
>>>> I am trying to write an OCL query using the EMF Query tutorial , I am
>>>> not able find the class IOclQueryHelper and QueryHelper .
>>>> I have added the following plugins to my plugin dependencies ,
>>>> org.eclipse.emf.query
>>>> org.eclipse.emf.query.ocl
>>>> org.eclipse.emf.ocl
>>>>
>>>> Are there any more plugins need to be added ?
>>>>
>>>> Kamesh
>>>>
>>>>
>>>
>
>
Re: OCL Query Plugins Required [message #592549 is a reply to message #53935] Thu, 28 September 2006 13:35 Go to previous message
Kamesh Sampath is currently offline Kamesh SampathFriend
Messages: 191
Registered: July 2009
Senior Member
Hi Christian,

I will raise the bug for the same in the bugzilla .

Thanks.

Regards,
Kamesh


Christian W. Damus wrote:
> Hi, Kamesh,
>
> I forgot to mention that these are the only plug-ins required for querying
> with OCL using the EMF Query API.
>
> Cheers,
>
> Christian
>
>
> Kamesh Sampath wrote:
>
>
>> I am trying to write an OCL query using the EMF Query tutorial , I am not
>> able find the class IOclQueryHelper and QueryHelper .
>>
>> I have added the following plugins to my plugin dependencies ,
>>
>> org.eclipse.emf.query
>> org.eclipse.emf.query.ocl
>> org.eclipse.emf.ocl
>>
>> Are there any more plugins need to be added ?
>>
>> Kamesh
>>
>
>


--

Kamesh Sampath
Previous Topic:OCL and Context
Next Topic:CDO starter guide
Goto Forum:
  


Current Time: Mon Sep 23 06:37:41 GMT 2024

Powered by FUDForum. Page generated in 0.03940 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top