eclipse-archived / smarthome

Eclipse SmartHome™ project
https://www.eclipse.org/smarthome/
Eclipse Public License 2.0
862 stars 783 forks source link

Multiple / different GSON / Guava versions #4440

Open martinvw opened 6 years ago

martinvw commented 6 years ago

After a comment of @wborn I looked into my local configuration why I had errors which he did not.

Somehow his installation favored GSON 2.7 while mine used GSON 2.3.1.

Looking at the line numbers of your stacktrace I think you were testing with openHAB 2.1.0?

openHAB 2.1.0 uses Gson 2.3.1 (2014-11-20) which only supports a very simple ISO 8601 format:

  private static DateFormat buildIso8601Format() {
    DateFormat iso8601Format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'", Locale.US);
    iso8601Format.setTimeZone(TimeZone.getTimeZone("UTC"));
    return iso8601Format;
  }

So it will fail to parse the milliseconds part of the timestamps, e.g.:

 "last_connection": "2017-09-30T11:45:55.599Z",

A better ISO 8601 date type adapter was added in Gson 2.4.

I was testing with openHAB 2.2.0-SNAPSHOT which is using Gson 2.7.0 (2016-06-14) and also supports more ISO 8601 timestamp variants.

After that I look into it and found out this:

If I download the current openHAB snapshot and inflate that, it shows:

   ...
   creating: runtime/system/com/google/
   creating: runtime/system/com/google/guava/
   creating: runtime/system/com/google/guava/guava/
   creating: runtime/system/com/google/guava/guava/15.0/
   creating: runtime/system/com/google/guava/guava/18.0/
   creating: runtime/system/com/google/code/
   creating: runtime/system/com/google/code/findbugs/
   creating: runtime/system/com/google/code/findbugs/annotations/
   creating: runtime/system/com/google/code/findbugs/annotations/2.0.1/
   creating: runtime/system/com/google/code/gson/
   creating: runtime/system/com/google/code/gson/gson/
   creating: runtime/system/com/google/code/gson/gson/2.3.1/
   creating: runtime/system/com/google/code/gson/gson/2.7/
   ...

So we package multiple versions of GSON and Guava and maybe others which can will lead to different runtime behaviour for different people, is this a mistake or is this just an expected / accepted side effect?

Both version come from https://github.com/eclipse/smarthome/blob/master/features/karaf/esh-tp/src/main/feature/feature.xml

maggu2810 commented 6 years ago

The respective bundles are used in the Karaf feature with respect to dependency="true". So if you don't need the higher version you can stay at the old version. This has been used previously for Guava, because the old version is much smaller then the newer one and we would like to stay to the smaller one as long as we don't need the higher version.

This shouldn't be any problem as long as both version work as expected.

So if there is something buggy in one of both Guava or GSON versions, we should drop them.

If you feel that one version of Guava or GSON does not work correctly, please create an issue and we could bump it.

martinvw commented 6 years ago

This has been used previously for Guava, because the old version is much smaller then the newer one and we would like to stay to the smaller one as long as we don't need the higher version.

But the result (for the openHAB distribution) is that you always get both the big one and small one. So I think that at least for openHAB we cause more problems than we solve.

If you feel that one version of Guava or GSON does not work correctly, please create an issue and we could bump it.

Do you prefer a separate issue?

openHAB 2.1.0 uses Gson 2.3.1 (2014-11-20) which only supports a very simple ISO 8601 format:

I think that given the example above, we should get rid of old GSON especially since I believe the LSP4J is enabled by default and already seems to require the new version.

Default:

https://github.com/eclipse/smarthome/blob/master/features/karaf/esh-tp/src/main/feature/feature.xml#L30

LSP4J:

https://github.com/eclipse/smarthome/blob/master/features/karaf/esh-tp/src/main/feature/feature.xml#L220

maggu2810 commented 6 years ago

I think that given the example above, we should get rid of old GSON especially since I believe the LSP4J is enabled by default and already seems to require the new version.

No, it is not enabled by default. It uses dependency="true", so the feature is only installed if require. We force the installation by require the capability esh.tp;feature=lsp4j;version=0.2.1.

