Home » Modeling » EMF » Select using BooleanOCLCondition Question!
| |
Re: Select using BooleanOCLCondition Question! [message #431109 is a reply to message #431101] |
Mon, 29 June 2009 13:05 |
|
--=-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. 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. 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:
> 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.oclIsTy peOf(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>(ECoreMode l2BS_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
>
>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>
--=-B3Rru4XyA8OIOsU8+qrS--
|
|
| |
Goto Forum:
Current Time: Thu Mar 28 19:17:45 GMT 2024
Powered by FUDForum. Page generated in 0.02936 seconds
|