Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

Model validation fails with NPE #3335

Open
kaikreuzer opened this issue Apr 28, 2017 · 6 comments · Fixed by #3336
Open

Model validation fails with NPE #3335

kaikreuzer opened this issue Apr 28, 2017 · 6 comments · Fixed by #3336

Comments

@kaikreuzer
Copy link
Contributor

I sometimes find exceptions like the following in my log:

17:21:16.762 [ERROR] [xbase.resource.BatchLinkableResource] - resolution of uriFragment '|::0.2.0.2.0.0.0.6.7::0::/1' failed.
java.lang.NullPointerException
	at org.eclipse.xtext.xbase.resource.BatchLinkingService.resolveBatched(BatchLinkingService.java:62)
	at org.eclipse.xtext.xbase.resource.BatchLinkingService.resolveBatched(BatchLinkingService.java:41)
	at org.eclipse.xtext.xbase.resource.BatchLinkableResource.getEObject(BatchLinkableResource.java:117)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:223)
	at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:199)
	at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:259)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eResolveProxy(BasicEObjectImpl.java:1477)
	at org.eclipse.xtext.xbase.impl.XAbstractFeatureCallImplCustom.getFeature(XAbstractFeatureCallImplCustom.java:48)
	at org.eclipse.xtext.xbase.impl.XAbstractFeatureCallImpl.eGet(XAbstractFeatureCallImpl.java:490)
	at org.eclipse.xtext.xbase.impl.XFeatureCallImpl.eGet(XFeatureCallImpl.java:256)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1011)
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1003)
	at org.eclipse.emf.ecore.util.EContentsEList$FeatureIteratorImpl.hasNext(EContentsEList.java:439)
	at org.eclipse.emf.ecore.util.EObjectValidator.validate_EveryReferenceIsContained(EObjectValidator.java:782)
	at org.eclipse.emf.ecore.util.EObjectValidator.validate_EveryDefaultConstraint(EObjectValidator.java:355)
	at org.eclipse.emf.ecore.util.EObjectValidator$DynamicEClassValidator.validate(EObjectValidator.java:1420)
	at org.eclipse.emf.ecore.util.EObjectValidator$DynamicEClassValidator.validate(EObjectValidator.java:1423)
	at org.eclipse.emf.ecore.util.EObjectValidator$DynamicEClassValidator.validate(EObjectValidator.java:1423)
	at org.eclipse.emf.ecore.util.EObjectValidator.validate(EObjectValidator.java:333)
	at org.eclipse.xtext.validation.CompositeEValidator.validate(CompositeEValidator.java:151)
	at org.eclipse.emf.ecore.util.Diagnostician.doValidate(Diagnostician.java:171)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:158)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:137)
	at org.eclipse.emf.ecore.util.Diagnostician.doValidateContents(Diagnostician.java:185)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:161)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:137)
	at org.eclipse.emf.ecore.util.Diagnostician.doValidateContents(Diagnostician.java:181)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:161)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:137)
	at org.eclipse.emf.ecore.util.Diagnostician.doValidateContents(Diagnostician.java:181)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:161)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:137)
	at org.eclipse.emf.ecore.util.Diagnostician.doValidateContents(Diagnostician.java:181)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:161)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:137)
	at org.eclipse.emf.ecore.util.Diagnostician.doValidateContents(Diagnostician.java:185)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:161)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:137)
	at org.eclipse.emf.ecore.util.Diagnostician.doValidateContents(Diagnostician.java:185)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:161)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:137)
	at org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostician.java:108)
	at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.validateModel(ModelRepositoryImpl.java:264)
	at org.eclipse.smarthome.model.core.internal.ModelRepositoryImpl.addOrRefreshModel(ModelRepositoryImpl.java:90)
	at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.checkFile(FolderObserver.java:244)
	at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.processIgnoredFiles(FolderObserver.java:97)
	at org.eclipse.smarthome.model.core.internal.folder.FolderObserver.addModelParser(FolderObserver.java:82)

I assume that there is some race condition bug within Xtext - accepting that it exists, we should at least catch and make the log nicer.

kaikreuzer added a commit to kaikreuzer/smarthome that referenced this issue Apr 28, 2017
maggu2810 pushed a commit that referenced this issue Apr 30, 2017
Signed-off-by: Kai Kreuzer <[email protected]>
@kaikreuzer
Copy link
Contributor Author

This seems to be back, see openhab/openhab-distro#614.

@DanielMalmgren
Copy link

Don't know if it's anything worth reporting, but I just got one of these with last 2.4.0 snapshot (build 1338).

@ghost
Copy link

ghost commented Oct 15, 2018

Same for me with fresh install of 2.4.0 snapshot build 1389.

@andrelung
Copy link

Same here on 2.3.0-1, mostly happening on a restart

@SuperSchelli
Copy link

SuperSchelli commented Apr 3, 2019

Snapshot 2.5.0~1564-1 updated today, whenever i change a script my log is getting spammed with those messages for a few seconds

2019-04-03 10:24:26.420 [ERROR] [xbase.resource.BatchLinkableResource] - resolution of uriFragment '|::0.2.0.2.0.4.1.0.0.2.1.0.0.7.0::0::/1' failed.
2019-04-03 10:24:26.695 [ERROR] [xbase.resource.BatchLinkableResource] - resolution of uriFragment '|::0.2.0.2.0.4.1.0.0.2.1.0.0.7.0::0::/1' failed.
2019-04-03 10:24:26.974 [ERROR] [xbase.resource.BatchLinkableResource] - resolution of uriFragment '|::0.2.0.2.0.4.1.0.0.2.1.0.0.7.0::0::/1' failed.
2019-04-03 10:24:27.293 [ERROR] [xbase.resource.BatchLinkableResource] - resolution of uriFragment '|::0.2.0.2.0.4.1.0.0.2.1.0.0.7.0::0::/1' failed.

Changing back to Snapshot 2.5.0~1560-1 and all is good, just for info

@maggu2810
Copy link
Contributor

This repo is not maintained anymore.
For further information see #6883 and referenced links.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants