Eclipse: beginner problem

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

JavaSE-1.8

You need to be a bit more precise.

That seems to be a good point to start further research. Eclipse said it was JavaSE-1.8, but it wasn’t: I realized that it pointed to /usr/lib64/jvm/java-openjdk, which again pointed to a java-11-openjdk installation.
I installed 1.8 and added a “Alternate JRE” to point to the directory where 1.8 has been installed. I set the “JRE home” to “/usr/lib64/jvm/java-1.8.0-openjdk-1.8.0”. However, when I selected an “Alternate JRE” it also wanted an executable, and suggested javaw. This isn’t available in the installation of 1.8.0 though, so I replaced it with “java”. Still no success…
Is there a way to set a “debug mode” in Eclipse? “Debug OSGi” doesn’t add any information at all to the console…

I don’t understand it. In Eclipse, I go to “Run Configurations” and change the Runtime JRE in the JRE tab from “Project Execution Environment” to the JRE I desire. However, whatever I write in there (and yes, I do save it), the Console still shows the default JRE of Project Execution Environment…

Looks like you’re running linux but which distro and on what kind of hardware?

What does java -version output?

Do you have specific reason to use Java 11? Can you set your OS default java to version 8? Just thinking that if you run eclipse itself on version 11 but try starting a debug session with 8 it might not work.

1 Like

@gitMiguel, that was exactly like you wrote. I uninstalled Java 11 (I don’t remember why I installed it), reinstalled Eclipse and everything worked smoothly. Phantastic, thank you very much for your help!

1 Like

I was successful in compiling everything, running OpenHAB on my desktop with all the bundles I wanted, but I have a problem that might happen because I am missing a concept of Eclipse: when I import a binding in Eclipse and modify it (eg by enhancing a logger.debug message), I resolve the dependencies and run it (with the Debug OSGi button). Howewer, it still uses the original version of the binding, that is, my modifications in the logger.debug message is not used. It still uses the original version.
The binding runs well, so I did well with the pom.xml and the including the binding in the “Run Requirements”, but how do I tell Eclipse to use the version I modified and not the original one?

Have you done a build since making changes?

Has the binding you modified the same version in the pom xml as the binding you imported in the demo pom.xml?