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

ESH Xtext 2.9.2 –> exceptions #1393

Closed
thesebastianf opened this issue Apr 17, 2016 · 109 comments
Closed

ESH Xtext 2.9.2 –> exceptions #1393

thesebastianf opened this issue Apr 17, 2016 · 109 comments
Labels

Comments

@thesebastianf
Copy link

thesebastianf commented Apr 17, 2016

the latest changes from ESH bumped xtext to 2.9.2

some of my rule do throw now: (they worked flawless before)

Exception in thread "Alarm bei Node 18" java.lang.NullPointerException
at org.eclipse.smarthome.model.script.engine.ScriptExecutionThread.run(ScriptExecutionThread.java:44)

example rules with exception since 2.9.2

rule "Alarm bei Node 18"
when
    Item zwave_device_15348538564_node18_sensor_binary changed to ON
then
    var String MotionLocation

    MO1_Motion_LastMovement.postUpdate (    new DateTimeType().format("%1$td.%1$tm. %1$tH:%1$tM") ) /
    MO1_Motion_LastMovement.persist
    MotionLocation = "Flur"

    General_Motion_LastMovement.postUpdate (    new DateTimeType().format("%1$td.%1$tm. %1$tH:%1$tM") + " (" + MotionLocation + ")" )  
    General_Motion_LastMovement.persist
        logInfo("Motion", "Bewegung an MO1 registriert um "+ MO1_Motion_LastMovement)
end
@thesebastianf
Copy link
Author

thesebastianf commented Apr 17, 2016

it also happens for:

rule "Gruppe AlleTempwerte auf extrem Werte überwachen"
when
    Item AlleTempwerte received update /*changed*/

then
        if (AlleTempwerte.members.filter(s | s.state > 40).size > 0) {
        logInfo("ALARM", "40 Grad")
        sendMail ("mymailwashere@gmail.com", "alarm", "Sensor 40 Grad")
        Feueralarm.postUpdate(ON)
        //sendNotification("mymailwashere@gmail.com", "xxxxxx")
        }
        else {
                logInfo("temps", "Temperatur:  nominal")
        }

end

@kaikreuzer
Copy link
Contributor

Well, this sounds as if something in your rule is null when you execute it. Would be good if you could analyze this (e.g. add logging messages) and to come up with a rule, which clearly shows that there is a bug in the rule engine.

@thesebastianf
Copy link
Author

thesebastianf commented Apr 18, 2016

well ... I am not too deep in OH yet ... since this rule had no exception for weeks and this exception is new since the build that consisted the xtext update I thought its related. also only these 2 of my rules (of ~15 rules) do throw an exception. additionally ... the rules with the exception do the expected and work anyways.

since @kaikreuzer said there is something NULL I just grepped all values from my 2nd comment example. -->


openhab> 
items |grep AlleTempwerte
zwave_device_15348538564_node11_sensor_temperature (Type=NumberItem, State=19, Label=Sensor (temperature), Category=Temperature, Groups=[zwave_device_15348538564_node11, AlleTempwerte])
zwave_device_15348538564_node16_sensor_temperature2 (Type=NumberItem, State=18.99, Label=Sensor (temperature) 2, Category=Temperature, Groups=[zwave_device_15348538564_node16, AlleTempwerte])
zwave_device_15348538564_node18_sensor_temperature (Type=NumberItem, State=20, Label=Sensor (temperature), Category=Temperature, Groups=[zwave_device_15348538564_node18, AlleTempwerte])
zwave_device_15348538564_node22_sensor_temperature (Type=NumberItem, State=19, Label=Sensor (temperature), Category=Temperature, Groups=[zwave_device_15348538564_node22, AlleTempwerte])
zwave_device_15348538564_node23_sensor_temperature (Type=NumberItem, State=19, Label=Sensor (temperature), Category=Temperature, Groups=[zwave_device_15348538564_node23, AlleTempwerte])
zwave_device_15348538564_node31_sensor_temperature (Type=NumberItem, State=18.5, Label=Sensor (temperature), Category=Temperature, Groups=[zwave_device_15348538564_node31, AlleTempwerte])
zwave_device_15348538564_node37_sensor_temperature (Type=NumberItem, State=20, Label=Sensor (temperature), Category=Temperature, Groups=[zwave_device_15348538564_node37, AlleTempwerte])
zwave_device_15348538564_node38_sensor_temperature (Type=NumberItem, State=20.5, Label=Sensor (temperature), Category=Temperature, Groups=[zwave_device_15348538564_node38, AlleTempwerte])
AlleTempwerte (Type=GroupItem, Members=8, State=UNDEF, Label=null, Category=null)
openhab> 
openhab> 
items |grep Feueralarm
Feueralarm (Type=SwitchItem, State=OFF, Label=null, Category=null)
openhab> 

