Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compat layer is missing Jackson packages #614

Closed
msw1970 opened this issue Feb 10, 2019 · 12 comments · Fixed by #616
Closed

Compat layer is missing Jackson packages #614

msw1970 opened this issue Feb 10, 2019 · 12 comments · Fixed by #616

Comments

@msw1970
Copy link

msw1970 commented Feb 10, 2019

Current Behavior

When installing the plex binding on snapshot #1519 the following error is seen in the openhab.log

2019-02-10 20:07:31.204 [ERROR] [core.karaf.internal.FeatureInstaller] - Failed installing 'openhab-binding-plex1': Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=openhab-binding-plex1; type=karaf.feature; version="[1.14.0.SNAPSHOT,1.14.0.SNAPSHOT]"; filter:="(&(osgi.identity=openhab-binding-plex1)(type=karaf.feature)(version>=1.14.0.SNAPSHOT)(version<=1.14.0.SNAPSHOT))" [caused by: Unable to resolve openhab-binding-plex1/1.14.0.SNAPSHOT: missing requirement [openhab-binding-plex1/1.14.0.SNAPSHOT] osgi.identity; osgi.identity=org.openhab.binding.plex; type=osgi.bundle; version="[1.14.0.201902070308,1.14.0.201902070308]"; resolution:=mandatory [caused by: Unable to resolve org.openhab.binding.plex/1.14.0.201902070308: missing requirement [org.openhab.binding.plex/1.14.0.201902070308] osgi.wiring.package; filter:="(osgi.wiring.package=org.codehaus.jackson)"]]

If the plex binding is installed and working prior to installing the snapshot then openhab fails to install any of the actions, bindings, UI's or persistence features until you remove plex from /var/lib/openhab2/config/org/openhab/addons.config

There are also reports of other bindings such as pilight also failing to install on this snapshot build

Steps to Reproduce (for Bugs)

  1. Install latest snapshot
  2. Install plex binding (binding-plex1 - 1.14.0.SNAPSHOT)
@msw1970
Copy link
Author

msw1970 commented Feb 15, 2019

To add.. This issue persists through snapshot #1522

@ccutrer
Copy link
Contributor

ccutrer commented Feb 16, 2019

I'm having the same problem, but with openhab-binding-myq1 on snapshot 1522

@foxejoe
Copy link

foxejoe commented Feb 17, 2019

same problem (Plex) on snapshot#1524

@GitSchorsch
Copy link

at least with pilight still persists in snapshot #1525

@GitSchorsch
Copy link

still persists in snapshot #1535

@wborn
Copy link
Member

wborn commented Feb 25, 2019

It looks like the org.openhab.core.compat1x bundle no longer exports the Jackson packages which causes the installation of these openHAB 1 bundles to fail.

Should these packages still be exported by that bundle @maggu2810?

Plex bundle requirements in 2.4.0

org.openhab.binding.plex_1.13.0 [202] requires:
-----------------------------------------------
osgi.wiring.package; (osgi.wiring.package=javax.xml.bind) resolved by:
   osgi.wiring.package; javax.xml.bind 2.2.1 from org.eclipse.osgi_3.12.100.v20180210-1608 [0]
osgi.wiring.package; (osgi.wiring.package=javax.xml.bind.annotation) resolved by:
   osgi.wiring.package; javax.xml.bind.annotation 2.2.1 from org.eclipse.osgi_3.12.100.v20180210-1608 [0]
osgi.wiring.package; (osgi.wiring.package=javax.xml.bind.annotation.adapters) resolved by:
   osgi.wiring.package; javax.xml.bind.annotation.adapters 2.2.1 from org.eclipse.osgi_3.12.100.v20180210-1608 [0]
osgi.wiring.package; (osgi.wiring.package=org.apache.commons.lang) resolved by:
   osgi.wiring.package; org.apache.commons.lang 2.6.0 from org.apache.commons.lang_2.6.0 [38]
osgi.wiring.package; (osgi.wiring.package=org.codehaus.jackson) resolved by:
   osgi.wiring.package; org.codehaus.jackson 0.0.0 from org.openhab.core.compat1x_2.4.0 [203]
osgi.wiring.package; (osgi.wiring.package=org.codehaus.jackson.annotate) resolved by:
   osgi.wiring.package; org.codehaus.jackson.annotate 0.0.0 from org.openhab.core.compat1x_2.4.0 [203]
osgi.wiring.package; (osgi.wiring.package=org.codehaus.jackson.map) resolved by:
   osgi.wiring.package; org.codehaus.jackson.map 0.0.0 from org.openhab.core.compat1x_2.4.0 [203]
