openHAB 3.0 Milestone 2 discussion

I tried to install wrapper service on win10. It does not work. Same error what I have seen in early stages.

runtimeInfo:
  version: 3.0.0
  buildString: "Build #2005"
locale: hu_HU
systemInfo:
  configFolder: C:\Openhab3\conf
  userdataFolder: C:\Openhab3\userdata
  logFolder: C:\Openhab3\userdata\logs
  javaVersion: 11.0.8
  javaVendor: Azul Systems, Inc.
  javaVendorVersion: Zulu11.41+23-CA
  osName: Windows 10
  osVersion: "10.0"
  osArchitecture: amd64
  availableProcessors: 4
  freeMemory: 138122832
  totalMemory: 276824064


STATUS | wrapper  | 2020/11/08 08:19:25 | Launching a JVM...
INFO   | jvm 5    | 2020/11/08 08:19:25 | NOTE: Picked up JDK_JAVA_OPTIONS: --add-reads=java.xml=java.logging --add-exports=java.base/org.apache.karaf.specs.locator=java.xml,ALL-UNNAMED --patch-module java.base=lib/endorsed/org.apache.karaf.specs.locator-4.2.7.jar --patch-module java.xml=lib/endorsed/org.apache.karaf.specs.java.xml-4.2.7.jar --add-opens java.base/java.security=ALL-UNNAMED --add-opens java.base/java.net=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.naming/javax.naming.spi=ALL-UNNAMED --add-opens java.rmi/sun.rmi.transport.tcp=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.http=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.https=ALL-UNNAMED --add-exports=java.base/sun.net.www.protocol.jar=ALL-UNNAMED --add-exports=jdk.xml.dom/org.w3c.dom.html=ALL-UNNAMED --add-exports=jdk.naming.rmi/com.sun.jndi.url.rmi=ALL-UNNAMED
INFO   | jvm 5    | 2020/11/08 08:19:25 | WARNING: package org.apache.karaf.specs.locator not in java.base
INFO   | jvm 5    | 2020/11/08 08:19:26 | Error: Could not find or load main class org.apache.karaf.wrapper.internal.service.Main
INFO   | jvm 5    | 2020/11/08 08:19:26 | Caused by: java.lang.NoClassDefFoundError: org/apache/karaf/main/ShutdownCallback
ERROR  | wrapper  | 2020/11/08 08:19:26 | JVM exited while loading the application.
FATAL  | wrapper  | 2020/11/08 08:19:26 | There were 5 failed launches in a row, each lasting less than 300 seconds.  Giving up.
FATAL  | wrapper  | 2020/11/08 08:19:26 |   There may be a configuration problem: please check the logs.
STATUS | wrapper  | 2020/11/08 08:19:27 | <-- Wrapper Stopped


WARN   | wrapper  | 2020/11/08 08:19:03 | Unable to expand environment variable, PATH as it would be longer than the 16384 byte buffer size.

These are the error messages what I get. I has not modified openHAB3-wrapper.conf as it is in the official description. If I modify it even I correct the links to OH3 it does nothing. Could you look at what can be the problem? Currentl I tried snapshot 200g but I’ll try milestone2 as well later. I think both will be the same.

Another issue is that scriptengine factory does not start. It is thrown by an exception.
In a meantime I swapped to milestone 2, cleared catch, tmp etc before restart.

runtimeInfo:
  version: 3.0.0.M2
  buildString: Milestone Build
locale: hu_HU
systemInfo:
  configFolder: C:\Openhab3\conf
  userdataFolder: C:\Openhab3\userdata
  logFolder: C:\Openhab3\userdata\logs
  javaVersion: 11.0.8
  javaVendor: Azul Systems, Inc.
  javaVendorVersion: Zulu11.41+23-CA
  osName: Windows 10
  osVersion: "10.0"
  osArchitecture: amd64
  availableProcessors: 4
  freeMemory: 54370288
  totalMemory: 276824064