all "states" from all items uses in the rule are not null... still the exception is triggered

for any hints I can do a better analysis I am more then open to do it.
thanks

@maggu2810
Copy link
Contributor

@shorty707 I think it is clear that the error has been triggered by the Xtext update. IMHO the question is if it is a bug or just a changed behavior (timing, ...) that caused the exception.

@maggu2810
Copy link
Contributor

Looking at the line 44 is assume that the real error is hidden ATM

    @Override
    public void run() {
        super.run();
        try {
            result = script.execute(context);
        } catch (ScriptExecutionException e) {
            String msg = e.getCause().getMessage();
            if (msg == null) {
                logger.error("Error during the execution of rule '{}'", getName(), e.getCause());
            } else {
                logger.error("Error during the execution of rule '{}': {}", new Object[] { getName(), msg });
            }
        }
    }

The exception you see is the line "String msg = e.getCause().getMessage();" that should prepare the logging of the exception of the real one.
It is valid that getCause returns null, so it must be catched here!

@thesebastianf
Copy link
Author

@maggu2810 thanks
anything I could do to narrow it down?

I tried to alter the rule a little but did not manage to avoid the exception or find a pattern why only these 2 rules are affected

@maggu2810
Copy link
Contributor

I will try to fix that line(s) and I hope we will get a more information then.

@maggu2810
Copy link
Contributor

