Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Select using BooleanOCLCondition Question!
Select using BooleanOCLCondition Question! [message #431100] Sun, 28 June 2009 10:31 Go to next message
Lucas Schubert is currently offline Lucas SchubertFriend
Messages: 11
Registered: July 2009
Junior Member
Hi!!!
I'm trying to create a query using EMF Query to get a List with all
classes from one specific package.
But I'm having one error in the Query execution.

One Part of the code:
------
OCL focl = org.eclipse.ocl.ecore.OCL.newInstance();
try {
fBooleanOCLCondition = new BooleanOCLCondition<EClassifier, EClass,
EObject>(focl.getEnvironment(),"self.oclIsTypeOf(EClass)",null);
} catch (ParserException e) {
e.printStackTrace();
}
fSelectQuery = new SELECT(new FROM(aPackage), new
WHERE(fBooleanOCLCondition));
------
The variable aPackage is from the EPackage type.

The Error msg:

-----
Exception in thread "main" java.lang.NoClassDefFoundError:
lpg/lpgjavaruntime/PrsStream
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
at java.security.SecureClassLoader.defineClass(SecureClassLoade r.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280 )
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374 )
at
org.eclipse.ocl.AbstractEnvironment.lookupLocal(AbstractEnvi ronment.java:550)
at
org.eclipse.ocl.AbstractEnvironment.addElement(AbstractEnvir onment.java:289)
at
org.eclipse.ocl.AbstractEnvironmentFactory.createClassifierC ontext(AbstractEnvironmentFactory.java:134)
at
org.eclipse.ocl.internal.helper.OCLHelperImpl.setContext(OCL HelperImpl.java:119)
at
org.eclipse.emf.query.ocl.conditions.AbstractOCLCondition.ge tOCLQueryRecord(AbstractOCLCondition.java:362)
at
org.eclipse.emf.query.ocl.conditions.AbstractOCLCondition.is Satisfied(AbstractOCLCondition.java:289)
at
org.eclipse.emf.query.ocl.conditions.BooleanOCLCondition.isS atisfied(BooleanOCLCondition.java:230)
at org.eclipse.emf.query.statements.WHERE.matches(WHERE.java:46 )
at org.eclipse.emf.query.statements.SELECT.doResume(SELECT.java :131)
at org.eclipse.emf.query.statements.SELECT.doExecute(SELECT.jav a:95)
at
org.eclipse.emf.query.internal.statements.QueryStatement.exe cute(QueryStatement.java:77)
at org.eclipse.emf.query.statements.SELECT.execute(SELECT.java: 172)
at
parser.ECoreModel2BS_MMParser.QtAbstractClassesPackage(ECore Model2BS_MMParser.java:96)
at
parser.ECoreModel2BS_MMParser.ProcessPackage(ECoreModel2BS_M MParser.java:130)
at parser.ECoreModel2BS_MMParser.<init>(ECoreModel2BS_MMParser.java:149)
at parser.ECoreModel2BS_MMParser.main(ECoreModel2BS_MMParser.ja va:183)
-----

I would like to ask if some of you knows what it could be!

Thanks a lot in advance,

