Eclipse: beginner problem

I tried using Eclipse already several times. Since it always generated errors while compiling, I decided to retry another time when the sources have been settled.
Now they are, and I retried. With the current version of OpenHAB, it still generates errors. If I use the master branch (OpenHAB 3) and choose OpenHAB Development and OpenHAB Add-ons, everything goes smoothly including running it, but when I try to access paperui (http://localhost:8080/paperui/ ) it returns a 404. So the server is up, but no contents. Strangely, I don’t find any bundle, and ~/openhab-master/git/openhab-addons/bundles does not contain any subdirectory, as if the add-ons hadn’t been loaded (that would explain why there is no paperui).
What did I wrong?

openHAB 3 is not yet fully functional. I believe people are currently using 2.5.x for addons development.

Indeed, master branch is not to be used for addon development atm.

1 Like

Thank you both, @hmerk and @Bruce_Osborne.
First I had tried 2.5, but it didn’t work, and still doesn’t. It opened a window “Errors in running OSGi Framework” but it had so many errors that both this window and the Console of the Eclipse IDE don’t show the first errors, but just the last ones that don’t help that much.
Sorry for this dumb question; I learned programming in an environment where I entered a compiler instruction at the command line and piped the output into a file or could just modify the Makefile to reach my goal.

I have not (yet) entered this Development world but have been lurking to try and learn.

1 Like

I am very keen to debug and enhance existing bindings, also to give back to the community what I received, but the learning curve of the development platform is quite steep…

Just a stupid question. But did you follow the eclipse ide documentation from the openHAB website?

Not a stupid question, but yes, I tried to follow it as precisely as possible. I didn’t even add any binding to pom.xml because I just wanted to see if I can start a ‘naked’ OpenHAB.

Ok. You should make sure you have for both openhab-distro and openHAB-addons the branch 2.5.x checked out. During eclipse installation this is an option to select, but you can also do a git checkout 2.5.x in both repositories.

1 Like

I am sure I selected 2.5.x in both items. Do you suggest that I checkout the items manually?

If it’s not checkout you might check git status and make sure check out 2.5.x. The master branch is for 3.0 development, which is not compatible with current 2.5

1 Like

My outputs:

git/openhab-addons> git status
Auf Branch 2.5.x
Ihr Branch ist auf demselben Stand wie ‘origin/2.5.x’.
git/openhab-distro> git status
Auf Branch 2.5.x
Ihr Branch ist auf demselben Stand wie ‘origin/2.5.x’.

Now you should be able to import bindings. The URL in the development needs to be precise. It might be http://localhost:8080/paperui/index or try http://localhost:8080/start/index not sure if either must end with/ (not behind a computer right now, so can check)

You mean I should ignore all those errors that come when I “Run OSGi” or “Debug OSGi”? The server runs, at least 8080 is reachable. But neither /paperui/ nor /jpaperui/index nor /start/index work, all result in a 404 (not found). I also didn’t find the regular OpenHAB logfile where eventual errors could be logged. I didn’t change the logging configuration though but as a standard things are logged in OpenHAB.

You should not get errors. And it should log in the eclipse console. What errors do you get?

I get so many errors that the console doesn’t show them all.
One of them is the following:

17:11:54.271 [9a-a11b40f0ce29] ERROR E.Framework.org.openhab.ui.paper:? - FrameworkEvent ERROR
org.osgi.framework.BundleException: Could not resolve module: org.openhab.ui.paper [129]
Unresolved requirement: Import-Package: org.openhab.ui.dashboard
→ Export-Package: org.openhab.ui.dashboard; bundle-symbolic-name=“org.openhab.ui.dashboard”; bundle-version=“2.5.1.202001031055”; version=“2.5.1”
org.openhab.ui.dashboard [127]
Unresolved requirement: Import-Package: org.openhab.core
→ Export-Package: org.openhab.core; bundle-symbolic-name=“org.openhab.core.boot”; bundle-version=“2.5.0”; version=“2.5.0”
org.openhab.core.boot [84]
Unresolved requirement: Import-Package: org.eclipse.smarthome.model.rule.runtime; version=“[2.5.0,3.0.0)”
→ Export-Package: org.eclipse.smarthome.model.rule.runtime; bundle-symbolic-name=“org.openhab.core.model.rule.runtime”; bundle-version=“2.5.0”; version=“2.5.0”
org.openhab.core.model.rule.runtime [108]
Unresolved requirement: Require-Bundle: org.openhab.core.model.rule
→ Bundle-SymbolicName: org.openhab.core.model.rule; bundle-version=“2.5.0”
org.openhab.core.model.rule [107]
Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:=“optional”
Unresolved requirement: Require-Bundle: org.eclipse.emf.mwe2.launch; resolution:=“optional”
Unresolved requirement: Require-Bundle: org.openhab.core.model.lazygen; resolution:=“optional”
Unresolved requirement: Require-Bundle: org.eclipse.xtext.generator; resolution:=“optional”
Unresolved requirement: Import-Package: org.eclipse.smarthome.model.script.engine.action; version=“[2.5.0,3.0.0)”
→ Export-Package: org.eclipse.smarthome.model.script.engine.action; bundle-symbolic-name=“org.openhab.core.model.script”; bundle-version=“2.5.0”; version=“2.5.0”
org.openhab.core.model.script [109]
Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:=“optional”
Unresolved requirement: Require-Bundle: org.eclipse.emf.mwe2.launch; resolution:=“optional”
Unresolved requirement: Require-Bundle: org.openhab.core.model.lazygen; resolution:=“optional”
Unresolved requirement: Require-Bundle: org.eclipse.xtext.generator; resolution:=“optional”
Unresolved requirement: Import-Package: org.eclipse.smarthome.core.ephemeris; version=“[2.5.0,3.0.0)”
→ Export-Package: org.eclipse.smarthome.core.ephemeris; bundle-symbolic-name=“org.openhab.core.ephemeris”; bundle-version=“2.5.0”; version=“2.5.0”
org.openhab.core.ephemeris [90]
Unresolved requirement: Import-Package: de.jollyday.util; version=“[0.5.0,1.0.0)”
→ Export-Package: de.jollyday.util; bundle-symbolic-name=“jollyday”; bundle-version=“0.5.8”; version=“0.5.8”; uses:=“de.jollyday,de.jollyday.config,javax.xml.bind”
jollyday [9]
Unresolved requirement: Import-Package: javax.xml.bind
Unresolved requirement: Import-Package: de.jollyday; version=“[0.5.0,1.0.0)”
→ Export-Package: de.jollyday; bundle-symbolic-name=“jollyday”; bundle-version=“0.5.8”; version=“0.5.8”; uses:=“de.jollyday.datasource,de.jollyday.util”
Unresolved requirement: Require-Bundle: org.eclipse.xtext.xbase; visibility:=“reexport”
→ Bundle-SymbolicName: org.eclipse.xtext.xbase; bundle-version=“2.19.0.v20190902-0952”; singleton:=“true”
org.eclipse.xtext.xbase [54]
Unresolved requirement: Import-Package: com.ibm.icu.text; version=“4.0.0”; resolution:=“optional”
Unresolved requirement: Import-Package: javax.annotation
→ Export-Package: javax.annotation; bundle-symbolic-name=“com.eclipsesource.jaxrs.jersey-all”; bundle-version=“2.22.2”; version=“1.2.0”
com.eclipsesource.jaxrs.jersey-all [3]
Unresolved requirement: Import-Package: javax.activation
Unresolved requirement: Require-Bundle: org.eclipse.xtext.xbase
→ Bundle-SymbolicName: org.eclipse.xtext.xbase; bundle-version=“2.19.0.v20190902-0952”; singleton:=“true”
Unresolved requirement: Import-Package: org.eclipse.smarthome.model.script; version=“[2.5.0,3.0.0)”
→ Export-Package: org.eclipse.smarthome.model.script; bundle-symbolic-name=“org.openhab.core.model.script”; bundle-version=“2.5.0”; version=“2.5.0”; uses:=“org.eclipse.smarthome.core.events,org.eclipse.smarthome.core.items,org.eclipse.smarthome.core.thing,org.eclipse.smarthome.core.thing.binding,org.eclipse.smarthome.model.core,org.eclipse.smarthome.model.script.engine,org.eclipse.smarthome.model.script.engine.action,org.eclipse.smarthome.model.script.parser.antlr.internal,org.eclipse.smarthome.model.script.validation”
Unresolved requirement: Require-Bundle: org.openhab.core.model.script
→ Bundle-SymbolicName: org.openhab.core.model.script; bundle-version=“2.5.0”
Unresolved requirement: Import-Package: org.eclipse.smarthome.model.script; version=“[2.5.0,3.0.0)”
→ Export-Package: org.eclipse.smarthome.model.script; bundle-symbolic-name=“org.openhab.core.model.script”; bundle-version=“2.5.0”; version=“2.5.0”; uses:=“org.eclipse.smarthome.core.events,org.eclipse.smarthome.core.items,org.eclipse.smarthome.core.thing,org.eclipse.smarthome.core.thing.binding,org.eclipse.smarthome.model.core,org.eclipse.smarthome.model.script.engine,org.eclipse.smarthome.model.script.engine.action,org.eclipse.smarthome.model.script.parser.antlr.internal,org.eclipse.smarthome.model.script.validation”
Unresolved requirement: Import-Package: org.eclipse.smarthome.model.script.engine; version=“[2.5.0,3.0.0)”
→ Export-Package: org.eclip47)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1685)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1665)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1627)
at org.eclipse.osgi.container.SystemModule.startWorker(SystemModule.java:267)
at org.eclipse.osgi.container.Module.doStart(Module.java:584)
at org.eclipse.osgi.container.Module.start(Module.java:452)
at org.eclipse.osgi.container.SystemModule.start(SystemModule.java:191)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:431)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:450)
at org.eclipse.osgi.launch.Equinox.start(Equinox.java:118)
at aQute.launcher.Launcher.activate(Launcher.java:463)
at aQute.launcher.Launcher.launch(Launcher.java:334)
at aQute.launcher.Launcher.run(Launcher.java:143)
at aQute.launcher.Launcher.main(Launcher.java:121)
at aQute.launcher.pre.EmbeddedLauncher.executeWithRunPath(EmbeddedLauncher.java:154)
at aQute.launcher.pre.EmbeddedLauncher.findAndExecute(EmbeddedLauncher.java:119)
at aQute.launcher.pre.EmbeddedLauncher.main(EmbeddedLauncher.java:51)
se.smarthome.model.script.engine; bundle-symbolic-name=“org.openhab.core.model.script”; bundle-version=“2.5.0”; version=“2.5.0”; uses:=“org.eclipse.smarthome.core.thing.binding,org.eclipse.smarthome.model.script.engine.action”
Unresolved requirement: Import-Package: org.eclipse.xtext.xbase.interpreter
→ Export-Package: org.eclipse.xtext.xbase.interpreter; bundle-symbolic-name=“org.eclipse.xtext.xbase”; bundle-version=“2.19.0.v20190902-0952”; version=“0.0.0”; x-friends:=“org.eclipse.xtext.purexbase.ui, org.eclipse.xtext.xbase.tests, org.eclipse.xtend.core”
Unresolved requirement: Import-Package: org.eclipse.xtext.xbase
→ Export-Package: org.eclipse.xtext.xbase; bundle-symbolic-name=“org.eclipse.xtext.xbase”; bundle-version=“2.19.0.v20190902-0952”; version=“0.0.0”
Unresolved requirement: Import-Package: org.eclipse.xtext.xbase.interpreter.impl
→ Export-Package: org.eclipse.xtext.xbase.interpreter.impl; bundle-symbolic-name=“org.eclipse.xtext.xbase”; bundle-version=“2.19.0.v20190902-0952”; version=“0.0.0”; x-friends:=“org.eclipse.xtext.purexbase.ui, org.eclipse.xtext.xbase.tests”

at org.eclipse.osgi.container.Module.start(Module.java:447)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1685)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1665)
at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1627)
at org.eclipse.osgi.container.SystemModule.startWorker(SystemModule.java:267)
at org.eclipse.osgi.container.Module.doStart(Module.java:584)
at org.eclipse.osgi.container.Module.start(Module.java:452)
at org.eclipse.osgi.container.SystemModule.start(SystemModule.java:191)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:431)
at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:450)
at org.eclipse.osgi.launch.Equinox.start(Equinox.java:118)
at aQute.launcher.Launcher.activate(Launcher.java:463)
at aQute.launcher.Launcher.launch(Launcher.java:334)
at aQute.launcher.Launcher.run(Launcher.java:143)
at aQute.launcher.Launcher.main(Launcher.java:121)
at aQute.launcher.pre.EmbeddedLauncher.executeWithRunPath(EmbeddedLauncher.java:154)
at aQute.launcher.pre.EmbeddedLauncher.findAndExecute(EmbeddedLauncher.java:119)
at aQute.launcher.pre.EmbeddedLauncher.main(EmbeddedLauncher.java:51)

org.openhab.ui.paper, one of the modules it isn’t able to find, is listed in the “Run Requirements”, and the window that appears when I klick on “Resolve” doesn’t show anything particular or an error, and also lists org.openhab.ui.paper (I didn’t add any “Optional Resources” though).

I do not know if this applies, but there was an issue in 2.5.0 addons corrected in 2.5.1. They added the dashboard-ui to addons, if I recall correctly

I tried to add dashboard-ui, but it didn’t help. And if you said ‘recently’, probably it is anyway corrected meanwhile, because if I understood it right, the sources/settings are downloaded daily.

What’s your Java version?

I’m also experiencing a “beginner problem” after following the latest Eclipse IDE Setup

Note: I tried using multiple versions of Eclipse: the “latest release” 2019-12, 2019-09 and 2019-06 (as shown in the screenshots from the IDE Setup page). Switching versions didn’t solve my problem :frowning:

After importing my binding into Eclipse, I’m getting an error in pom.xml (on the opening <parent> tag):

Description Resource Path Location Type
Plugin execution not covered by lifecycle configuration: com.diffplug.spotless:spotless-maven-plugin:1.24.3:check (execution: codestyle_check, phase: initialize) pom.xml /org.openhab.binding.unifi line 5 Maven Project Build Lifecycle Mapping Problem

Searching the forums I found someone else had a similar problem:

However the steps in that thread didn’t resolve my issue :frowning:

Maybe one of the Eclipse / IDE experts now what’s happening here?

Thanks in advance!

Matthew