@shorty707 Download the file "org.eclipse.smarthome.model.script-0.8.0-SNAPSHOT.jar" from here (https://drive.google.com/file/d/0Bx99QXY8p6gvSWlYRDF5eE84cUE/view?usp=sharing) and store it to some location on your drive.

In your Karaf container use
bundle:update org.eclipse.smarthome.model.script file:/path/to/the/downloaded/org.eclipse.smarthome.model.script-0.8.0-SNAPSHOT.jar

After that restart your container and let's look at the log output.

@thesebastianf
Copy link
Author

thesebastianf commented Apr 19, 2016

17:47:07.692 [ERROR] [.script.engine.ScriptExecutionThread] - Error during the execution of rule 'Gruppe AlleTempwerte auf extrem Werte überwachen'.
org.eclipse.smarthome.model.script.engine.ScriptExecutionException: Script interpreter couldn't be obtain
    at org.eclipse.smarthome.model.script.runtime.internal.engine.ScriptImpl.execute(ScriptImpl.java:74)[122:org.eclipse.smarthome.model.script.runtime:0.8.0.201604151434]
    at org.eclipse.smarthome.model.script.engine.ScriptExecutionThread.run(ScriptExecutionThread.java:42)[121:org.eclipse.smarthome.model.script:0.8.0.201604182105]

@maggu2810
Copy link
Contributor

Do you see this on the startup phase only or also after the system is running for a while?
I assume (ATM) that this is thrown on the time after the startup but not after it is running a while. Correct?

@maggu2810
Copy link
Contributor

If this is correct it is related to #870 and it could be solved by using DS to "know" the correct time to start script execution (also related to the startup rule solution then).

@thesebastianf
Copy link
Author

thesebastianf commented Apr 19, 2016

no its thrown all the time.

there is one thing to mention additionally.
a. after Startup the exact error from above is thrown and the rule does not work (the last line in the rule the log info logInfo("temps", "Temperatur: nominal") is not logged)

a. when I save the rule file AFTER the system started also the same exact error comes up but the rule executes fully (the last line in the rule actually comes directly after the exception.
I do not edit the rule ... just open it in editor and save again

but the exception is always thrown and wont stop also after hours

@thesebastianf
Copy link
Author

on startup I now logged this:

9:24:29.883 [WARN ] [org.eclipse.smarthome.model.script  ] - FrameworkEvent WARNING - org.eclipse.smarthome.model.script
org.osgi.framework.ServiceException: org.apache.felix.scr.impl.manager.SingleComponentManager.getService() returned a null service object
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:232)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.osgi.util.tracker.ServiceTracker.addingService(ServiceTracker.java:414)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:318)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[org.osgi.core-6.0.0.jar:]
    at org.eclipse.smarthome.model.script.internal.ScriptActivator.start(ScriptActivator.java:38)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at java.security.AccessController.doPrivileged(Native Method)[:1.8.0]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.Module.doStart(Module.java:571)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.Module.start(Module.java:439)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:531)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:320)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:395)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0]
    at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:568)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.initDependencyManagers(AbstractComponentManager.java:952)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.collectDependencies(AbstractComponentManager.java:980)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:812)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:774)[32:org.apache.felix.scr:2.0.2]
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at java.security.AccessController.doPrivileged(Native Method)[:1.8.0]
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at com.eclipsesource.jaxrs.publisher.internal.ResourceTracker.addingService(ResourceTracker.java:39)[14:com.eclipsesource.jaxrs.publisher:5.3.0.201512270850]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)[org.osgi.core-6.0.0.jar:]
    at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:914)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:869)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:857)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:133)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:915)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:715)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:399)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.config.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:676)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:339)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:360)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.Activator.access$000(Activator.java:53)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:260)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.utils.extender.AbstractExtender.addingBundle(AbstractExtender.java:192)[32:org.apache.felix.scr:2.0.2]
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:469)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:415)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)[org.osgi.core-6.0.0.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:902)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.Module.publishEvent(Module.java:466)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.Module.doStart(Module.java:538)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.Module.start(Module.java:439)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:531)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:320)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:391)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0]
    at org.eclipse.smarthome.model.rule.RulesStandaloneSetupGenerated.createInjectorAndDoEMFRegistration(RulesStandaloneSetupGenerated.java:21)
    at org.eclipse.smarthome.model.rule.RulesStandaloneSetup.doSetup(RulesStandaloneSetup.java:22)
    at org.eclipse.smarthome.model.rule.runtime.internal.RuleRuntimeActivator.activate(RuleRuntimeActivator.java:33)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0]
    at java.lang.reflect.Method.invoke(Method.java:483)[:1.8.0]
    at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:222)
    at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:37)
    at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:615)
    at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:499)
    at org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:295)
    at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:302)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:113)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:866)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:833)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:774)[32:org.apache.felix.scr:2.0.2]
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at java.security.AccessController.doPrivileged(Native Method)[:1.8.0]
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at com.eclipsesource.jaxrs.publisher.internal.ResourceTracker.addingService(ResourceTracker.java:39)[14:com.eclipsesource.jaxrs.publisher:5.3.0.201512270850]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)[org.osgi.core-6.0.0.jar:]
    at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:914)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:869)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:857)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:133)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:915)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:715)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:399)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.config.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:676)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:339)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:360)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.Activator.access$000(Activator.java:53)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:260)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)[32:org.apache.felix.scr:2.0.2]
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:415)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)[org.osgi.core-6.0.0.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:902)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.Module.publishEvent(Module.java:466)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.Module.start(Module.java:457)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]9:24:29.883 [WARN ] [org.eclipse.smarthome.model.script  ] - FrameworkEvent WARNING - org.eclipse.smarthome.model.script
org.osgi.framework.ServiceException: org.apache.felix.scr.impl.manager.SingleComponentManager.getService() returned a null service object
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:232)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.osgi.util.tracker.ServiceTracker.addingService(ServiceTracker.java:414)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:318)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.ServiceTracker.open(ServiceTracker.java:261)[org.osgi.core-6.0.0.jar:]
    at org.eclipse.smarthome.model.script.internal.ScriptActivator.start(ScriptActivator.java:38)
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:771)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl$3.run(BundleContextImpl.java:1)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at java.security.AccessController.doPrivileged(Native Method)[:1.8.0]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.startActivator(BundleContextImpl.java:764)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.start(BundleContextImpl.java:721)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxBundle.startWorker0(EquinoxBundle.java:936)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxBundle$EquinoxModule.startWorker(EquinoxBundle.java:319)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.Module.doStart(Module.java:571)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.Module.start(Module.java:439)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:531)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:320)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:395)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0]
    at org.eclipse.osgi.internal.framework.EquinoxBundle.loadClass(EquinoxBundle.java:568)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.initDependencyManagers(AbstractComponentManager.java:952)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.collectDependencies(AbstractComponentManager.java:980)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:812)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:774)[32:org.apache.felix.scr:2.0.2]
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at java.security.AccessController.doPrivileged(Native Method)[:1.8.0]
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at com.eclipsesource.jaxrs.publisher.internal.ResourceTracker.addingService(ResourceTracker.java:39)[14:com.eclipsesource.jaxrs.publisher:5.3.0.201512270850]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)[org.osgi.core-6.0.0.jar:]
    at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:914)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:869)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:857)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:133)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:915)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:715)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:399)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.config.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:676)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:339)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:360)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.Activator.access$000(Activator.java:53)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:260)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.utils.extender.AbstractExtender.addingBundle(AbstractExtender.java:192)[32:org.apache.felix.scr:2.0.2]
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:469)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:415)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)[org.osgi.core-6.0.0.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:902)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.Module.publishEvent(Module.java:466)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.Module.doStart(Module.java:538)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.Module.start(Module.java:439)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.util.SecureAction.start(SecureAction.java:454)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.hooks.EclipseLazyStarter.postFindLocalClass(EclipseLazyStarter.java:107)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.classpath.ClasspathManager.findLocalClass(ClasspathManager.java:531)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.findLocalClass(ModuleClassLoader.java:324)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findLocalClass(BundleLoader.java:320)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.sources.SingleSourcePackage.loadClass(SingleSourcePackage.java:36)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:391)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:345)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:337)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:160)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)[:1.8.0]
    at org.eclipse.smarthome.model.rule.RulesStandaloneSetupGenerated.createInjectorAndDoEMFRegistration(RulesStandaloneSetupGenerated.java:21)
    at org.eclipse.smarthome.model.rule.RulesStandaloneSetup.doSetup(RulesStandaloneSetup.java:22)
    at org.eclipse.smarthome.model.rule.runtime.internal.RuleRuntimeActivator.activate(RuleRuntimeActivator.java:33)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[:1.8.0]
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[:1.8.0]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[:1.8.0]
    at java.lang.reflect.Method.invoke(Method.java:483)[:1.8.0]
    at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:222)
    at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:37)
    at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:615)
    at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:499)
    at org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:295)
    at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:302)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:113)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:866)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:833)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:774)[32:org.apache.felix.scr:2.0.2]
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse$1.run(ServiceFactoryUse.java:212)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at java.security.AccessController.doPrivileged(Native Method)[:1.8.0]
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.factoryGetService(ServiceFactoryUse.java:210)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceFactoryUse.getService(ServiceFactoryUse.java:111)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceConsumer$2.getService(ServiceConsumer.java:45)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:496)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.getService(ServiceRegistry.java:461)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.getService(BundleContextImpl.java:619)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at com.eclipsesource.jaxrs.publisher.internal.ResourceTracker.addingService(ResourceTracker.java:39)[14:com.eclipsesource.jaxrs.publisher:5.3.0.201512270850]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:941)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.ServiceTracker$Tracked.customizerAdding(ServiceTracker.java:870)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:229)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:901)[org.osgi.core-6.0.0.jar:]
    at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:914)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.register(ServiceRegistrationImpl.java:127)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.registerService(ServiceRegistry.java:225)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.registerService(BundleContextImpl.java:464)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:869)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:857)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:133)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:915)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:715)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:399)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.config.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:676)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator.java:339)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:360)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.Activator.access$000(Activator.java:53)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:260)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:259)[32:org.apache.felix.scr:2.0.2]
    at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232)[32:org.apache.felix.scr:2.0.2]
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:415)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)[org.osgi.core-6.0.0.jar:]
    at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:902)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:165)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:75)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:67)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:102)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.Module.publishEvent(Module.java:466)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.Module.start(Module.java:457)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]