Lucas
Re: Select using BooleanOCLCondition Question! [message #431101 is a reply to message #431100] Sun, 28 June 2009 11:25 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30686
Registered: July 2009
Senior Member
Lucas,

It just sounds like you have libraries missing. I.e., the ones needed
to parse the OCL expression. I'm not sure this stuff even works
stand-alone. Probably you need to run as an OSGi application...


Lucas wrote:
> Hi!!!
> I'm trying to create a query using EMF Query to get a List with all
> classes from one specific package.
> But I'm having one error in the Query execution.
>
> One Part of the code:
> ------
> OCL focl = org.eclipse.ocl.ecore.OCL.newInstance();
> try {
> fBooleanOCLCondition = new BooleanOCLCondition<EClassifier,
> EClass, EObject>(focl.getEnvironment(),"self.oclIsTypeOf(EClass)",null);
> } catch (ParserException e) {
> e.printStackTrace();
> }
> fSelectQuery = new SELECT(new FROM(aPackage), new
> WHERE(fBooleanOCLCondition));
> ------
> The variable aPackage is from the EPackage type.
>
> The Error msg:
>
> -----
> Exception in thread "main" java.lang.NoClassDefFoundError:
> lpg/lpgjavaruntime/PrsStream
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
> at
> java.security.SecureClassLoader.defineClass(SecureClassLoade r.java:124)
> at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
> at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
> at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
> at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280 )
> at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374 )
> at
> org.eclipse.ocl.AbstractEnvironment.lookupLocal(AbstractEnvi ronment.java:550)
>
> at
> org.eclipse.ocl.AbstractEnvironment.addElement(AbstractEnvir onment.java:289)
>
> at
> org.eclipse.ocl.AbstractEnvironmentFactory.createClassifierC ontext(AbstractEnvironmentFactory.java:134)
>
> at
> org.eclipse.ocl.internal.helper.OCLHelperImpl.setContext(OCL HelperImpl.java:119)
>
> at
> org.eclipse.emf.query.ocl.conditions.AbstractOCLCondition.ge tOCLQueryRecord(AbstractOCLCondition.java:362)
>
> at
> org.eclipse.emf.query.ocl.conditions.AbstractOCLCondition.is Satisfied(AbstractOCLCondition.java:289)
>
> at
> org.eclipse.emf.query.ocl.conditions.BooleanOCLCondition.isS atisfied(BooleanOCLCondition.java:230)
>
> at org.eclipse.emf.query.statements.WHERE.matches(WHERE.java:46 )
> at org.eclipse.emf.query.statements.SELECT.doResume(SELECT.java :131)
> at org.eclipse.emf.query.statements.SELECT.doExecute(SELECT.jav a:95)
> at
> org.eclipse.emf.query.internal.statements.QueryStatement.exe cute(QueryStatement.java:77)
>
> at org.eclipse.emf.query.statements.SELECT.execute(SELECT.java: 172)
> at
> parser.ECoreModel2BS_MMParser.QtAbstractClassesPackage(ECore Model2BS_MMParser.java:96)
>
> at
> parser.ECoreModel2BS_MMParser.ProcessPackage(ECoreModel2BS_M MParser.java:130)
>
> at
> parser.ECoreModel2BS_MMParser.<init>(ECoreModel2BS_MMParser.java:149)
> at
> parser.ECoreModel2BS_MMParser.main(ECoreModel2BS_MMParser.ja va:183)
> -----
>
> I would like to ask if some of you knows what it could be!
> Thanks a lot in advance,
>
> Lucas
>
>
Re: Select using BooleanOCLCondition Question! [message #431109 is a reply to message #431101] Mon, 29 June 2009 13:05 Go to previous messageGo to next message
Christian W. Damus is currently offline Christian W. DamusFriend
Messages: 1199
Registered: July 2009
Location: Canada
Senior Member

--=-B3Rru4XyA8OIOsU8+qrS
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, Ed, Lucas,

OCL and the LPG Java Run-time definitely work in a stand-alone
configuration, and the EMF Query code should, too, as it doesn't have
any extension points. I can't guarantee the latter, but it's worth a
try.

In any case, the dependency that Lucas is missing is the
net.sourceforge.lpgjavaruntime_1.1.0.qualifier.jar bundle. It's
included in the MDT OCL distribution.

HTH,

Christian

On Sun, 2009-06-28 at 07:25 -0400, Ed Merks wrote:

> Lucas,
>
> It just sounds like you have libraries missing. I.e., the ones needed
> to parse the OCL expression. I'm not sure this stuff even works
> stand-alone. Probably you need to run as an OSGi application...
>
>
> Lucas wrote:
> > Hi!!!
> > I'm trying to create a query using EMF Query to get a List with all
> > classes from one specific package.
> > But I'm having one error in the Query execution.
> >
> > One Part of the code:
> > ------
> > OCL focl = org.eclipse.ocl.ecore.OCL.newInstance();
> > try {
> > fBooleanOCLCondition = new BooleanOCLCondition<EClassifier,
> > EClass, EObject>(focl.getEnvironment(),"self.oclIsTypeOf(EClass)",null);
> > } catch (ParserException e) {
> > e.printStackTrace();
> > }
> > fSelectQuery = new SELECT(new FROM(aPackage), new
> > WHERE(fBooleanOCLCondition));
> > ------
> > The variable aPackage is from the EPackage type.
> >
> > The Error msg:
> >
> > -----
> > Exception in thread "main" java.lang.NoClassDefFoundError:
> > lpg/lpgjavaruntime/PrsStream
> > at java.lang.ClassLoader.defineClass1(Native Method)
> > at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
> > at
> > java.security.SecureClassLoader.defineClass(SecureClassLoade r.java:124)
> > at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
> > at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
> > at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
> > at java.security.AccessController.doPrivileged(Native Method)
> > at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
> > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280 )
> > at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
> > at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374 )
> > at
> > org.eclipse.ocl.AbstractEnvironment.lookupLocal(AbstractEnvi ronment.java:550)
> >
> > at
> > org.eclipse.ocl.AbstractEnvironment.addElement(AbstractEnvir onment.java:289)
> >
> > at
> > org.eclipse.ocl.AbstractEnvironmentFactory.createClassifierC ontext(AbstractEnvironmentFactory.java:134)
> >
> > at
> > org.eclipse.ocl.internal.helper.OCLHelperImpl.setContext(OCL HelperImpl.java:119)
> >
> > at
> > org.eclipse.emf.query.ocl.conditions.AbstractOCLCondition.ge tOCLQueryRecord(AbstractOCLCondition.java:362)
> >
> > at
> > org.eclipse.emf.query.ocl.conditions.AbstractOCLCondition.is Satisfied(AbstractOCLCondition.java:289)
> >
> > at
> > org.eclipse.emf.query.ocl.conditions.BooleanOCLCondition.isS atisfied(BooleanOCLCondition.java:230)
> >
> > at org.eclipse.emf.query.statements.WHERE.matches(WHERE.java:46 )
> > at org.eclipse.emf.query.statements.SELECT.doResume(SELECT.java :131)
> > at org.eclipse.emf.query.statements.SELECT.doExecute(SELECT.jav a:95)
> > at
> > org.eclipse.emf.query.internal.statements.QueryStatement.exe cute(QueryStatement.java:77)
> >
> > at org.eclipse.emf.query.statements.SELECT.execute(SELECT.java: 172)
> > at
> > parser.ECoreModel2BS_MMParser.QtAbstractClassesPackage(ECore Model2BS_MMParser.java:96)
> >
> > at
> > parser.ECoreModel2BS_MMParser.ProcessPackage(ECoreModel2BS_M MParser.java:130)
> >
> > at
> > parser.ECoreModel2BS_MMParser.<init>(ECoreModel2BS_MMParser.java:149)
> > at
> > parser.ECoreModel2BS_MMParser.main(ECoreModel2BS_MMParser.ja va:183)
> > -----
> >
> > I would like to ask if some of you knows what it could be!
> > Thanks a lot in advance,
> >
> > Lucas
> >
> >