osgi.wiring.package; (osgi.wiring.package=org.codehaus.jackson.map.annotate) resolved by:
   osgi.wiring.package; org.codehaus.jackson.map.annotate 0.0.0 from org.openhab.core.compat1x_2.4.0 [203]
osgi.wiring.package; (osgi.wiring.package=org.openhab.core.binding) resolved by:
   osgi.wiring.package; org.openhab.core.binding 0.0.0 from org.openhab.core.compat1x_2.4.0 [203]
osgi.wiring.package; (osgi.wiring.package=org.openhab.core.events) resolved by:
   osgi.wiring.package; org.openhab.core.events 0.0.0 from org.openhab.core.compat1x_2.4.0 [203]
osgi.wiring.package; (osgi.wiring.package=org.openhab.core.items) resolved by:
   osgi.wiring.package; org.openhab.core.items 0.0.0 from org.openhab.core.compat1x_2.4.0 [203]
osgi.wiring.package; (osgi.wiring.package=org.openhab.core.library.items) resolved by:
   osgi.wiring.package; org.openhab.core.library.items 0.0.0 from org.openhab.core.compat1x_2.4.0 [203]
osgi.wiring.package; (osgi.wiring.package=org.openhab.core.library.types) resolved by:
   osgi.wiring.package; org.openhab.core.library.types 0.0.0 from org.openhab.core.compat1x_2.4.0 [203]
osgi.wiring.package; (osgi.wiring.package=org.openhab.core.types) resolved by:
   osgi.wiring.package; org.openhab.core.types 0.0.0 from org.openhab.core.compat1x_2.4.0 [203]
osgi.wiring.package; (osgi.wiring.package=org.openhab.model.item.binding) resolved by:
   osgi.wiring.package; org.openhab.model.item.binding 0.0.0 from org.openhab.core.compat1x_2.4.0 [203]
osgi.wiring.package; (osgi.wiring.package=org.osgi.framework) resolved by:
   osgi.wiring.package; org.osgi.framework 1.8.0 from org.eclipse.osgi_3.12.100.v20180210-1608 [0]
osgi.wiring.package; (osgi.wiring.package=org.osgi.service.cm) resolved by:
   osgi.wiring.package; org.osgi.service.cm 1.6.0 from org.apache.felix.configadmin_1.9.4 [9]
osgi.wiring.package; (osgi.wiring.package=org.osgi.service.component) resolved by:
   osgi.wiring.package; org.osgi.service.component 1.4.0 from org.apache.felix.scr_2.1.2 [39]
osgi.wiring.package; (osgi.wiring.package=org.osgi.service.event) resolved by:
   osgi.wiring.package; org.osgi.service.event 1.4.0 from org.apache.karaf.services.eventadmin_4.2.1 [3]
osgi.wiring.package; (osgi.wiring.package=org.slf4j) resolved by:
   osgi.wiring.package; org.slf4j 1.7.25 from org.ops4j.pax.logging.pax-logging-api_1.10.1 [6]
osgi.ee; (&(osgi.ee=JavaSE)(version=1.7)) resolved by:
   osgi.ee; JavaSE [1.0.0, 1.1.0, 1.2.0, 1.3.0, 1.4.0, 1.5.0, 1.6.0, 1.7.0, 1.8.0] from org.eclipse.osgi_3.12.100.v20180210-1608 [0]
service; [org.osgi.service.log.LogService, org.knopflerfish.service.log.LogService, org.ops4j.pax.logging.PaxLoggingService, org.osgi.service.cm.ManagedService] provided by:
   org.ops4j.pax.logging.pax-logging-log4j2_1.10.1 [7]

Jackson package exports in 2.4.0

openhab> feature:install openhab-runtime-compat1x                                                                                                                                                                           
openhab> bundle:list -s | grep compat1x                                                                                                                                                                                     
196 │ Active   │  80 │ 2.4.0                  │ org.openhab.core.compat1x
openhab> package:exports -p org.codehaus.jackson                                                                                                                                                                            
Package Name                           │ Version │ ID  │ Bundle Name
───────────────────────────────────────┼─────────┼─────┼──────────────────────────
org.codehaus.jackson.annotate          │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.format            │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.impl              │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.io                │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.map.annotate      │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.map.deser.impl    │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.map.deser.std     │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.map.deser         │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.map.exc           │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.map.ext           │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.map.introspect    │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.map.jsontype.impl │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.map.jsontype      │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.map.module        │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.map.ser.impl      │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.map.ser.std       │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.map.ser           │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.map.type          │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.map.util          │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.map               │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.node              │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.schema            │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.sym               │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.type              │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson.util              │ 0.0.0   │ 196 │ org.openhab.core.compat1x
org.codehaus.jackson                   │ 0.0.0   │ 196 │ org.openhab.core.compat1x
openhab>