kaikreuzer pushed a commit that referenced this issue Apr 19, 2016
* Do not cut of script exception
This is related to: #1393 (comment)

PR: #1405
Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>

* show message of exception (cause could be null)

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
@maggu2810
Copy link
Contributor

AFAIK the message
org.osgi.framework.ServiceException: org.apache.felix.scr.impl.manager.SingleComponentManager.getService() returned a null service object
is most of the time related to a circular dependency.

@thesebastianf
Copy link
Author

still no clue if its related to my exception.
I upgraded OH to the latest snapshot.

for my ininital post the rule has no more exception.

the exception for the rule from comment 2 (rule "Gruppe AlleTempwerte auf extrem Werte überwachen") the exception keeps coming

@maggu2810
Copy link
Contributor

Don't know if this is related to the openHAB distribution or some of the openHAB bundles.
I tried to get this error using a Karaf container and installed ALL Eclipse SmartHome features.
The circular dependencies error has not been thrown.

Will try to reproduce it.

@maggu2810
Copy link
Contributor

@kaikreuzer The message disappeared on openHAB after some changes.
I remembered on my trouble with the lazy activation method ESH has been used on some bindings.
After removing lazy activation in all bundles (simple sed over all manifests) I ignored the failed tests and build ESH with "-DskipTests=true".
After that I build openHAB.
After the start the error does not appear anymore.

