Rule loading problem

Dear all

while starting OH 1.8.3 I get occasionally errors (see line 7 and 11 in following log) but the affected file is both existing and has content.

Is this a known problem? If yes how can it be fixed?

Thanks & Regards
John

2016-08-28 10:33:01.451 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'airflow.rules'
2016-08-28 10:33:02.764 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'bwm.rules'
2016-08-28 10:33:02.779 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'jalousien.rules'
2016-08-28 10:33:02.811 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'lights.rules'
2016-08-28 10:33:03.326 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'notifications.rules'
2016-08-28 10:33:03.326 [WARN ] [c.internal.ModelRepositoryImpl] - Configuration model 'notifications.rules' is either empty or cannot be parsed correctly!
2016-08-28 10:33:03.326 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'oneline.rules'
2016-08-28 10:33:03.342 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'reset.rules'
2016-08-28 10:33:03.357 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'status.rules'
2016-08-28 10:33:03.623 [INFO ] [c.internal.ModelRepositoryImpl] - Loading model 'switches.rules'
2016-08-28 10:33:03.811 [ERROR] [r.i.DefaultResourceDescription] - notifications.rules (Das System kann die angegebene Datei nicht finden)
java.io.FileNotFoundException: notifications.rules (Das System kann die angegebene Datei nicht finden)
	at java.io.FileInputStream.open0(Native Method) ~[na:1.8.0_101]
	at java.io.FileInputStream.open(Unknown Source) ~[na:1.8.0_101]
	at java.io.FileInputStream.<init>(Unknown Source) ~[na:1.8.0_101]
	at org.eclipse.emf.ecore.resource.impl.FileURIHandlerImpl.createInputStream(FileURIHandlerImpl.java:99) ~[org.eclipse.emf.ecore_2.8.3.v20130125-0546.jar:na]
	at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:354) ~[org.eclipse.emf.ecore_2.8.3.v20130125-0546.jar:na]
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1256) ~[org.eclipse.emf.ecore_2.8.3.v20130125-0546.jar:na]
	at org.eclipse.xtext.resource.impl.DefaultResourceDescription.computeExportedObjects(DefaultResourceDescription.java:73) ~[org.eclipse.xtext_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.resource.DerivedStateAwareResourceDescriptionManager$1.getLookUp(DerivedStateAwareResourceDescriptionManager.java:61) [org.eclipse.xtext_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.resource.impl.AbstractResourceDescription.getExportedObjects(AbstractResourceDescription.java:32) [org.eclipse.xtext_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.resource.DerivedStateAwareResourceDescriptionManager.internalGetResourceDescription(DerivedStateAwareResourceDescriptionManager.java:45) [org.eclipse.xtext_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager$1.get(DefaultResourceDescriptionManager.java:60) [org.eclipse.xtext_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager$1.get(DefaultResourceDescriptionManager.java:1) [org.eclipse.xtext_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.util.OnChangeEvictingCache.get(OnChangeEvictingCache.java:75) [org.eclipse.xtext.util_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.resource.impl.DefaultResourceDescriptionManager.getResourceDescription(DefaultResourceDescriptionManager.java:58) [org.eclipse.xtext_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions.getResourceDescription(ResourceSetBasedResourceDescriptions.java:97) [org.eclipse.xtext_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions$1$1.computeNext(ResourceSetBasedResourceDescriptions.java:61) [org.eclipse.xtext_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.resource.impl.ResourceSetBasedResourceDescriptions$1$1.computeNext(ResourceSetBasedResourceDescriptions.java:1) [org.eclipse.xtext_2.3.0.v201206120633.jar:na]
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141) [com.google.guava_10.0.1.v201203051515.jar:na]
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136) [com.google.guava_10.0.1.v201203051515.jar:na]
	at com.google.common.collect.Iterators$7.computeNext(Iterators.java:643) [com.google.guava_10.0.1.v201203051515.jar:na]
	at com.google.common.collect.AbstractIterator.tryToComputeNext(AbstractIterator.java:141) [com.google.guava_10.0.1.v201203051515.jar:na]
	at com.google.common.collect.AbstractIterator.hasNext(AbstractIterator.java:136) [com.google.guava_10.0.1.v201203051515.jar:na]
	at com.google.common.collect.Iterators$8.hasNext(Iterators.java:777) [com.google.guava_10.0.1.v201203051515.jar:na]
	at com.google.common.collect.Iterables$3.hasNext(Iterables.java:501) [com.google.guava_10.0.1.v201203051515.jar:na]
	at com.google.common.collect.Iterators$5.hasNext(Iterators.java:539) [com.google.guava_10.0.1.v201203051515.jar:na]
	at org.eclipse.xtext.common.types.access.impl.IndexedJvmTypeAccess.getIndexedJvmType(IndexedJvmTypeAccess.java:64) [org.eclipse.xtext.common.types_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.common.types.access.impl.IndexedJvmTypeAccess.getIndexedJvmType(IndexedJvmTypeAccess.java:53) [org.eclipse.xtext.common.types_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.common.types.access.impl.ClasspathTypeProvider.findTypeByName(ClasspathTypeProvider.java:77) [org.eclipse.xtext.common.types_2.3.0.v201206120633.jar:na]
	at org.openhab.model.script.scoping.ScriptScopeProvider.createItemFeatures(ScriptScopeProvider.java:87) [org.openhab.model.script_1.8.3.jar:na]
	at org.openhab.model.script.scoping.ScriptScopeProvider.createSimpleFeatureCallScope(ScriptScopeProvider.java:64) [org.openhab.model.script_1.8.3.jar:na]
	at org.eclipse.xtext.xbase.scoping.XbaseScopeProvider.createFeatureCallScope(XbaseScopeProvider.java:331) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.scoping.XbaseScopeProvider.getScope(XbaseScopeProvider.java:179) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.linking.XbaseLinkingScopeProvider.getScope(XbaseLinkingScopeProvider.java:42) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.linking.impl.DefaultLinkingService.getScope(DefaultLinkingService.java:59) [org.eclipse.xtext_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.linking.impl.DefaultLinkingService.getLinkedObjects(DefaultLinkingService.java:119) [org.eclipse.xtext_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.linking.lazy.LazyLinkingResource.getEObject(LazyLinkingResource.java:179) [org.eclipse.xtext_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.resource.XbaseResource.access$0(XbaseResource.java:1) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.resource.XbaseResource$2.exec(XbaseResource.java:239) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.resource.XbaseResource$2.exec(XbaseResource.java:1) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.util.OnChangeEvictingCache.execWithoutCacheClear(OnChangeEvictingCache.java:124) [org.eclipse.xtext.util_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.resource.XbaseResource.getEObject(XbaseResource.java:237) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getEObject(ResourceSetImpl.java:223) [org.eclipse.emf.ecore_2.8.3.v20130125-0546.jar:na]
	at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:197) [org.eclipse.emf.ecore_2.8.3.v20130125-0546.jar:na]
	at org.eclipse.emf.ecore.util.EcoreUtil.resolve(EcoreUtil.java:257) [org.eclipse.emf.ecore_2.8.3.v20130125-0546.jar:na]
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eResolveProxy(BasicEObjectImpl.java:1473) [org.eclipse.emf.ecore_2.8.3.v20130125-0546.jar:na]
	at org.eclipse.xtext.xbase.impl.XAbstractFeatureCallImpl.getFeature(XAbstractFeatureCallImpl.java:175) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.impl.XAbstractFeatureCallImpl.eGet(XAbstractFeatureCallImpl.java:434) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.impl.XFeatureCallImpl.eGet(XFeatureCallImpl.java:224) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1011) [org.eclipse.emf.ecore_2.8.3.v20130125-0546.jar:na]
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:1003) [org.eclipse.emf.ecore_2.8.3.v20130125-0546.jar:na]
	at org.eclipse.emf.ecore.impl.BasicEObjectImpl.eGet(BasicEObjectImpl.java:998) [org.eclipse.emf.ecore_2.8.3.v20130125-0546.jar:na]
	at org.eclipse.xtext.xbase.resource.XbaseResource.trackResolution(XbaseResource.java:202) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.resource.XbaseResource.getFeature(XbaseResource.java:187) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.resource.LinkingAssumptions.getFeature(LinkingAssumptions.java:120) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.impl.FeatureCallToJavaMapping.getFeature(FeatureCallToJavaMapping.java:60) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.impl.FeatureCallToJavaMapping.getActualReceiver(FeatureCallToJavaMapping.java:44) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._evaluateAbstractFeatureCall(XbaseInterpreter.java:656) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at sun.reflect.GeneratedMethodAccessor41.invoke(Unknown Source) ~[na:na]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_101]
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291) [org.eclipse.xtext.util_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:218) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._evaluateBlockExpression(XbaseInterpreter.java:321) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_101]
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[na:1.8.0_101]
	at java.lang.reflect.Method.invoke(Unknown Source) ~[na:1.8.0_101]
	at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291) [org.eclipse.xtext.util_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:218) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.evaluate(XbaseInterpreter.java:204) [org.eclipse.xtext.xbase_2.3.0.v201206120633.jar:na]
	at org.openhab.model.script.internal.engine.ScriptImpl.execute(ScriptImpl.java:59) [org.openhab.model.script_1.8.3.jar:na]
	at org.openhab.core.scriptengine.ScriptExecutionThread.run(ScriptExecutionThread.java:44) [org.openhab.core.scriptengine_1.8.3.jar:na]

content of notification.rules (currently not in use)

/*rule "Test Notification"

when
	Item Window_EG_WZ_W received update
then
		sendSms("+41000000000", "dritter SMS Test")
		sendBroadcastNotification("HST EG West wurde geöffnet.")
end
	*/

It is a known problem that openHAB 1.x can incorrectly report a file is not found and not load it at startup. My theory has been that startup can open too many files at once at needs a higher ulimit, but I’ve not experimented. The Unix touch command, or anything that updates the file’s timestamp, will trigger the file to be loaded after openHAB starts. For example:

touch /etc/openhab/configurations/rules/notification.rules
1 Like

Ok, not nice but thanks a lot @watou for the workaround.

@rlkoshak gave me the hint how the touch command can be used on my windows machine, maybe this interesting for other users who have same problem:

On Windows, the equivalent of the “touch” command on Linux is “copy /b filename.ext +,”. The +, tells the copy command to not actually copy the file and just update the timestamp which cause the OSGi to reload the addon.

Is there a way that, let’s say after 1 minute, the “touch” is executed automatically? Please don’t say with a rule :joy:

Cheers
John

1 Like

Sorry, find going to have to use a rule.

Now I was trying a new way, the idea is like this:

  • create a batch file, it is called reloadrules.bat

    @echo off
    copy /b C:\OH\configurations\rules\airflows.rules +,

  • then use the exec binding to trigger the execution of the batch file
    Switch ExecBinding_ReloadRules "Reload Rules via Exec Binding" { exec="<[ON: /OH/configurations/reloadrules.bat :60000:REGEX((.*?))]" }

  • last step: use the CalDav binding in order to execute the before mentioned switch regularly

But now I’m running into a new problem. Looking at the logfile I see the following error:

2016-09-11 18:06:43.914 [WARN ] [.o.b.exec.internal.ExecBinding] - doesn't find matching binding provider [itemName=ExecBinding_ReloadRules, command=ON]
2016-09-11 18:06:45.513 [WARN ] [.o.b.exec.internal.ExecBinding] - doesn't find matching binding provider [itemName=ExecBinding_ReloadRules, command=OFF]

But some lines above, right after the start of OH 1.8.3 there is written:
2016-09-11 18:05:40.784 [INFO ] [.service.AbstractActiveService] - Exec Refresh Service has been started

Any ideas what is wrong?

Thanks & Regards
John

No one with an idea?

You have other items that use the exec binding but have you verified they actually work too?

Try reinstalling the exec binding

Try running it from a rule using executeCommandLine.

This doesn’t appear to be a problem on OH2.