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 | = '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 | = 'Fuuny')
at org.eclipse.net4j.util.WrappedException.wrap(
at org.eclipse.emf.cdo.server.ocl.OCLQueryHandler.executeQuery(
at org.eclipse.emf.cdo.internal.server.QueryManager$
at java.util.concurrent.Executors$
at java.util.concurrent.ThreadPoolExecutor.runWorker(
at java.util.concurrent.ThreadPoolExecutor$
Caused by: org.eclipse.ocl.SemanticException: Unrecognized variable: (Company)
at org.eclipse.ocl.util.OCLUtil.checkForErrors(
at org.eclipse.ocl.util.OCLUtil.checkForErrors(
at org.eclipse.ocl.internal.helper.HelperUtil.checkForErrors(
at org.eclipse.ocl.internal.helper.HelperUtil.parseQuery(
at org.eclipse.ocl.internal.helper.OCLHelperImpl.createQuery(
at org.eclipse.emf.cdo.server.ocl.OCLQueryHandler.createQuery(
at org.eclipse.emf.cdo.server.ocl.OCLQueryHandler.executeQuery(

I check below references also:-

And I also registered the package like below

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: 5700
Registered: July 2009
Senior Member

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.


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: Wed Mar 21 09:05:54 GMT 2018

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

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