Sure, I have not done any real tests until now, just checked "bundle:list" and "scr:list" and the log.

What is the reason for all that lazy activations at all?
I do not see any use case here.

Ah and do you remember:
I remembered about this one: https://bugs.eclipse.org/bugs/show_bug.cgi?id=477075#c3

@maggu2810
Copy link
Contributor

Okay, I have found out how to get the tests working again. Need just some time to fix all tests etc.

@maggu2810
Copy link
Contributor

@shorty707 Okay for you to test an openHAB offline distribution I create for you?
I would like to give you a distribution that uses #1407 already.

@maggu2810
Copy link
Contributor

@shorty707 Please test 😉 https://drive.google.com/open?id=0Bx99QXY8p6gvQkU5ZnRoWTF3Wm8

@kaikreuzer
Copy link
Contributor

I also cannot make the circular dependency exception appear anymore with this build - so that looks pretty good to me!

@thesebastianf
Copy link
Author

@maggu2810 ok will test and let you know

This was referenced Apr 20, 2016
@thesebastianf
Copy link
Author

@maggu2810

21:42:04.883 [ERROR] [.script.engine.ScriptExecutionThread] - Error during the execution of rule 'Gruppe AlleTempwerte auf extrem Werte überwachen': Script interpreter couldn't be obtain
21:42:04.900 [INFO ] [rthome.model.script.Temperaturgruppe] - Temperatur: Werte nominal

@maggu2810
Copy link
Contributor

Okay @shorty707, so this error is still not solved.
Regardless of this still failing rule execution I think it is okay to merge #1407. It cleans some stuff up and does not break other stuff of your system.

And we will continue to inspect your error.

Is there some private stuff in your runtime or could you give me a copy so I can start it on my system?
Do you think I can trigger the error myself by set state updates myself?

@thesebastianf
Copy link
Author

can zip and upload to gdrive

need all or just the conf folder?

@maggu2810
Copy link
Contributor

If you give me all, then I can filter myself and we do not miss something.

@watou
Copy link
Contributor

watou commented May 23, 2016

You don't have to import org.joda.time.* in ESH? What happens if you only new DateTimeType()?

@maggu2810
Copy link
Contributor

What happens if you only new DateTimeType()?

That is working, see above:
#1393 (comment)

@maggu2810
Copy link
Contributor

You don't have to import org.joda.time.* in ESH?

Using import org.joda.time.DateTime in the first line of the rule also allows the usage of new DateTime()

@kgoderis
Copy link
Contributor

mmm.... since

var DateTime scheduledDeparture = now.withHourOfDay(8).withMinuteOfHour(30).withSecondOfMinute(0)

seems to not work either, this might mean there is a problem importing org.joda.time in the first place?

I tend to use jodatime quite a bit to store DateTime during rule execution, and then have something like

TeslaScheduledDeparture.postUpdate(new DateTimeType(scheduledDeparture.toGregorianCalendar()))
to "store" the result

Is there an alternative approach that can be pursued?

@maggu2810
Copy link
Contributor

I have a look at the sources to improve the error logging.
The execute method in the ScriptImpl class catch the exception and does a limited logging.
But also log the whole exception does not contain more information (at least to me).