2020-11-08 08:31:36.824 [ERROR] [penhab.core.automation.module.script] - bundle org.openhab.core.automation.module.script:3.0.0.202011032329 (134)[org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl(75)] : The removeScriptEngineFactory method has thrown an exception
java.lang.NoClassDefFoundError: Could not initialize class org.openhab.core.automation.module.script.ScriptEngineFactory
	at org.openhab.core.automation.module.script.AbstractScriptEngineFactory.getScriptTypes(AbstractScriptEngineFactory.java:42) ~[?:?]
	at org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl.removeScriptEngineFactory(ScriptEngineManagerImpl.java:88) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
	at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
	at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
	at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.invokeMethod(BaseMethod.java:228) ~[bundleFile:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.access$500(BaseMethod.java:41) ~[bundleFile:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod$Resolved.invoke(BaseMethod.java:664) ~[bundleFile:?]
	at org.apache.felix.scr.impl.inject.methods.BaseMethod.invoke(BaseMethod.java:510) [bundleFile:?]
	at org.apache.felix.scr.impl.inject.methods.BindMethod.invoke(BindMethod.java:42) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.DependencyManager.invokeUnbindMethod(DependencyManager.java:1927) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeUnbindMethod(SingleComponentManager.java:458) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.removedService(DependencyManager.java:382) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.removedService(DependencyManager.java:294) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1242) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerRemoved(ServiceTracker.java:1137) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.untrack(ServiceTracker.java:997) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1176) [bundleFile:?]
	at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:125) [bundleFile:?]
	at org.eclipse.osgi.internal.serviceregistry.FilteredServiceListener.serviceChanged(FilteredServiceListener.java:109) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:920) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEventPrivileged(ServiceRegistry.java:862) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistry.publishServiceEvent(ServiceRegistry.java:801) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.serviceregistry.ServiceRegistrationImpl.unregister(ServiceRegistrationImpl.java:222) [org.eclipse.osgi-3.12.100.jar:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:927) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.unregister(AbstractComponentManager.java:892) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:135) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.unregisterService(AbstractComponentManager.java:969) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.doDeactivate(AbstractComponentManager.java:823) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.deactivateInternal(AbstractComponentManager.java:805) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.AbstractComponentManager.dispose(AbstractComponentManager.java:584) [bundleFile:?]
	at org.apache.felix.scr.impl.manager.ConfigurableComponentHolder.disposeComponents(ConfigurableComponentHolder.java:716) [bundleFile:?]
	at org.apache.felix.scr.impl.BundleComponentActivator.dispose(BundleComponentActivator.java:510) [bundleFile:?]
	at org.apache.felix.scr.impl.Activator.disposeComponents(Activator.java:429) [bundleFile:?]
	at org.apache.felix.scr.impl.Activator.access$300(Activator.java:49) [bundleFile:?]
	at org.apache.felix.scr.impl.Activator$ScrExtension.destroy(Activator.java:292) [bundleFile:?]
	at org.apache.felix.scr.impl.AbstractExtender$1.run(AbstractExtender.java:216) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at org.apache.felix.scr.impl.AbstractExtender.destroyExtension(AbstractExtender.java:238) [bundleFile:?]
	at org.apache.felix.scr.impl.AbstractExtender.bundleChanged(AbstractExtender.java:132) [bundleFile:?]
	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:168) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.container.Module.publishEvent(Module.java:476) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.container.Module.doStop(Module.java:634) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.container.Module.stop(Module.java:498) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.decStartLevel(ModuleContainer.java:1675) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1594) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.container.SystemModule.stopWorker(SystemModule.java:270) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule.stopWorker(EquinoxBundle.java:147) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.container.Module.doStop(Module.java:636) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.container.Module.stop(Module.java:498) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:202) [org.eclipse.osgi-3.12.100.jar:?]
	at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:165) [org.eclipse.osgi-3.12.100.jar:?]
	at java.lang.Thread.run(Thread.java:834) [?:?]

2020-11-08 08:31:36.824 [ERROR] [penhab.core.automation.module.script] - bundle org.openhab.core.automation.module.script:3.0.0.202011032329 (134)[org.openhab.core.automation.module.script.internal.provider.ScriptModuleTypeProvider(80)] : The unsetScriptEngineFactory method has thrown an exception
java.lang.NoClassDefFoundError: Could not initialize class org.openhab.core.automation.module.script.ScriptEngineFactory
2020-11-08 08:31:36.824 [ERROR] [penhab.core.automation.module.script] - bundle org.openhab.core.automation.module.script:3.0.0.202011032329 (134)[org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl(75)] : The removeScriptEngineFactory method has thrown an exception
java.lang.NoClassDefFoundError: Could not initialize class org.openhab.core.automation.module.script.ScriptEngineFactory
2020-11-08 08:31:36.824 [ERROR] [penhab.core.automation.module.script] - bundle org.openhab.core.automation.module.script:3.0.0.202011032329 (134)[org.openhab.core.automation.module.script.internal.provider.ScriptModuleTypeProvider(80)] : The unsetScriptEngineFactory method has thrown an exception
java.lang.NoClassDefFoundError: Could not initialize class org.openhab.core.automation.module.script.ScriptEngineFactory
2020-11-08 08:36:41.406 [ERROR] [penhab.core.automation.module.script] - bundle org.openhab.core.automation.module.script:3.0.0.M2 (134)[org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl(163)] : The addScriptEngineFactory method has thrown an exception
java.lang.NoClassDefFoundError: javax/script/ScriptEngineFactory
2020-11-08 08:36:41.426 [ERROR] [penhab.core.automation.module.script] - bundle org.openhab.core.automation.module.script:3.0.0.M2 (134)[org.openhab.core.automation.module.script.internal.ScriptEngineManagerImpl(163)] : The addScriptEngineFactory method has thrown an exception
java.lang.NoClassDefFoundError: Could not initialize class org.openhab.core.automation.module.script.ScriptEngineFactory
2020-11-08 08:36:41.512 [ERROR] [penhab.core.automation.module.script] - bundle org.openhab.core.automation.module.script:3.0.0.M2 (134)[org.openhab.core.automation.module.script.internal.provider.ScriptModuleTypeProvider(168)] : The setScriptEngineFactory method has thrown an exception
java.lang.NoClassDefFoundError: Could not initialize class org.openhab.core.automation.module.script.ScriptEngineFactory
2020-11-08 08:36:41.520 [ERROR] [penhab.core.automation.module.script] - bundle org.openhab.core.automation.module.script:3.0.0.M2 (134)[org.openhab.core.automation.module.script.internal.provider.ScriptModuleTypeProvider(168)] : The setScriptEngineFactory method has thrown an exception
java.lang.NoClassDefFoundError: Could not initialize class org.openhab.core.automation.module.script.ScriptEngineFactory