It is required by esh-model-lsp (https://github.com/eclipse/smarthome/blob/master/features/karaf/esh-core/src/main/feature/feature.xml#L394) that is not installed for every solution (why should it).

maggu2810 commented 6 years ago

This has been used previously for Guava, because the old version is much smaller then the newer one and we would like to stay to the smaller one as long as we don't need the higher version.

But the result (for the openHAB distribution) is that you always get both the big one and small one. So I think that at least for openHAB we cause more problems than we solve.

If both are installed this is usually the case because someone needs the old and someone the new (e.g. version ranges). Can you deinstall the old one and all feature / bundles could still be resolved?

martinvw commented 6 years ago

But the result (for the openHAB distribution) is that you always get both the big one and small one. So I think that at least for openHAB we cause more problems than we solve.

With this I referred primarily to the download and storage because at least for openHAB both are packaged.

If both are installed this is usually the case because someone needs the old and someone the new (e.g. version ranges). Can you deinstall the old one and all feature / bundles could still be resolved?

@wborn did you install the esh-model-lsp and / or can you check whether your Karaf loaded both of them, I will only be able to check that tonight.

maggu2810 commented 6 years ago

org.eclipse.smarthome.storage.mapdb imports internal Gson packages:

mvn:com.google.code.gson/gson/2.3.1 exports:

    com.google.gson;version=2.3.1,
    com.google.gson.annotations;version=2.3.1,
    com.google.gson.reflect;version=2.3.1,
    com.google.gson.stream;version=2.3.1,
    com.google.gson.internal;version=2.3.1,
    com.google.gson.internal.bind;version=2.3.1

mvn:com.google.code.gson/gson/2.7 exports:

    com.google.gson;uses:="com.google.gson.reflect,com.google.gson.stream";version=2.7.0,
    com.google.gson.annotations;version=2.7.0,
    com.google.gson.reflect;version=2.7.0,
    com.google.gson.stream;version=2.7.0

So, as long as org.eclipse.smarthome.storage.mapdb imports internal Gson stuff it cannot wire against the 2.7 one.

maggu2810 commented 6 years ago

IMHO 20kb is not "much bigger", so bumping Gson and fix our mapdb would be okay for me.

228K    com/google/code/gson/gson/2.7/gson-2.7.jar
208K    com/google/code/gson/gson/2.3.1/gson-2.3.1.jar

But let's wait for comments of the other solution maintainers.

martinvw commented 6 years ago

So, as long as org.eclipse.smarthome.storage.mapdb imports internal Gson stuff it cannot wire against the 2.7 one.

Aha, that is indeed a serious problem, so that could be the next task indeed.

And thanks for looking into it!

kaikreuzer commented 6 years ago

@martinvw In ESH we try to be compatible with other versions where possible, so that we leave most flexibility to the solutions that use ESH. So our minimal requirement should only be raised if we definitely require the features (or bug fixes) of a higher version.

For gson, this does not seem to be the case - it should be possible to write the code in a way that it also works with gson 2.3.1.

Note that it is perfectly fine in OSGi to have the same bundle in different versions - different code might then use a different version.

So, as long as org.eclipse.smarthome.storage.mapdb imports internal Gson stuff it cannot wire against the 2.7 one.

We should probably add an upper version constraint to those imports then (until it is refactored to not use any internal packages anymore).

martinvw commented 6 years ago

For gson, this does not seem to be the case - it should be possible to write the code in a way that it also works with gson 2.3.1.

Yes that is what we did but the problem is that it did not work on my machine but did work at the machine of @wborn, so if it was only @wborn who tested it, we would have found it way too late. My main objection is that it resulted in different behavior for different users using the same version.

kaikreuzer commented 6 years ago

using the same version.

Can you prove that?

martinvw commented 6 years ago

@wborn can you maybe provide a bundle:list then we can compare?

wborn commented 6 years ago

When I was testing it was with a fresh latest greatest openHAB SNAPSHOT instance (my test instances don't last that long). After OH has started I choose the "Standard - RECOMMENDED SETUP". Then I just install the bindings that I need. In that case I was just testing with the Nest binding. So org.eclipse.smarthome.storage.mapdb was not installed.

When I do the same with OH 2.2.0-SNAPSHOT # 1065 only the Gson 2.7.0 bundle is listed, see:

openhab> bundle:list -l                                                                                                                                                                                                    17:43:34
START LEVEL 100 , List Threshold: 50
 ID │ State    │ Lvl │ Version                │ Location
────┼──────────┼─────┼────────────────────────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 15 │ Active   │  80 │ 5.3.1.201602281253     │ mvn:com.eclipsesource.jaxrs/publisher/5.3.1
 16 │ Active   │  80 │ 2.4.5                  │ mvn:com.fasterxml.jackson.core/jackson-annotations/2.4.5
 17 │ Active   │  80 │ 2.4.5                  │ mvn:com.fasterxml.jackson.core/jackson-core/2.4.5
 18 │ Active   │  80 │ 2.4.5                  │ mvn:com.fasterxml.jackson.core/jackson-databind/2.4.5
 19 │ Active   │  80 │ 2.4.5                  │ mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-xml/2.4.5
 20 │ Active   │  80 │ 2.4.5                  │ mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/2.4.5
 21 │ Active   │  80 │ 2.4.5                  │ mvn:com.fasterxml.jackson.module/jackson-module-jaxb-annotations/2.4.5
 22 │ Active   │  80 │ 2.7.0                  │ mvn:com.google.code.gson/gson/2.7
 23 │ Active   │  80 │ 18.0.0                 │ mvn:com.google.guava/guava/18.0
 24 │ Active   │  80 │ 3.0.0.v201312141243    │ mvn:de.maggu2810.p2redist/com.google.inject/3.0.0.v201312141243
 25 │ Active   │  80 │ 1.5.8                  │ mvn:io.swagger/swagger-annotations/1.5.8
 26 │ Active   │  80 │ 3.19.0.GA              │ mvn:org.javassist/javassist/3.19.0-GA
 28 │ Active   │  80 │ 3.5.2                  │ mvn:org.jmdns/jmdns/3.5.2
 31 │ Active   │  80 │ 1.1.0.Final            │ mvn:javax.validation/validation-api/1.1.0.Final
 32 │ Active   │  80 │ 2.0.1                  │ mvn:javax.ws.rs/javax.ws.rs-api/2.0.1
 33 │ Active   │  80 │ 3.2.0.v201101311130    │ mvn:de.maggu2810.p2redist/org.antlr.runtime/3.2.0.v201101311130
 34 │ Active   │  80 │ 3.2.1                  │ mvn:commons-collections/commons-collections/3.2.1
 35 │ Active   │  80 │ 1.1                    │ mvn:org.apache.commons/commons-exec/1.1
 36 │ Active   │  80 │ 2.2.0                  │ mvn:commons-io/commons-io/2.2
 37 │ Active   │  80 │ 2.6                    │ mvn:commons-lang/commons-lang/2.6
 42 │ Active   │  80 │ 4.2.3                  │ mvn:org.apache.httpcomponents/httpclient-osgi/4.2.3
 43 │ Active   │  80 │ 4.2.3                  │ mvn:org.apache.httpcomponents/httpcore-osgi/4.2.3
 49 │ Active   │  80 │ 4.1.2                  │ mvn:org.apache.karaf/org.apache.karaf.event/4.1.2
 68 │ Active   │  80 │ 2.11.0.v20150805-0538  │ mvn:org.eclipse.emf/org.eclipse.emf.common/2.11.0-v20150805-0538
 69 │ Active   │  80 │ 2.11.1.v20150805-0538  │ mvn:org.eclipse.emf/org.eclipse.emf.ecore/2.11.1-v20150805-0538
 70 │ Active   │  80 │ 2.11.1.v20150805-0538  │ mvn:org.eclipse.emf/org.eclipse.emf.ecore.xmi/2.11.1-v20150805-0538
 71 │ Active   │  80 │ 3.8.0.v20160509-1230   │ mvn:org.eclipse.platform/org.eclipse.equinox.common/3.8.0
 72 │ Active   │  80 │ 3.6.100.v20160223-2218 │ mvn:org.eclipse.platform/org.eclipse.equinox.registry/3.6.100
 94 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.core/0.9.0-SNAPSHOT
 95 │ Waiting  │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.discovery/0.9.0-SNAPSHOT
 96 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.dispatch/0.9.0-SNAPSHOT
 97 │ Active   │  75 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.config/org.eclipse.smarthome.config.xml/0.9.0-SNAPSHOT
 98 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.core/org.eclipse.smarthome.core/0.9.0-SNAPSHOT
 99 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.core/org.eclipse.smarthome.core.audio/0.9.0-SNAPSHOT
100 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.core/org.eclipse.smarthome.core.autoupdate/0.9.0-SNAPSHOT
101 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.core/org.eclipse.smarthome.core.binding.xml/0.9.0-SNAPSHOT
102 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.core/org.eclipse.smarthome.core.id/0.9.0-SNAPSHOT
103 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.core/org.eclipse.smarthome.core.persistence/0.9.0-SNAPSHOT
104 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.core/org.eclipse.smarthome.core.scheduler/0.9.0-SNAPSHOT
105 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.core/org.eclipse.smarthome.core.thing/0.9.0-SNAPSHOT
106 │ Active   │  75 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.core/org.eclipse.smarthome.core.thing.xml/0.9.0-SNAPSHOT
107 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.core/org.eclipse.smarthome.core.transform/0.9.0-SNAPSHOT
108 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.core/org.eclipse.smarthome.core.voice/0.9.0-SNAPSHOT
109 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.io/org.eclipse.smarthome.io.console/0.9.0-SNAPSHOT
110 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.io/org.eclipse.smarthome.io.console.karaf/0.9.0-SNAPSHOT
111 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.io/org.eclipse.smarthome.io.javasound/0.9.0-SNAPSHOT
112 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.io/org.eclipse.smarthome.io.monitor/0.9.0-SNAPSHOT
113 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.io/org.eclipse.smarthome.io.net/0.9.0-SNAPSHOT
114 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.io/org.eclipse.smarthome.io.rest/0.9.0-SNAPSHOT
115 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.io/org.eclipse.smarthome.io.rest.core/0.9.0-SNAPSHOT
116 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.io/org.eclipse.smarthome.io.rest.mdns/0.9.0-SNAPSHOT
117 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.io/org.eclipse.smarthome.io.rest.optimize/0.9.0-SNAPSHOT
118 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.io/org.eclipse.smarthome.io.rest.sitemap/0.9.0-SNAPSHOT
119 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.io/org.eclipse.smarthome.io.rest.sse/0.9.0-SNAPSHOT
120 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.io/org.eclipse.smarthome.io.rest.voice/0.9.0-SNAPSHOT
121 │ Waiting  │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.io/org.eclipse.smarthome.io.transport.mdns/0.9.0-SNAPSHOT
122 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.io/org.eclipse.smarthome.io.webaudio/0.9.0-SNAPSHOT
123 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.model/org.eclipse.smarthome.model.core/0.9.0-SNAPSHOT
124 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.model/org.eclipse.smarthome.model.item/0.9.0-SNAPSHOT
125 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.model/org.eclipse.smarthome.model.item.runtime/0.9.0-SNAPSHOT
126 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.model/org.eclipse.smarthome.model.persistence/0.9.0-SNAPSHOT
127 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.model/org.eclipse.smarthome.model.persistence.runtime/0.9.0-SNAPSHOT
128 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.model/org.eclipse.smarthome.model.rule/0.9.0-SNAPSHOT
129 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.model/org.eclipse.smarthome.model.rule.runtime/0.9.0-SNAPSHOT
130 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.model/org.eclipse.smarthome.model.script/0.9.0-SNAPSHOT
131 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.model/org.eclipse.smarthome.model.script.runtime/0.9.0-SNAPSHOT
132 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.model/org.eclipse.smarthome.model.sitemap/0.9.0-SNAPSHOT
133 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.model/org.eclipse.smarthome.model.sitemap.runtime/0.9.0-SNAPSHOT
134 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.model/org.eclipse.smarthome.model.thing/0.9.0-SNAPSHOT
135 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.model/org.eclipse.smarthome.model.thing.runtime/0.9.0-SNAPSHOT
136 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.storage/org.eclipse.smarthome.storage.json/0.9.0-SNAPSHOT
137 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.ui/org.eclipse.smarthome.ui/0.9.0-SNAPSHOT
138 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.ui/org.eclipse.smarthome.ui.icon/0.9.0-SNAPSHOT
139 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.extension.ui.iconset/org.eclipse.smarthome.ui.iconset.classic/0.9.0-SNAPSHOT
140 │ Active   │  80 │ 2.12.0.v20170518-0757  │ mvn:org.eclipse.xtend/org.eclipse.xtend.lib/2.12.0
141 │ Active   │  80 │ 2.12.0.v20170518-0757  │ mvn:org.eclipse.xtend/org.eclipse.xtend.lib.macro/2.12.0
142 │ Active   │  80 │ 2.12.0.v20170518-0959  │ mvn:org.eclipse.xtext/org.eclipse.xtext/2.12.0
143 │ Active   │  80 │ 2.12.0.v20170519-0752  │ mvn:org.eclipse.xtext/org.eclipse.xtext.common.types/2.12.0
144 │ Active   │  80 │ 2.12.0.v20170518-0959  │ mvn:org.eclipse.xtext/org.eclipse.xtext.util/2.12.0
145 │ Active   │  80 │ 2.12.0.v20170519-0752  │ mvn:org.eclipse.xtext/org.eclipse.xtext.xbase/2.12.0
146 │ Active   │  80 │ 2.12.0.v20170518-0757  │ mvn:org.eclipse.xtext/org.eclipse.xtext.xbase.lib/2.12.0
161 │ Active   │  80 │ 2.2.0                  │ mvn:org.jupnp/org.jupnp/2.2.0
162 │ Active   │  80 │ 1.9.6                  │ mvn:org.jvnet.mimepull/mimepull/1.9.6
163 │ Active   │  80 │ 5.0.2                  │ mvn:de.maggu2810.requirebundle.fix/org.objectweb.asm/5.0.2
165 │ Active   │  90 │ 2.2.0.201710181101     │ mvn:org.openhab.core/org.openhab.core/2.2.0-SNAPSHOT
166 │ Active   │  80 │ 2.2.0.201710181101     │ mvn:org.openhab.core/org.openhab.core.karaf/2.2.0-SNAPSHOT
168 │ Resolved │  80 │ 2.2.0.201710181101     │ mvn:org.openhab.core/org.openhab.io.sound/2.2.0-SNAPSHOT
169 │ Active   │  80 │ 2.2.0.201710181101     │ mvn:org.openhab.core/org.openhab.ui.dashboard/2.2.0-SNAPSHOT
174 │ Active   │  80 │ 3.1.4                  │ mvn:org.codehaus.woodstox/stax2-api/3.1.4
175 │ Active   │  80 │ 3.2.0                  │ mvn:commons-net/commons-net/3.2
176 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.extension.ui/org.eclipse.smarthome.ui.basic/0.9.0-SNAPSHOT
177 │ Active   │  80 │ 0.9.0.201710180819     │ mvn:org.eclipse.smarthome.extension.ui/org.eclipse.smarthome.ui.paper/0.9.0-SNAPSHOT
178 │ Resolved │  75 │ 2.2.0.201710181101     │ mvn:org.openhab.core/org.openhab.ui.basicui/2.2.0-SNAPSHOT
179 │ Active   │  80 │ 2.2.0.201710181101     │ mvn:org.openhab.ui/org.openhab.ui.habpanel/2.2.0-SNAPSHOT
180 │ Resolved │  75 │ 2.2.0.201710181101     │ mvn:org.openhab.core/org.openhab.ui.paperui/2.2.0-SNAPSHOT
181 │ Active   │  80 │ 2.2.0.201710181101     │ mvn:org.openhab.binding/org.openhab.binding.nest/2.2.0-SNAPSHOT
martinvw commented 6 years ago

Great, I will check tonight, but I do have mapdb running / installed.

kaikreuzer commented 6 years ago

but I do have mapdb running / installed.

Why do you? Any normal openHAB instance does NOT have it since we moved to jsondb.

martinvw commented 6 years ago

Than I'm most likely referring to the mapdb of openhab-addons-1, persistence-mapdb - 1.11.0.SNAPSHOT

martinvw commented 6 years ago

There it is.

START LEVEL 100 , List Threshold: 50
 ID │ State    │ Lvl │ Version                │ Name
────┼──────────┼─────┼────────────────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
 15 │ Active   │  80 │ 2.1.0.201706101937     │ Samsung Tv Binding
 16 │ Active   │  80 │ 2.1.0.201702282118     │ DSMR Binding
 17 │ Active   │  80 │ 2.2.0.201710150552     │ Rfxcom Binding
 18 │ Active   │  80 │ 2.2.0.201709220819     │ UniFi Binding
 19 │ Active   │  80 │ 2.2.0.201709301551     │ Nest Binding
 20 │ Active   │  80 │ 5.3.1.201602281253     │ OSGi JAX-RS Connector
 21 │ Active   │  80 │ 2.4.5                  │ Jackson-annotations
 22 │ Active   │  80 │ 2.4.5                  │ Jackson-core
 23 │ Active   │  80 │ 2.4.5                  │ jackson-databind
 24 │ Active   │  80 │ 2.4.5                  │ Jackson-dataformat-XML
 25 │ Active   │  80 │ 2.4.5                  │ Jackson-dataformat-YAML
 26 │ Active   │  80 │ 2.4.5                  │ Jackson-module-JAXB-annotations
 27 │ Active   │  80 │ 2.7.0                  │ Gson
 28 │ Active   │  80 │ 18.0.0                 │ Guava: Google Core Libraries for Java
 29 │ Active   │  80 │ 3.0.0.v201312141243    │ Google Guice (No AOP)
 30 │ Active   │  80 │ 1.5.8                  │ swagger-annotations
 31 │ Active   │  80 │ 3.19.0.GA              │ Javassist
 33 │ Active   │  80 │ 3.5.2                  │ JmDNS
 36 │ Active   │  80 │ 1.1.0.Final            │ Bean Validation API
 37 │ Active   │  80 │ 2.0.1                  │ javax.ws.rs-api
 38 │ Active   │  80 │ 3.2.0.v201101311130    │ ANTLR Runtime
 39 │ Active   │  80 │ 3.2.1                  │ Commons Collections
 40 │ Active   │  80 │ 1.1                    │ Commons Exec
 41 │ Active   │  80 │ 2.2.0                  │ Commons IO
 42 │ Active   │  80 │ 2.6                    │ Commons Lang
 47 │ Active   │  80 │ 4.2.3                  │ Apache HttpClient OSGi bundle
 48 │ Active   │  80 │ 4.2.3                  │ Apache HttpCore OSGi bundle
 54 │ Active   │  80 │ 4.1.2                  │ Apache Karaf :: OSGi Services :: Event
 73 │ Active   │  80 │ 2.11.0.v20150805-0538  │ EMF Common
 74 │ Active   │  80 │ 2.11.1.v20150805-0538  │ EMF Ecore
 75 │ Active   │  80 │ 2.11.1.v20150805-0538  │ EMF XML/XMI Persistence
 76 │ Active   │  80 │ 3.8.0.v20160509-1230   │ Common Eclipse Runtime
 77 │ Active   │  80 │ 3.6.100.v20160223-2218 │ Extension Registry Support
 99 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Config Core
100 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Configuration Discovery
101 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Config Dispatcher
102 │ Active   │  75 │ 0.9.0.201710101404     │ Eclipse SmartHome Config XML
103 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Core
104 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Core Audio
105 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome AutoUpdate Binding
106 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Core Binding XML
107 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Core ID
108 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Core Persistence
109 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Scheduler Service
110 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Core Thing
111 │ Active   │  75 │ 0.9.0.201710101404     │ Eclipse SmartHome Core Thing XML
112 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Transformation Service
113 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Core Voice
114 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Console
115 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Console for OSGi runtime Karaf
116 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome JavaSound I/O, Fragments: 173
117 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Monitor
118 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Net I/O Bundle
119 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome REST Interface Bundle
120 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Core REST API
121 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome REST mDNS Announcer
122 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome REST Interface JAX-RS optimization Bundle
123 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Sitemap REST API
124 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome SSE REST API
125 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Voice REST API
126 │ Waiting  │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Bonjour/MDS Service Discovery Bundle
127 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Web Audio Support
128 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Model Core
129 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Item Model
130 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Item Model Runtime
131 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Persistence Model
132 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Persistence Runtime
133 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Rule Model
134 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Rule Runtime
135 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Script
136 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Script Runtime
137 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Sitemap Model
138 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Sitemap Runtime
139 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Thing Model
140 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Thing Model Runtime
141 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Json Storage Service
142 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome UI
143 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome UI Icons
144 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Classic IconSet
145 │ Active   │  80 │ 2.12.0.v20170518-0757  │ Xtend Runtime Library
146 │ Active   │  80 │ 2.12.0.v20170518-0757  │ Xtend Macro Interfaces
147 │ Active   │  80 │ 2.12.0.v20170518-0959  │ Xtext
148 │ Active   │  80 │ 2.12.0.v20170519-0752  │ Xtext Common Types
149 │ Active   │  80 │ 2.12.0.v20170518-0959  │ Xtext Utility
150 │ Active   │  80 │ 2.12.0.v20170519-0752  │ Xbase Model
151 │ Active   │  80 │ 2.12.0.v20170518-0757  │ Xbase Runtime Library
166 │ Active   │  80 │ 2.2.0                  │ JUPnP Library
167 │ Active   │  80 │ 1.9.6                  │ MIME streaming extension
168 │ Active   │  80 │ 5.0.2                  │ Require-Bundle Fix :: org.objectweb.asm
170 │ Active   │  90 │ 2.2.0.201710101453     │ openHAB Core
171 │ Active   │  80 │ 2.2.0.201710101453     │ openHAB Karaf Integration
173 │ Resolved │  80 │ 2.2.0.201710101453     │ openHAB Sound Support, Hosts: 116
174 │ Active   │  80 │ 2.2.0.201710101453     │ openHAB Dashboard UI
179 │ Active   │  80 │ 3.1.4                  │ Stax2 API
180 │ Active   │  80 │ 1.6.0                  │ Commons Codec
181 │ Active   │  80 │ 3.2.0                  │ Commons Net
182 │ Active   │  80 │ 3.1.0.7                │ Apache ServiceMix :: Bundles :: commons-httpclient
183 │ Active   │  80 │ 2.2.0.201710101453     │ openHAB 1.x Compatibility Layer
184 │ Active   │  80 │ 1.1.1.201605111122     │ Swagger Provider
185 │ Active   │  80 │ 2.3.1                  │ Gson
186 │ Active   │  80 │ 2.1.0                  │ json-path
187 │ Active   │  80 │ 5.1.38                 │ Oracle Corporation's JDBC Driver for MySQL
188 │ Active   │  80 │ 3.12.0.OH              │ nrjavaserial
189 │ Active   │  80 │ 1.5.8                  │ swagger-core
190 │ Active   │  80 │ 1.5.8                  │ swagger-jaxrs
191 │ Active   │  80 │ 1.5.8                  │ swagger-models
192 │ Active   │  80 │ 2.2                    │ json-smart
193 │ Active   │  80 │ 3.4.0                  │ Apache Commons Lang
194 │ Active   │  80 │ 0.9.0.201710101404     │ Astro Binding
195 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome hue Binding
196 │ Active   │  80 │ 0.9.0.201710101404     │ ntp Binding
197 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome IoT Marketplace Extension Service
198 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome UPnP Transport Bundle
199 │ Active   │  75 │ 0.9.0.201710101404     │ Eclipse SmartHome Exec Transformation Service
200 │ Active   │  75 │ 0.9.0.201710101404     │ Eclipse SmartHome JavaScript Transformation Service
201 │ Active   │  75 │ 0.9.0.201710101404     │ Eclipse SmartHome JSonPath Transformation Service
202 │ Active   │  75 │ 0.9.0.201710101404     │ Eclipse SmartHome Map Transformation Service
203 │ Active   │  75 │ 0.9.0.201710101404     │ Eclipse SmartHome RegEx Transformation Service
204 │ Active   │  75 │ 0.9.0.201710101404     │ Eclipse SmartHome Scale Transformation Service
205 │ Active   │  75 │ 0.9.0.201710101404     │ Eclipse SmartHome XPath Transformation Service
206 │ Active   │  75 │ 0.9.0.201710101404     │ Eclipse SmartHome Xslt Transformation Service
207 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Basic UI, Fragments: 229
208 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome WebApp UI, Fragments: 230
209 │ Active   │  80 │ 0.9.0.201710101404     │ Eclipse SmartHome Paper UI, Fragments: 233
210 │ Active   │  80 │ 1.11.0.201710050110    │ openHAB Telegram Action
211 │ Active   │  80 │ 2.2.0.201710101453     │ Exec Binding
212 │ Active   │  80 │ 1.11.0.201710050110    │ openHAB Expire Binding
213 │ Active   │  80 │ 1.11.0.201710050110    │ openHAB MQTT Binding
214 │ Active   │  80 │ 2.2.0.201710101453     │ Network Binding
215 │ Active   │  80 │ 1.11.0.201710050110    │ openHAB SNMP Binding
216 │ Active   │  80 │ 2.2.0.201710101453     │ Systeminfo Binding
217 │ Active   │  80 │ 2.2.0.201710101453     │ Windcentrale Binding
218 │ Active   │  80 │ 2.2.0.201710101453     │ ZWave Binding
219 │ Active   │  80 │ 1.11.0.201710050110    │ openHAB Dropbox IO Bundle
220 │ Active   │  80 │ 2.2.0.201710101453     │ HomeKit Integration
221 │ Active   │  80 │ 2.2.0.201710101453     │ openHAB Cloud Connector Bundle
222 │ Active   │  80 │ 2.2.0.201710101453     │ openHAB REST Documentation
223 │ Active   │  80 │ 1.11.0.201710050110    │ openHAB MQTT Transport Bundle
224 │ Active   │  80 │ 1.11.0.201710050110    │ openHAB InfluxDB Persistence bundle
225 │ Active   │  80 │ 1.11.0.201710050110    │ openHAB JDBC SQL Persistence bundle
226 │ Active   │  80 │ 1.11.0.201710050110    │ openHAB MQTT Persistence Bundle
227 │ Active   │  80 │ 1.11.0.201710050110    │ openHAB mySQL Persistence bundle
228 │ Active   │  80 │ 1.11.0.201710050110    │ openHAB RRD4j Persistence Bundle
229 │ Resolved │  75 │ 2.2.0.201710101453     │ openHAB Basic UI Fragment, Hosts: 207
230 │ Resolved │  75 │ 2.2.0.201710101453     │ openHAB Classic UI Fragment, Hosts: 208
231 │ Active   │  80 │ 2.2.0.201710101453     │ HABmin User Interface
232 │ Active   │  80 │ 2.2.0.201710101453     │ HABPanel User Interface
233 │ Resolved │  75 │ 2.2.0.201710101453     │ openHAB Paper UI Theme Fragment, Hosts: 209
234 │ Active   │  80 │ 0.9.10.v20160429-1435  │ reflections (wrap)
235 │ Active   │  80 │ 1.5.8.v20160511-1038   │ swagger-jersey2-jaxrs (wrap)
236 │ Active   │  80 │ 1.11.0.201710140109    │ openHAB MapDB Persistence Bundle
martinvw commented 6 years ago

And after an upgrade it pops up again:

openhab> bundle:list | grep -i gson
 22 │ Active    │  80 │ 2.7.0                  │ Gson
openhab> bundle:list | grep -i gson
 22 │ Active    │  80 │ 2.7.0                  │ Gson
openhab> bundle:list | grep -i gson
 22 │ Active    │  80 │ 2.7.0                  │ Gson
openhab> bundle:list | grep -i gson
 22 │ Active   │  80 │ 2.7.0                  │ Gson
185 │ Resolved │  80 │ 2.3.1                  │ Gson
maggu2810 commented 6 years ago

To get a list of bundles that import Gson stuff, you could use

package:imports -p com.google.gson

After that you can have a look at the requirements of the respective bundles using e.g.

bundle:requirements org.eclipse.smarthome.storage.mapdb

You could also check the capabilities for the gson bundles:

karaf@root()> bundle:list -t 0 -l | grep '/gson/'
 17 │ Active   │  80 │ 2.3.1                  │ mvn:com.google.code.gson/gson/2.3.1
198 │ Active   │  80 │ 2.7.0                  │ mvn:com.google.code.gson/gson/2.7
karaf@root()> bundle:capabilities 17
com.google.gson [17] provides:
------------------------------
osgi.wiring.bundle; com.google.gson 2.3.1 [UNUSED]
osgi.wiring.host; com.google.gson 2.3.1 [UNUSED]
osgi.identity; com.google.gson 2.3.1 [UNUSED]
osgi.wiring.package; com.google.gson 2.3.1 [UNUSED]
osgi.wiring.package; com.google.gson.annotations 2.3.1 required by:
   com.google.gson [198]
   org.eclipse.smarthome.config.dispatch [125]
   org.eclipse.smarthome.storage.mapdb [160]
osgi.wiring.package; com.google.gson.reflect 2.3.1 [UNUSED]
osgi.wiring.package; com.google.gson.stream 2.3.1 [UNUSED]
osgi.wiring.package; com.google.gson.internal 2.3.1 required by:
   org.eclipse.smarthome.storage.mapdb [160]
osgi.wiring.package; com.google.gson.internal.bind 2.3.1 required by:
   org.eclipse.smarthome.storage.mapdb [160]
karaf@root()> bundle:capabilities 198
com.google.gson [198] provides:
-------------------------------
osgi.wiring.bundle; com.google.gson 2.7.0 [UNUSED]
osgi.wiring.host; com.google.gson 2.7.0 [UNUSED]
osgi.identity; com.google.gson 2.7.0 [UNUSED]
osgi.wiring.package; com.google.gson 2.7.0 required by:
   org.eclipse.smarthome.io.rest [142]
   org.eclipse.smarthome.automation.parser.gson [120]
   org.eclipse.smarthome.io.rest.core [143]
   org.eclipse.smarthome.config.dispatch [125]
   org.eclipse.smarthome.config.core [123]
   org.eclipse.lsp4j.jsonrpc [200]
   org.eclipse.smarthome.core [127]
   org.eclipse.smarthome.storage.mapdb [160]
   org.eclipse.smarthome.automation.core [115]
osgi.wiring.package; com.google.gson.reflect 2.7.0 required by:
   org.eclipse.smarthome.storage.mapdb [160]
   org.eclipse.lsp4j.jsonrpc [200]
osgi.wiring.package; com.google.gson.stream 2.7.0 required by:
   org.eclipse.smarthome.automation.parser.gson [120]
   org.eclipse.lsp4j.jsonrpc [200]
   org.eclipse.smarthome.io.rest [142]
   org.eclipse.smarthome.storage.mapdb [160]

Last but not least, you should have a look at the current wiring of the bundles that import a gson package using bundle:tree-show

Example

karaf@root()> bundle:tree-show org.eclipse.smarthome.storage.mapdb
Bundle org.eclipse.smarthome.storage.mapdb [160] is currently ACTIVE

org.eclipse.smarthome.storage.mapdb [160]
+- org.eclipse.smarthome.core [127]
|  +- org.apache.commons.io [40]
|  +- org.apache.commons.lang [41]
|  +- org.apache.felix.scr [43]
|  |  +- org.apache.karaf.shell.core [76]
|  |  |  +- org.apache.aries.blueprint.core [30]
|  |  |  |  +- org.apache.aries.proxy [36]
|  |  |  |  |  +- org.objectweb.asm.all [192]
|  |  |  |  |  +- org.ops4j.pax.logging.pax-logging-api [5]
|  |  |  |  |     +- org.apache.karaf.services.eventadmin [3]
|  |  |  |  |        +- org.apache.felix.configadmin [7]
|  |  |  |  |        +- org.apache.felix.metatype [2]
|  |  |  |  +- org.apache.aries.blueprint.api [28]
|  |  |  |  +- org.ops4j.pax.logging.pax-logging-api [5]
|  |  |  |  +- org.apache.karaf.services.eventadmin [3]
|  |  |  +- org.jline [187]
|  |  |  |  +- org.fusesource.jansi [172]
|  |  |  |  +- org.apache.sshd.core [86]
|  |  |  |     +- org.ops4j.pax.logging.pax-logging-api [5]
|  |  |  +- org.apache.felix.configadmin [7]
|  |  |  +- org.apache.aries.blueprint.api [28]
|  |  |  +- org.ops4j.pax.logging.pax-logging-api [5]
|  |  |  +- org.apache.karaf.services.eventadmin [3]
|  |  +- org.apache.felix.configadmin [7]
|  |  +- org.apache.felix.metatype [2]
|  |  +- org.ops4j.pax.logging.pax-logging-api [5]
|  +- com.google.gson [198]
|  |  +- com.google.gson [17]
|  +- org.ops4j.pax.logging.pax-logging-api [5]
|  +- com.google.guava [18]
|  +- org.apache.karaf.services.eventadmin [3]
+- org.mapdb.mapdb [190]
+- com.google.gson [17]
+- org.eclipse.smarthome.config.core [123]
|  +- org.eclipse.smarthome.core [127]
|  +- org.apache.commons.lang [41]
|  +- org.apache.felix.scr [43]
|  +- com.google.gson [198]
|  +- org.ops4j.pax.logging.pax-logging-api [5]
|  +- com.google.guava [18]
+- org.apache.felix.configadmin [7]
+- com.google.gson [198]
+- org.ops4j.pax.logging.pax-logging-api [5]
+- org.apache.karaf.services.eventadmin [3]
martinvw commented 6 years ago

Thanks for the commands!

Maybe my docker was more then 5 ~16~ days old that day, it looks good now indeed according to the command.

com.google.gson_2.7.0 [22] provides:
------------------------------------
osgi.wiring.bundle; com.google.gson 2.7.0 [UNUSED]
osgi.wiring.host; com.google.gson 2.7.0 [UNUSED]
osgi.identity; com.google.gson 2.7.0 [UNUSED]
osgi.wiring.package; com.google.gson 2.7.0 required by:
   org.eclipse.smarthome.storage.json_0.9.0.201710101404 [141]
   org.eclipse.smarthome.core_0.9.0.201710101404 [103]
   org.eclipse.smarthome.config.dispatch_0.9.0.201710101404 [101]
   org.eclipse.smarthome.config.core_0.9.0.201710101404 [99]
   reflections_0.9.10.v20160429-1435 [235]
   org.eclipse.smarthome.binding.hue_0.9.0.201710180819 [195]
   org.openhab.binding.zwave_2.2.0.201710181101 [218]
   org.openhab.binding.windcentrale_2.2.0.201710181101 [217]
   com.jayway.jsonpath.json-path_2.1.0 [186]
   org.openhab.binding.nest_2.2.0.201709301551 [33]  <---
   org.openhab.ui.habpanel_2.2.0.201710181101 [233]
   org.openhab.io.rest.docs_2.2.0.201710181101 [222]
   org.eclipse.smarthome.io.rest_0.9.0.201710101404 [119]
   org.eclipse.smarthome.io.rest.core_0.9.0.201710101404 [120]
   org.eclipse.smarthome.ui.basic_0.9.0.201710180819 [207]
osgi.wiring.package; com.google.gson.annotations 2.7.0 required by:
   org.eclipse.smarthome.storage.json_0.9.0.201710101404 [141]
   org.eclipse.smarthome.config.dispatch_0.9.0.201710101404 [101]
   org.eclipse.smarthome.binding.hue_0.9.0.201710180819 [195]
   org.openhab.binding.nest_2.2.0.201709301551 [33]
   org.openhab.io.rest.docs_2.2.0.201710181101 [222]
osgi.wiring.package; com.google.gson.reflect 2.7.0 required by:
   org.eclipse.smarthome.storage.json_0.9.0.201710101404 [141]
   org.eclipse.smarthome.binding.hue_0.9.0.201710180819 [195]
   com.jayway.jsonpath.json-path_2.1.0 [186]
osgi.wiring.package; com.google.gson.stream 2.7.0 required by:
   org.eclipse.smarthome.storage.json_0.9.0.201710101404 [141]
   org.eclipse.smarthome.binding.hue_0.9.0.201710180819 [195]
   org.eclipse.smarthome.io.rest_0.9.0.201710101404 [119]

The reason I still had gson 2.3 active is:

openhab> bundle:tree-show org.eclipse.smarthome.transform.jsonpath
Bundle org.eclipse.smarthome.transform.jsonpath [201] is currently ACTIVE

org.eclipse.smarthome.transform.jsonpath [201]
+- org.eclipse.smarthome.core.transform [112]
|  +- org.eclipse.smarthome.config.core [99]
|  |  +- com.google.guava [23]
|  |  +- org.ops4j.pax.logging.pax-logging-api [5]
|  |  |  +- org.apache.karaf.services.eventadmin [3]
|  |  |     +- org.apache.felix.metatype [2]
|  |  |     +- org.apache.felix.configadmin [7]
|  |  +- org.eclipse.smarthome.core [103]
|  |  |  +- com.google.guava [23]
|  |  |  +- org.apache.commons.io [41]
|  |  |  +- org.ops4j.pax.logging.pax-logging-api [5]
|  |  |  +- org.apache.commons.lang [42]
|  |  |  +- com.google.gson [22]
|  |  |  +- org.apache.felix.scr [43]
|  |  |  |  +- org.apache.felix.metatype [2]
|  |  |  |  +- org.apache.felix.configadmin [7]
|  |  |  +- org.apache.karaf.services.eventadmin [3]
|  |  +- org.apache.commons.lang [42]
|  |  +- com.google.gson [22]
|  |  +- org.apache.felix.scr [43]
|  +- org.apache.commons.io [41]
|  +- org.ops4j.pax.logging.pax-logging-api [5]
|  +- org.eclipse.smarthome.core [103]
+- org.ops4j.pax.logging.pax-logging-api [5]
+- net.minidev.json-smart [192]
+- com.jayway.jsonpath.json-path [186]
   +- org.ops4j.pax.logging.pax-logging-api [5]
   +- net.minidev.json-smart [192]
   +- com.google.gson [22]
   +- com.google.gson [185]

Although it looks fishy to me that it seems to use both version 2.7 and 2.3.1 together, should we try to prevent that?

Thank you very much for helping me debug this!

PS: should we create 2 new issue to put an upperbound on the gson dependency for org.eclipse.smarthome.transform.jsonpath and org.eclipse.smarthome.storage.mapdb

maggu2810 commented 6 years ago

Although it looks fishy to me that it seems to use both version 2.7 and 2.3.1 together, should we try to prevent that?

As @kaikreuzer already written above in an OSGi environment this is no necessary a problem (it could be if references are shared). So not really necessary to change it as long as it is working.

My personal opinion is that if a package contains internal, impl or something similar it should not be used (don't know why it is exported but named internal). But using exported packages is okay, if we should not use them Gson should not export them. But perhaps the export has not been done by intention but has been a mistake... So, if you could change the implementation to use only non-internal packages of 2.3.1 for existing solutions nothing would be changed, but someone using 2.7 does not need to use 2.3.1, too (I assume that the semantic version states that stuff working with 2.3.1 should also work with 2.7).

maggu2810 commented 6 years ago

We should probably add an upper version constraint to those imports then (until it is refactored to not use any internal packages anymore).

@kaikreuzer Why do you think we need to use a version constraint? Because internal named packages could break? The internal ones are not exported anymore, so I don't think it is necessary.

PS: should we create 2 new issue to put an upperbound on the gson dependency for org.eclipse.smarthome.transform.jsonpath and org.eclipse.smarthome.storage.mapdb

See above.

martinvw commented 6 years ago

With it I referred to jay way.json-path using both gson bundle 22 and 185 as can be seen in the last bundle-tree on the last two lines. I would assume that that is not without a risk?

maggu2810 commented 6 years ago

With it I referred to jay way.json-path using both gson bundle 22 and 185 as can be seen in the last bundle-tree on the last two lines. I would assume that that is not without a risk?

+- com.jayway.jsonpath.json-path [186]
   +- org.ops4j.pax.logging.pax-logging-api [5]
   +- net.minidev.json-smart [192]
   +- com.google.gson [22]
   +- com.google.gson [185]

IMHO that could be risky.

maggu2810 commented 6 years ago

That are the Gson imports of com.jayway.jsonpath.json-path 2.1.0:

    com.google.gson;resolution:=optional;version="[2.3,3)",
    com.google.gson.internal;resolution:=optional;version="[2.3,3)",
    com.google.gson.reflect;resolution:=optional;version="[2.3,3)",

As long as json-path is using internal it will not wire with Gson 2.7 completely. Perhaps we should change the version constraint of that third party package and use a SP for ESH.