Jackson package exports in 2.5.0-SNAPSHOT

openhab> feature:install openhab-runtime-compat1x                                                                                                                                                                           
openhab> bundle:list -s | grep compat1x
203 │ Active │  80 │ 2.5.0.201902220308    │ org.openhab.core.compat1x
openhab> package:exports -p org.codehaus.jackson                                                                                                                                                                            
Package Name │ Version │ ID │ Bundle Name
─────────────┼─────────┼────┼────────────
openhab>                                

@maggu2810
Copy link
Contributor

plex needs Jackson and Jackson has been provided by compat1x before...

I see different options:

  1. The plex feature installs the Jackson bundle (dependency=true) itself
  2. The compat1x feature installs the Jackson bundle, because Jackson has been previously bundled by the compat1x OSGi bundle.
  3. The compat1x bundle bundles the Jackson one again.

IMHO the last one should only be used if there is no other option.
Perhaps the second one would be the simplest one if other bundles using the compat1x feature depends on Jackson, too.

@wborn
Copy link
Member

wborn commented Feb 25, 2019

I think option 2 would be the best:

  • AFAIK compat1x is all about making sure OH1 bundles work with minimum effort
  • It causes less issues for OH1 bundles which don't have a feature defined (including those that aren't in OH repo's)

WDYT @kaikreuzer ?

@kaikreuzer
Copy link
Member

I was just confused why this issue is at openhab2-addons? We are talking about 1.x binding, right?
In that case, option 2 sounds just fine (although I am not clear how/why that got lost? Is it because of the bnd change that now does not package it anymore in the compat bundle?).

@wborn
Copy link
Member

wborn commented Feb 28, 2019

We are talking about 1.x binding, right?

That's right. It would be better if the issue were transferred to the openhab1-addons tracker.

@kaikreuzer kaikreuzer transferred this issue from openhab/openhab-addons Mar 1, 2019
@kaikreuzer kaikreuzer changed the title [plex] Plex binding cannot be installed with snapshot #1519 Compat layer is missing Jackson packages Mar 1, 2019
@kaikreuzer
Copy link
Member

I've actually transferred it to openhab-core as this is where the bug really is.

@wborn
Copy link
Member

wborn commented Mar 2, 2019

With build 1544 which contains the fix it all works well again. Thanks a lot @maggu2810. 👍

openhab> bundle:list -s | grep binding                                                                                                                                                           
137 │ Active │  80 │ 2.5.0.201903020308    │ org.openhab.core.binding.xml
212 │ Active │  80 │ 1.14.0.201903020308   │ org.openhab.binding.plex
214 │ Active │  80 │ 1.14.0.201903020308   │ org.openhab.binding.mqttitude
216 │ Active │  80 │ 1.14.0.201903020308   │ org.openhab.binding.pilight
217 │ Active │  80 │ 1.14.0.201903020308   │ org.openhab.binding.myq

openhab> package:exports -p org.codehaus.jackson
Package Name                           │ Version │ ID  │ Bundle Name
───────────────────────────────────────┼─────────┼─────┼───────────────────
org.codehaus.jackson.annotate          │ 1.9.2   │ 206 │ jackson-core-asl
org.codehaus.jackson.format            │ 1.9.2   │ 206 │ jackson-core-asl
org.codehaus.jackson.impl              │ 1.9.2   │ 206 │ jackson-core-asl
org.codehaus.jackson.io                │ 1.9.2   │ 206 │ jackson-core-asl
org.codehaus.jackson.map.annotate      │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.map.deser.impl    │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.map.deser.std     │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.map.deser         │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.map.exc           │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.map.introspect    │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.map.jsontype.impl │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.map.jsontype      │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.map.module        │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.map.ser.impl      │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.map.ser.std       │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.map.ser           │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.map.type          │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.map.util          │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.map               │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.node              │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.schema            │ 1.9.2   │ 207 │ jackson-mapper-asl
org.codehaus.jackson.sym               │ 1.9.2   │ 206 │ jackson-core-asl
org.codehaus.jackson.type              │ 1.9.2   │ 206 │ jackson-core-asl
org.codehaus.jackson.util              │ 1.9.2   │ 206 │ jackson-core-asl
org.codehaus.jackson                   │ 1.9.2   │ 206 │ jackson-core-asl

splatch pushed a commit to ConnectorIO/copybara-hab-core that referenced this issue Jul 11, 2023
Fixes: openhab#614

Signed-off-by: Markus Rathgeb <maggu2810@gmail.com>
GitOrigin-RevId: 58d73f9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants