UI Dependency Problem of emf.Diagnostics (instance models with OCL Pivot constraints) [message #994527] |
Thu, 27 December 2012 15:36 |
Tobias Lutz Messages: 16 Registered: April 2012 |
Junior Member |
|
|
Hello,
im not quite sure if this is an xtext or ocl problem.
I already found a similar problem at http://www.eclipse.org/forums/index.php/t/245264/
but it's from last year.
I also want to run some stuff in an headless junit-plugin-test and check my model if it's valid withing the following method:
//org.eclipse.emf.common.util.Diagnostic
private static boolean modelIsValid(EObject model){
Diagnostic modelValidity = Diagnostician.INSTANCE.validate(model);
if(modelValidity.getSeverity() == Diagnostic.OK){
return true;
}else {
jlog.log(Level.SEVERE, "Loaded Model "+ model +"is invalid!");
return false;
}}
The problem is that there are some errors thrown when calling this at line 1 "Diagnostician.INSTANCE.validate(model);" saying that Guice couldn't create some ui stuff.
Im loading the model like the following way:
registerNecessaryMetaModelPackages(); // all required Packages are registered here
resourceSet = new ResourceSetImpl();
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
resource = resourceSet.createResource(URI.createPlatformPluginURI("/projectName/folderpath/model.extension", true));
resource.load(null);
EcoreUtil.resolveAll(resource);
EObject model = resource.getContents().get(0);
if(modelIsValid(model)){
I figured out that this error only appears if i load a instance model of a metamodel with ocl constrains (pivot).
Loading a constraint free instancemodel or a metamodel works.
[Updated on: Thu, 27 December 2012 15:38] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04742 seconds