2016-05-23 22:16:32,828 | INFO  | ESH-safeCall-3   | ItemStateEvent                   | 130 - org.eclipse.smarthome.io.monitor - 0.8.0.b5 | KebaState updated to 1
2016-05-23 22:16:32,828 | INFO  | ESH-safeCall-3   | ItemStateChangedEvent            | 130 - org.eclipse.smarthome.io.monitor - 0.8.0.b5 | KebaState changed from NULL to 1
2016-05-23 22:16:33,822 | INFO  | ESH-safeCall-3   | ItemStateEvent                   | 130 - org.eclipse.smarthome.io.monitor - 0.8.0.b5 | KebaState updated to 2
2016-05-23 22:16:33,823 | INFO  | ESH-safeCall-3   | ItemStateChangedEvent            | 130 - org.eclipse.smarthome.io.monitor - 0.8.0.b5 | KebaState changed from 1 to 2
2016-05-23 22:16:34,021 | INFO  | a connected rule | test                             | 144 - org.eclipse.smarthome.model.script - 0.8.0.b5 | 1
2016-05-23 22:16:34,021 | WARN  | a connected rule | ScriptImpl                       | 145 - org.eclipse.smarthome.model.script.runtime - 0.8.0.b5 | Execution of script failed.
java.lang.NullPointerException
    at org.eclipse.xtext.common.types.util.JavaReflectAccess.getRawType(JavaReflectAccess.java:107)[157:org.eclipse.xtext.common.types:2.9.2]
    at org.eclipse.xtext.common.types.util.JavaReflectAccess.getConstructor(JavaReflectAccess.java:90)[157:org.eclipse.xtext.common.types:2.9.2]
    at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:738)[160:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
    at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:237)[160:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
    at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:203)[160:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
    at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter._doEvaluate(XbaseInterpreter.java:446)[160:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
    at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.doEvaluate(XbaseInterpreter.java:227)[160:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
    at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.internalEvaluate(XbaseInterpreter.java:203)[160:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
    at org.eclipse.xtext.xbase.interpreter.impl.XbaseInterpreter.evaluate(XbaseInterpreter.java:189)[160:org.eclipse.xtext.xbase:2.9.2.v20160428-1452]
    at org.eclipse.smarthome.model.script.runtime.internal.engine.ScriptImpl.execute(ScriptImpl.java:81)[145:org.eclipse.smarthome.model.script.runtime:0.8.0.b5]
    at org.eclipse.smarthome.model.script.engine.ScriptExecutionThread.run(ScriptExecutionThread.java:42)[144:org.eclipse.smarthome.model.script:0.8.0.b5]
2016-05-23 22:16:34,022 | ERROR | a connected rule | ScriptExecutionThread            | 144 - org.eclipse.smarthome.model.script - 0.8.0.b5 | Error during the execution of rule 'Tesla - keba connected rule': An error occured during the script execution: null

That is a little bit wired.

But it seems that using the correct imports etc. also this error could be resolved, so I don't think the rules are broken now. They are perhaps more strict and without good logging.
Let's investigate this...

@kgoderis
Copy link
Contributor

kgoderis commented Jun 1, 2016

Anyone any progress on this?

Sorry to be bitching about this, but to me this sounds as a critical issue for which we do not have a solution yet, besides downgrading xtext.... It renders the Karaf based runtime useless in an operational environment.

@maggu2810
Copy link
Contributor

I assume that the situation (lack of man power etc.) is still the same (see: #1393 (comment), #1393 (comment)).

I am afraid that nobody currently works on improving this situation (enhance logging etc.).

Any volunteer is welcome.

@kgoderis
Copy link
Contributor

kgoderis commented Jun 2, 2016

@maggu2810 @kaikreuzer @R-Edelhoff @chriskn @SJKA I fully understand the lack of manpower/time at hand, let us then please revert to an older version of Xtext in the meantime?

For me it is essential to have Rules/Script working so that I least I can test new code (migration to new scheduler, migration of existing userland Rule engine to Automation Rule Engine, CalDAV server Rule scheduling) against a real environment.

@kaikreuzer
Copy link
Contributor

Did anybody come up with a reproducible scenario that would help to analyze the problem? I mean simply a tweaked demo.rules file from the demo setup, without requiring any further special setup besides the demo installation?

@kgoderis
Copy link
Contributor

kgoderis commented Jun 4, 2016

@kaikreuzer @maggu2810 In the process of setting up a test environment in the IDE, i discovered that exceptions (with the famous "Script interpreter couldn't be obtain") are thrown at simple initialisation statements at the beginning of the .rules files.For example, declaring a global variable like
var Number lowerChargeTreshold = 75
is sufficient, whereas
var Number lowerChargeTreshold
is not bugging

@kaikreuzer
Copy link
Contributor

Ok, I think we are coming closer - this very much sounds like a similar cause as #1575.

@kgoderis
Copy link
Contributor

kgoderis commented Jun 4, 2016

well yes, I have to take back what I wrote as I can not replicate that bit anymore.

in the IDE now, when I have an almost empty .rules things are running fine. I can add additional Rules to the .rules file (while the runtime is running) without a problem. When I now stop the runtime, and start again, I run again into that Exception.

to me it seems that something fishy is going on with respect to variable initialisation. The exception get's thrown (sometimes) at line 61 of the RuleContextHelper:

                evaluationContext.newValue(QualifiedName.create(var.getName()), initialValue);

as if injecting new variables in the context is failing. (this is what I noticed when making there earlier comment on declaring global variables, but again, now I can not replicate it anymore)

This is truly frustrating stuff :-(

@kgoderis
Copy link
Contributor

kgoderis commented Jun 5, 2016

FYI Xtext 2.10.0 is released. Should we now upgrade or downgrade?

@kgoderis
Copy link
Contributor

kgoderis commented Jun 5, 2016

@kaikreuzer @maggu2810 @R-Edelhoff @chriskn @SJKA
It is https://github.com/eclipse/smarthome/blob/master/bundles/model/org.eclipse.smarthome.model.script.runtime/src/org/eclipse/smarthome/model/script/runtime/internal/engine/ScriptImpl.java#L71 that is causing the Exception to be thrown, e.g. the underlying provider (DefaultResourceServiceProvider) is calling injector.getInstance(t) on a com.google.inject.Injector instance to get an IExpressionInterpreter.class instance, and that bit is failing.

I am not a Guice expert at all, but would this mean that the IExpressionInterpreter.class instance is not "bound" to a class implementing this IExpressionInterpreter interface? I can only find https://github.com/eclipse/smarthome/blob/master/bundles/model/org.eclipse.smarthome.model.rule/src/org/eclipse/smarthome/model/rule/RulesRuntimeModule.java#L55 which references ScriptInterpreter.class (https://github.com/eclipse/smarthome/blob/master/bundles/model/org.eclipse.smarthome.model.script/src/org/eclipse/smarthome/model/script/interpreter/ScriptInterpreter.xtend)

@OLibutzki that .xtend file is mentioning you as author, maybe you can enlighten us on what is going on?

Just looking at the history of https://github.com/eclipse/smarthome/commits/master/bundles/model/org.eclipse.smarthome.model.script/src/org/eclipse/smarthome/model/script/interpreter/ScriptInterpreter.xtend : 6449c09#diff-6b629586a07080f73f5c7ee027dc2444 which seems to solve a historical problem but is again changed over by ea70611#diff-6b629586a07080f73f5c7ee027dc2444. Is this the culprit?

@maggu2810
Copy link
Contributor

The commit you mentioned was the bump to Xtext 2.8.4 that has been reverted because of problems. See #732 and #456

Perhaps we can use #947 and move then also to DS at the place you mentioned.

@kgoderis
Copy link
Contributor

kgoderis commented Jun 6, 2016

Ok so what shall we do then?

@kaikreuzer
Copy link
Contributor

I have spend the last days to get the Designer in a usable state again. The latest snapshot builds should work again (at least the Mac version does for me) and it nicely highlights all errors that exist within the rules. And as we can see from the discussions above, many issues seem to be due to invalid rule syntax.

Being the only reproducible example that I was able to find in this thread, I tried this one. I indeed had the script execution error. But at the same time the Designer tells me that it cannot resolve DateTime and that it needs to be imported. Adding a

import org.joda.time.DateTime

at the top of the rule file makes this error marker disappear in the Designer and at the same time the execution error vanishes from the runtime and the rule is nicely executed.

So I'd very much recommend everyone to try out the new Designer build and check your rule syntax with it. If you now can come up with a reproducible example, which does not show any errors in the Designer, I will help on the further analysis as good as I can.

@kgoderis
Copy link
Contributor

kgoderis commented Jun 7, 2016

@kai will do and feed back (the example you mention, at least in my copy of the code, does have the import). At least we then can root out syntax errors

@kgoderis
Copy link
Contributor

kgoderis commented Jun 7, 2016

@kai @maggu2810 Here below are some items flagged by the editor. It would be good to flag them as an issue, or not, (or suggest a solution) with the objective to document these somewhere for other users:

  1. import org.eclipse.smarthome.core.types.UnDefType -> Access restriction: The type UnDefType is not accessible due to restriction on required project config
  2. TeslaTemperature.sendCommand(TeslaTargetPreheatingTemperature.state as DecimalType)-> Ambiguous feature call. The extension methods sendCommand(Item, Number) in BusEvent and
    sendCommand(Item, Command) in BusEvent both match.

3.import org.openhab.core.library.types.* -> The use of wildcard imports is deprecated.

  1. setMasterVolume and affiliated Actions are not supported ?

Apart from that I indeed had one syntax error in my file (a missing ) bracket), and strangely enough that was not flagged by the previous version of the XText parser.

@maggu2810
Copy link
Contributor

This issue gets very long now.

A different behaviour between ESH + the ESH based solutions (e.g. openHAB) and OH1 is perhaps more related to the https://github.com/openhab/openhab-docs/ project.

The bugs that could be solved / found by the Designer are obsolete, too.

WDYT if we close this one and create separate ones, that needs to be fixed?

I added a label "Rule" which we can use to tag that issues.
See: https://github.com/eclipse/smarthome/issues?q=is%3Aopen+is%3Aissue+label%3ARule

@maggu2810 maggu2810 added the Rule label Jun 15, 2016
@kaikreuzer
Copy link
Contributor

@kgoderis:

  1. Thanks, this should be fixed with Include core type package for rules and scripts #1703
  2. You should do either TeslaTemperature.send(TeslaTargetPreheatingTemperature.state as DecimalType) for a specific type (here DecimalType) or TeslaTemperature.sendCommand(TeslaTargetPreheatingTemperature.state as Command) for a generic Command (note that this now only works because of (1) above).
  3. Correct, no wildcards anymore, but Xtext offers a quick fix by itself.
  4. Yes, the audio actions are not part of ESH (due to license issues), but of OH2-core. Therefore the know limitation Introduce a mechanism to easily register action method signatures #997 applies (i.e. error marker in Designer, but still works at runtime).

As @maggu2810 suggested, I am closing this issue and we track the more specific issues.

@kgoderis
Copy link
Contributor

@kaikreuzer

Yes, the audio actions are not part of ESH (due to license issues), but of OH2-core. Therefore the know limitation #997 applies (i.e. error marker in Designer, but still works at runtime).

Considering:

rule "openHAB Host Volume Control"
    when
        Item openHABHostVolume received command

    then
        logInfo("org.openhab","Currently openHAB host volume is set to "+getMasterVolume() * 100)
end

the output of :

openhab> smarthome:send openHABHostVolume 65
Command has been sent successfully.

is

2016-07-14 19:48:00.945 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'openHAB Host Volume Control': null

Sound to me that the Action is not working (latest snapshot) (there are no import statements, as per documentation)

@kaikreuzer
Copy link
Contributor

@kgoderis I can reproduce this.

Checking

openhab> bundle:services 198

openHAB 1.x Compatibility Layer (198) provides:
-----------------------------------------------
[org.openhab.core.scriptengine.action.ActionService]
[org.eclipse.smarthome.core.items.ItemFactory]
[org.osgi.service.event.EventHandler, org.eclipse.smarthome.core.events.EventSubscriber]
[org.openhab.core.events.EventPublisher]
[org.openhab.core.items.ItemRegistry, org.openhab.ui.items.ItemUIRegistry]
[org.eclipse.smarthome.model.script.engine.action.ActionService]
[org.eclipse.smarthome.core.autoupdate.AutoUpdateBindingConfigProvider]
[org.eclipse.smarthome.core.persistence.PersistenceService]
[org.eclipse.smarthome.ui.chart.ChartProvider]

I see that the audio action is not registered as a service - so that is some issue in the compat bundle. As I am anyhow refactoring the whole audio stuff right now, give me a few days and I will make sure that it works again in the new version.

@igorrobertifoc
Copy link

Hello, I have:

2016-09-04 17:21:51.105 [INFO ] [el.core.internal.ModelRepositoryImpl] - Refreshing model 'test.rules'
2016-09-04 17:22:04.100 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'Voice': Script interpreter couldn't be obtain

For the first day it was working, then they give this error.

`
rule Voice control
when
Item VoiceCommand received command
then
var String command = receivedCommand.toString.toLowerCase

if (command.contains("luce relax") {
    Scena.sendCommand(1)
}
if (command.contains("luce lettura") {
    Scena.sendCommand(2)
}
if (command.contains("accendi luce") {
    Scena.sendCommand(0)
}
if (command.contains("spegni luce") {
    Scena.sendCommand(4)
}   

end
`

@mdeneen
Copy link

mdeneen commented Sep 12, 2016

I also receive this when using the Pushover service. The rule itself is very simple and is really just in place to give me confidence in the sensor:

rule "notifyGarage"
when
        Item zwave_device_6c398668_node3_sensor_binary changed
        pushover("Door state is " + zwave_device_6c398668_node3_sensor_binary.state, "phone", 0)
end

and the error:

2016-09-12 09:06:37.701 [ERROR] [.script.engine.ScriptExecutionThread] - Error during the execution of rule 'notifyGarage': Script interpreter couldn't be obtain

It seems to work fine for the first day or so, and then stops functioning.

@jwveldhuis
Copy link

@mdeneen looks like you are missing the 'then' in the rule?

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

No branches or pull requests