--=-B3Rru4XyA8OIOsU8+qrS
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, Ed, Lucas,<BR>
<BR>
OCL and the LPG Java Run-time definitely work in a stand-alone configuration, and the EMF Query code should, too, as it doesn't have any extension points.&nbsp; I can't guarantee the latter, but it's worth a try.<BR>
<BR>
In any case, the dependency that Lucas is missing is the net.sourceforge.lpgjavaruntime_1.1.0.qualifier.jar bundle.&nbsp; It's included in the MDT OCL distribution.<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
On Sun, 2009-06-28 at 07:25 -0400, Ed Merks wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Lucas,

It just sounds like you have libraries missing. I.e., the ones needed
to parse the OCL expression. I'm not sure this stuff even works
stand-alone. Probably you need to run as an OSGi application...


Lucas wrote:
&gt; Hi!!!
&gt; I'm trying to create a query using EMF Query to get a List with all
&gt; classes from one specific package.
&gt; But I'm having one error in the Query execution.
&gt;
&gt; One Part of the code:
&gt; ------
&gt; OCL focl = org.eclipse.ocl.ecore.OCL.newInstance();
&gt; try {
&gt; fBooleanOCLCondition = new BooleanOCLCondition&lt;EClassifier,
&gt; EClass, EObject&gt;(focl.getEnvironment(),&quot;self.oclIsTy peOf(EClass)&quot;,null);
&gt; } catch (ParserException e) {
&gt; e.printStackTrace();
&gt; }
&gt; fSelectQuery = new SELECT(new FROM(aPackage), new
&gt; WHERE(fBooleanOCLCondition));
&gt; ------
&gt; The variable aPackage is from the EPackage type.
&gt;
&gt; The Error msg:
&gt;
&gt; -----
&gt; Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError:
&gt; lpg/lpgjavaruntime/PrsStream
&gt; at java.lang.ClassLoader.defineClass1(Native Method)
&gt; at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
&gt; at
&gt; java.security.SecureClassLoader.defineClass(SecureClassLoade r.java:124)
&gt; at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
&gt; at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
&gt; at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
&gt; at java.security.AccessController.doPrivileged(Native Method)
&gt; at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
&gt; at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
&gt; at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:280 )
&gt; at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
&gt; at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:374 )
&gt; at
&gt; org.eclipse.ocl.AbstractEnvironment.lookupLocal(AbstractEnvi ronment.java:550)
&gt;
&gt; at
&gt; org.eclipse.ocl.AbstractEnvironment.addElement(AbstractEnvir onment.java:289)
&gt;
&gt; at
&gt; org.eclipse.ocl.AbstractEnvironmentFactory.createClassifierC ontext(AbstractEnvironmentFactory.java:134)
&gt;
&gt; at
&gt; org.eclipse.ocl.internal.helper.OCLHelperImpl.setContext(OCL HelperImpl.java:119)
&gt;
&gt; at
&gt; org.eclipse.emf.query.ocl.conditions.AbstractOCLCondition.ge tOCLQueryRecord(AbstractOCLCondition.java:362)
&gt;
&gt; at
&gt; org.eclipse.emf.query.ocl.conditions.AbstractOCLCondition.is Satisfied(AbstractOCLCondition.java:289)
&gt;
&gt; at
&gt; org.eclipse.emf.query.ocl.conditions.BooleanOCLCondition.isS atisfied(BooleanOCLCondition.java:230)
&gt;
&gt; at org.eclipse.emf.query.statements.WHERE.matches(WHERE.java:46 )
&gt; at org.eclipse.emf.query.statements.SELECT.doResume(SELECT.java :131)
&gt; at org.eclipse.emf.query.statements.SELECT.doExecute(SELECT.jav a:95)
&gt; at
&gt; org.eclipse.emf.query.internal.statements.QueryStatement.exe cute(QueryStatement.java:77)
&gt;
&gt; at org.eclipse.emf.query.statements.SELECT.execute(SELECT.java: 172)
&gt; at
&gt; parser.ECoreModel2BS_MMParser.QtAbstractClassesPackage(ECore Model2BS_MMParser.java:96)
&gt;
&gt; at
&gt; parser.ECoreModel2BS_MMParser.ProcessPackage(ECoreModel2BS_M MParser.java:130)
&gt;
&gt; at
&gt; parser.ECoreModel2BS_MMParser.&lt;init&gt;(ECoreMode l2BS_MMParser.java:149)
&gt; at
&gt; parser.ECoreModel2BS_MMParser.main(ECoreModel2BS_MMParser.ja va:183)
&gt; -----
&gt;
&gt; I would like to ask if some of you knows what it could be!
&gt; Thanks a lot in advance,
&gt;
&gt; Lucas
&gt;
&gt;
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-B3Rru4XyA8OIOsU8+qrS--
Re: Select using BooleanOCLCondition Question! [message #431130 is a reply to message #431109] Mon, 29 June 2009 21:20 Go to previous message
Lucas Schubert is currently offline Lucas SchubertFriend
Messages: 11
Registered: July 2009
Junior Member
Hey Ed, Christian,

The net.sourceforge.lpgjavaruntime_1.1.0.qualifier.jar bundle was missing!
Now it is working! :)

Thanks a lot for your help! :)

Lucas
Previous Topic:[databinding] convert empty string to null
Next Topic:[EMF Databinding] Properly disposing of observables?
Goto Forum:
  


Current Time: Mon Dec 09 03:26:56 GMT 2019

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

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

Back to the top