Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF "Technology" (Ecore Tools, EMFatic, etc)  » java.lang.CircularityError IClientSelector
java.lang.CircularityError IClientSelector [message #568027] Mon, 20 February 2006 21:10
Selcuk Aya is currently offline Selcuk AyaFriend
Messages: 13
Registered: July 2009
Junior Member
Hi,
As validation framework nicely supports OCL, following the tutorial for
validation framework in emf, I tried to implement a simple constraint with
my two plugins GeneratedOETests and helloworld. helloworld contributes the
context, binding and constrain in its plugin.xml:


<extension
point="org.eclipse.emf.validation.constraintBindings">
<clientContext
default="false"
id="com.acme.orderentry.constraintsContext">
<selector
class="helloworld.actions.ValidationDelegateClientSelector"/ >
</clientContext>
<binding
context="com.acme.orderentry.constraintsContext"
category="com.acme.orderentry.constraints"/>
</extension>


<extension
point="org.eclipse.emf.validation.constraintProviders">
<category
name="OrderEntry Constraints"
id="com.acme.orderentry.constraints"/>
<constraintProvider cache="true">
<package namespaceUri="http:///orderentry.ecore"/>
<constraints categories="com.acme.orderentry.constraints">
<constraint
lang="Java"
class="helloworld.actions.NonEmptyNamesConstraint"
severity="ERROR"
mode="Batch"
name="Non-Empty Names"
id="com.acme.orderentry.constraints.NameNotEmpty"
statusCode="1">
<description>
All customers should have some unique identifier or name.
</description>
<message>
A {0} has been found to have no unique identifier (name
or title).
</message>
<target class="Customer"/>
</constraint>
</constraints>
</constraintProvider>
</extension>

In GeneratedOETests which depend on helloworld, the plugin-test
BatchValidator does the following:

Customer customer=OrderEntryFactory.eINSTANCE.createCustomer();
ValidationDelegateClientSelector.running = true;

IBatchValidator validator =
(IBatchValidator)ModelValidationService.getInstance()
.newValidator(EvaluationMode.BATCH);
validator.setIncludeLiveConstraints(true);


IStatus status=validator.validate(customer,null);
ValidationDelegateClientSelector.running = false;

Collection descs=ConstraintRegistry.getInstance().getAllDescriptors();
logger.debug("desc size:"+descs.size());

Collection
contexts=ClientContextManager.getInstance().getClientContext s();
logger.debug("contexts size:"+contexts.size());


In validator.validate(customer,null), when the class loader tries to load
ValidationDelegateClientSelector, it gives java.lang.CircularityError
error. Before trying to load the ValidationDelegateClientSelector, the
class loader actually looks at whether it has been alrady loaded and it
fails to find the class altough we already used it before calling the
validator.validate(customer,null) method.

I am using eclipse 3.2.0

I had spent quite some time on this. I would appreciate any directions or
suggestions for workarounds.
Thanks,
Selcuk
Previous Topic:New File Wizard in PDE genartes with org.eclipse.swt not found
Next Topic:Pre-requisite for using EODM
Goto Forum:
  


Current Time: Sat Oct 01 08:40:41 GMT 2022

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

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

Back to the top