@mstormi - FYI I don’t know if this helps but I was able to install an addon in the karaf console using feature:install. After that I was able to install bindings through the UI.

Were you ever able to get this error resolved?

Problem with MergeList /var/lib/apt/lists/openhab.jfrog.io_openhab_openhab-linuxpkg_dists_testing_main_binary-i386_Packages

Running Ubuntu 18.04, with Java 11 installed. But when attempting to install the testing main of OH 3 via:

sudo apt-get update

I get the above error. Did you get this resolved? Anybody else with any tips?

Thanks in advance!

No. also no tips. All other repositories work also openHAB unstable works. Deleting and readding the repo doesn’t help nor do all the tricks on stackoverflow…

Disregard – looks like I didn’t properly remove the testing package. After doing that, the unstable looks to be installing now. Still not sure why I cannot install the testing package, but we’ll see how unstable works.

Boy, I can’t even get the unstable / snapshot release to work. Same damn error. Following the instructions from https://www.openhab.org/docs/installation/linux.html#package-repository-installation and here: Guide: Installing and testing OH3 snapshots/milestones using APT and YUM
Really stumped!!

1 Like

As I’m migrating over my rules from OH2 to OH3 I’ve run into an issue with a library that I use in a few places. Specifically: “org.eclipse.smarthome.model.script.ScriptServiceUtil”. I use this to access items as I roll through a group looking at statuses. For example, I would use it as: “ScriptServiceUtil.getItemRegistry.getItem(l.name.toString).state.toString()”.

Unfortnately now I get an error of: “Script execution of rule with UID ‘thingstate-2’ failed: The name ‘ScriptServiceUtil’ cannot be resolved to an item or type; line 87, column 60, length 17” when the rule runs. I’m assuming that the problem is that I’m referencing org.eclipse.smarthome which I believe is now changed. Can someone point me to the direction of the proper location?

EDIT: For anyone looking, use “org.openhab.core.model.script.ScriptServiceUtil”

3 Likes

The eclipse smarthome pathing has been completely removed from OH3.

To be precise, it had been renamed, so now it is called

org.openhab.core.model.script.ScriptServiceUtil

Thanks y’all!

Next question, why did this break executeCommandLine between OH2 and OH 3:

2020-11-08 22:00:41.584 [WARN ] [rg.openhab.core.io.net.exec.ExecUtil] - Error occurred when executing commandLine '[/usr/bin/curl -s -X GET 'http://removed:8060/query/device-info’]’
java.io.IOException: Cannot run program “/usr/bin/curl -s -X GET ‘http://removed:8060/query/device-info’”: error=2, No such file or directory

For reference, when I copy/paste the curl line at a bash prompt on the openhab user it works just fine.

Try putting the command into a shell script & run that, executeCommandLine has no shell environment.

As mentioned earlier in this thread, executeCommandLine() has a new syntax in OH3


I’ve just added this to the notice -

1 Like

Forgive the ignorance, what am I doing wrong here with the new syntax?

var String deviceinfo = executeCommandLine(Duration.ofSeconds(5),"/usr/bin/curl","-s","-X",“GET”,"’",url,“query/device-info’”)

I’ve tried with the ’ escaped and non escaped. All that I get back is null.

This looks like its going to produce something like
... ' somestuff query/device-info’
which is maybe not what you wanted.
If you want to build a string without spaces, do that first

var xx = "'" + url +  "query/device-info’"
executeCommandLine( ... "GET", xx)

Draft PR to add expire as a core feature was openend 10 hours ago

5 Likes

Also need to make sure to Validate JSON data… this tool may help https://codebeautify.org/jsonvalidator

1 Like

I tend to use https://jsonlint.com/

1 Like

Still getting a null back. I dumped the deviceinfourl out to the log file and it looks fine. I ran the curl script manually and it returns no issues.

    var String url = ""
    var String deviceinfourl = ""

            url = s.get(1)
            deviceinfourl = "'" + url + "query/device-info'"
            var String deviceinfo = executeCommandLine(Duration.ofSeconds(5),"curl","-s","-X","GET",deviceinfourl)

If you are using a language other than Rules DSL, the item registry is available as the variable ir so you can just use ir.getItem(I.name). If you are using the image registry to get at an Item’s state you can use items: items[I.name].

There is no reason to call toString on I.name, name is already a String.

When you’re ready, we’d like to see your logs too. Why is this always such hard work. All of us make typos we can’t spot etc.

1 Like