Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] MYSQL-OCL SemanticException
[CDO] MYSQL-OCL SemanticException [message #1759844] Wed, 19 April 2017 04:01 Go to next message
pradeep potti is currently offline pradeep pottiFriend
Messages: 3
Registered: April 2017
Junior Member
Hi all,

Can any one please guide me to resolve below Exception

Just I used basic query to CDO-MYSQl using OCL like below

CDOQuery qs = cdoView.createQuery("ocl", "Company.allInstances()->select(company:Company | company.name = 'data')");
List<Company> result1 = qs.getResult(Company.class);

I got the Exception :-

xception in thread "main" java.lang.RuntimeException: org.eclipse.net4j.util.WrappedException: Problem executing OCL query: Company.allInstances()->select(company:Company | company.name = 'Fuuny')
at org.eclipse.net4j.util.WrappedException.wrap(WrappedException.java:44)
at org.eclipse.emf.cdo.server.ocl.OCLQueryHandler.executeQuery(OCLQueryHandler.java:153)
at org.eclipse.emf.cdo.internal.server.QueryManager$QueryContext.run(QueryManager.java:303)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.eclipse.ocl.SemanticException: Unrecognized variable: (Company)
at org.eclipse.ocl.util.OCLUtil.checkForErrors(OCLUtil.java:352)
at org.eclipse.ocl.util.OCLUtil.checkForErrors(OCLUtil.java:322)
at org.eclipse.ocl.internal.helper.HelperUtil.checkForErrors(HelperUtil.java:512)
at org.eclipse.ocl.internal.helper.HelperUtil.parseQuery(HelperUtil.java:159)
at org.eclipse.ocl.internal.helper.OCLHelperImpl.createQuery(OCLHelperImpl.java:170)
at org.eclipse.emf.cdo.server.ocl.OCLQueryHandler.createQuery(OCLQueryHandler.java:230)
at org.eclipse.emf.cdo.server.ocl.OCLQueryHandler.executeQuery(OCLQueryHandler.java:127)

I check below references also:-
https://www.eclipse.org/forums/index.php/t/321399/

And I also registered the package like below
session.getPackageRegistry().putEPackage(CompanyPackage.eINSTANCE);



Regards,
Pradeep.
Re: [CDO] MYSQL-OCL SemanticException [message #1759849 is a reply to message #1759844] Wed, 19 April 2017 05:59 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You are correct in attempting to resolve the problem by ensuring that the CompanyPackage (assuming it contains the Company type) is registered. However I suspect that this is not the correct approach to ensure that the registration is available server-side, or else session is not associated with the correct PackageRegistry or the correct CompanyPackage. Look for a standard example. Sorry, my CDO knowledge is very limited.

Regards

Ed Willink

Previous Topic:[CDO] Getting UnsupportedOperationException While running OCL query on mongodb
Next Topic:Resourceset Change Location at Runtime but not updated while saving
Goto Forum:
  


Current Time: Fri Mar 29 10:39:39 GMT 2024

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

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

Back to the top