smarthome icon indicating copy to clipboard operation
smarthome copied to clipboard

Model validation fails with NPE

Open kaikreuzer opened this issue 8 years ago • 6 comments

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 avatar Apr 28 '17 15:04 kaikreuzer

This seems to be back, see https://github.com/openhab/openhab-distro/issues/614.

kaikreuzer avatar Dec 15 '17 19:12 kaikreuzer

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

DanielMalmgren avatar Aug 23 '18 12:08 DanielMalmgren

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

Justclouds avatar Oct 15 '18 05:10 Justclouds

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

andrelung avatar Oct 24 '18 10:10 andrelung

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

SuperSchelli avatar Apr 03 '19 08:04 SuperSchelli

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

maggu2810 avatar Apr 03 '19 13:04 maggu2810