[
https://issues.apache.org/jira/browse/KARAF-6227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16840066#comment-16840066
]
Alvaro Marco commented on KARAF-6227:
-------------------------------------
Hi,
I was trying to get running org.influxdb/influxdb-java in karaf, and ended-up
in this issue. I have installed the bundles composing this feature manually, in
a fresh instance, but it is still not working.
The appender bundle appears in state "WAITING", and the log shows a
NoClassDeffFoundError exception for com.squareup.moshi.Moshi$Builder
{{karaf@root()> list}}
{{START LEVEL 100 , List Threshold: 50}}
{{ID | State | Lvl | Version | Name}}
{{---+---------+-----+----------+----------------------------------------------------------------------------------------------------------------------------------------------------
23 | Active | 80 | 4.2.5 | Apache Karaf :: OSGi Services :: Event}}
{{46 | Active | 80 | 2.2.0 | Apache Karaf :: Decanter :: API}}
{{47 | Active | 80 | 2.2.0 | Apache Karaf :: Decanter :: Marshaller :: CSV}}
{{48 | Active | 80 | 2.2.0 | Apache Karaf :: Decanter :: Marshaller :: Json}}
{{49 | Active | 80 | 2.2.0 | Apache Karaf :: Decanter :: Marshaller :: Raw}}
{{50 | Active | 80 | 2.2.0 | Apache Karaf :: Decanter :: Parser :: Identity}}
{{51 | Active | 80 | 2.2.0 | Apache Karaf :: Decanter :: Parser :: Regex}}
{{52 | Active | 80 | 2.2.0 | Apache Karaf :: Decanter :: Parser :: Split}}
{{55 | Active | 80 | 1.0.4 | JSR 353 (JSON Processing) Default Provider}}
{{58 | Active | 80 | 16.0.1 | Guava: Google Core Libraries for Java}}
{{59 | Active | 80 | 1.3.21 | kotlin-osgi-bundle}}
{{60 | Active | 80 | 3.0.2.1 | Apache ServiceMix :: Bundles :: jsr305}}
{{61 | Active | 80 | 2.5.0.1 | Apache ServiceMix :: Bundles :: retrofit}}
{{62 | Active | 80 | 1.15.0.1 | Apache ServiceMix :: Bundles :: okio}}
{{63 | Active | 80 | 3.14.0.1 | Apache ServiceMix :: Bundles :: okhttp}}
{{64 | Active | 80 | 2.15.0.1 | Apache ServiceMix :: Bundles :: influxdb-java}}
{{66 | Waiting | 80 | 2.2.0 | Apache Karaf :: Decanter :: Appender :: InfluxDB}}
{{67 | Active | 80 | 2.2.0 | Apache Karaf :: Decanter :: Collector :: System}}
{{karaf@root()> stop 66}}
{{karaf@root()> log:clear}}
{{karaf@root()> start 66}}
{{karaf@root()> ld}}
{{06:58:51.413 ERROR [pipe-start 66] bundle
org.apache.karaf.decanter.appender.influxdb:2.2.0
(66)[org.apache.karaf.decanter.appender.influxdb(12)] : The activate method has
thrown an exception}}
{{java.lang.NoClassDefFoundError: com/squareup/moshi/Moshi$Builder}}
{{ at
retrofit2.converter.moshi.MoshiConverterFactory.create(MoshiConverterFactory.java:48)
~[?:?]}}
{{ at org.influxdb.impl.InfluxDBImpl.<init>(InfluxDBImpl.java:169) ~[?:?]}}
{{ at org.influxdb.impl.InfluxDBImpl.<init>(InfluxDBImpl.java:123) ~[?:?]}}
{{ at org.influxdb.impl.InfluxDBImpl.<init>(InfluxDBImpl.java:187) ~[?:?]}}
{{ at org.influxdb.InfluxDBFactory.connect(InfluxDBFactory.java:48) ~[?:?]}}
{{ at
org.apache.karaf.decanter.appender.influxdb.InfluxDbAppender.activate(InfluxDbAppender.java:67)
~[?:?]}}
{{ at
org.apache.karaf.decanter.appender.influxdb.InfluxDbAppender.activate(InfluxDbAppender.java:49)
~[?:?]}}
...
I managed to get the org.influxdb/influxdb-java bundle by embedding it
together with the dependencies listed in
[https://mvnrepository.com/artifact/org.influxdb/influxdb-java/2.15],
servicemix-jsr305, servicemix-okio and kotlin, in the bundle I was coding for
sending data to influxdb.
{{<dependencies>}}
{{ ...}}
{{ <dependency>}}
{{ <groupId>org.influxdb</groupId>}}
{{ <artifactId>influxdb-java</artifactId>}}
{{ <version>2.15</version>}}
{{ </dependency>}}
{{ <dependency>}}
{{ <groupId>com.squareup.retrofit2</groupId>}}
{{ <artifactId>converter-moshi</artifactId>}}
{{ <version>2.5.0</version>}}
{{ </dependency>}}
{{ <dependency>}}
{{ <groupId>com.squareup.moshi</groupId>}}
{{ <artifactId>moshi</artifactId>}}
{{ <version>1.5.0</version>}}
{{ </dependency>}}
{{ <dependency>}}
{{ <groupId>com.squareup.retrofit2</groupId>}}
{{ <artifactId>retrofit</artifactId>}}
{{ <version>2.5.0</version>}}
{{ </dependency>}}
{{ <dependency>}}
{{ <groupId>com.squareup.okhttp3</groupId>}}
{{ <artifactId>okhttp</artifactId>}}
{{ <version>3.13.1</version>}}
{{ </dependency>}}
{{ <dependency>}}
{{ <groupId>com.squareup.okhttp3</groupId>}}
{{ <artifactId>logging-interceptor</artifactId>}}
{{ <version>3.13.1</version>}}
{{ </dependency>}}
{{ <dependency>}}
{{ <groupId>org.msgpack</groupId>}}
{{ <artifactId>msgpack-core</artifactId>}}
{{ <version>0.8.16</version>}}
{{ </dependency>}}{{<dependency>}}
{{ <groupId>org.apache.servicemix.bundles</groupId>}}
{{ <artifactId>org.apache.servicemix.bundles.jsr305</artifactId>}}
{{ <version>RELEASE</version>}}
{{ </dependency>}}
{{ <dependency>}}
{{ <groupId>org.apache.servicemix.bundles</groupId>}}
{{ <artifactId>org.apache.servicemix.bundles.okio</artifactId>}}
{{ <version>RELEASE</version>}}
{{ </dependency>}}
{{ <dependency>}}
{{ <groupId>org.jetbrains.kotlin</groupId>}}
{{ <artifactId>kotlin-osgi-bundle</artifactId>}}
{{ <version>RELEASE</version>}}
{{ </dependency>}}{{</dependencies>}}{{<build>}}
{{ <plugins>}}
{{ <plugin>}}
{{ <groupId>org.apache.felix</groupId>}}
{{ <artifactId>maven-bundle-plugin</artifactId>}}
{{ <configuration>}}
{{ <instructions>}}
{{ ...}}
{{ <Embed-Dependency>}}
{{ influxdb-java, retrofit, converter-moshi, moshi, msgpack-core, okhttp,
logging-interceptor,}}
{{ org.apache.servicemix.bundles.okio,}}
{{ org.apache.servicemix.bundles.jsr305,}}
{{ kotlin-osgi-bundle}}
{{ </Embed-Dependency>}}{{<Import-Package>}}
{{ javax.*,}}
{{ org.osgi.*,}}
{{ org.apache.*}}
{{ </Import-Package>}}{{</instructions>}}
{{ </configuration>}}
{{ </plugin>}}
{{ </plugins>}}
{{ </build>}}
I did that because com.squareup.moshi/moshi cannot be installed directly, and
servicemix-retrofit bundle cannot get the required dependency (maybe including
the jar in the karaf lib folder would work also), but seems not to be a very
clean solution...
> Unresolvable dependency for decanter-appender-influxdb
> -------------------------------------------------------
>
> Key: KARAF-6227
> URL: https://issues.apache.org/jira/browse/KARAF-6227
> Project: Karaf
> Issue Type: Bug
> Components: decanter
> Affects Versions: decanter-2.2.0
> Environment: Karaf Version: 4.2.4
> Decanter Version: 2.2.0
> OS: macOS 10.14.4 (18E226)
> Reporter: Markus W Mahlberg
> Assignee: Jean-Baptiste Onofré
> Priority: Major
> Fix For: decanter-2.3.0
>
>
> When trying to install decanter-appender-influxdb via the Karaf console, the
> following exception is thrown:
> {code:java}
> karaf@root()> feature:install decanter-appender-influxdb
> org.apache.karaf.features.internal.util.MultiException: Error:
> Error downloading
> mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.influxdb/2.15_1
> at
> org.apache.karaf.features.internal.download.impl.MavenDownloadManager$MavenDownloader.<init>(MavenDownloadManager.java:91)
> at
> org.apache.karaf.features.internal.download.impl.MavenDownloadManager.createDownloader(MavenDownloadManager.java:72)
> at
> org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:457)
> at
> org.apache.karaf.features.internal.region.Subsystem.downloadBundles(Subsystem.java:452)
> at
> org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:224)
> at
> org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:388)
> at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1058)
> at
> org.apache.karaf.features.internal.service.FeaturesServiceImpl.lambda$doProvisionInThread$13(FeaturesServiceImpl.java:994)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
> at java.lang.Thread.run(Thread.java:748)
> Suppressed: java.io.IOException: Error downloading
> mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.influxdb/2.15_1
> at
> org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:77)
> at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
> at
> java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
> ... 3 more
> Caused by: java.io.IOException: Error resolving artifact
> org.apache.servicemix.bundles:org.apache.servicemix.bundles.influxdb:jar:2.15_1:
> [Could not find artifact
> org.apache.servicemix.bundles:org.apache.servicemix.bundles.influxdb:jar:2.15_1
> in central (http://repo1.maven.org/maven2/)]
> at
> org.ops4j.pax.url.mvn.internal.AetherBasedResolver.configureIOException(AetherBasedResolver.java:803)
> at
> org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:774)
> at
> org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:657)
> at
> org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:598)
> at
> org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:565)
> at
> org.apache.karaf.features.internal.download.impl.MavenDownloadTask.download(MavenDownloadTask.java:52)
> at
> org.apache.karaf.features.internal.download.impl.AbstractRetryableDownloadTask.run(AbstractRetryableDownloadTask.java:60)
> ... 7 more
> Suppressed:
> shaded.org.eclipse.aether.transfer.ArtifactNotFoundException: Could not find
> artifact
> org.apache.servicemix.bundles:org.apache.servicemix.bundles.influxdb:jar:2.15_1
> in central (http://repo1.maven.org/maven2/)
> at
> shaded.org.eclipse.aether.connector.basic.ArtifactTransportListener.transferFailed(ArtifactTransportListener.java:48)
> at
> shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector$TaskRunner.run(BasicRepositoryConnector.java:368)
> at
> shaded.org.eclipse.aether.util.concurrency.RunnableErrorForwarder$1.run(RunnableErrorForwarder.java:75)
> at
> shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector$DirectExecutor.execute(BasicRepositoryConnector.java:642)
> at
> shaded.org.eclipse.aether.connector.basic.BasicRepositoryConnector.get(BasicRepositoryConnector.java:262)
> at
> shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads(DefaultArtifactResolver.java:489)
> at
> shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:390)
> at
> shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:215)
> at
> shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:192)
> at
> shaded.org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:247)
> at
> org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:767)
> ... 12 more
> Caused by:
> shaded.org.eclipse.aether.resolution.ArtifactResolutionException: Error
> resolving artifact
> org.apache.servicemix.bundles:org.apache.servicemix.bundles.influxdb:jar:2.15_1
> at
> shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:413)
> at
> shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts(DefaultArtifactResolver.java:215)
> at
> shaded.org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact(DefaultArtifactResolver.java:192)
> at
> shaded.org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact(DefaultRepositorySystem.java:247)
> at
> org.ops4j.pax.url.mvn.internal.AetherBasedResolver.resolve(AetherBasedResolver.java:767)
> ... 12 more
> Error executing command: Error:
> Error downloading
> mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.influxdb/2.15_1
> {code}
> The reason for this is that the artifact - according to my research actually
> has the id {{org.apache.servicemix.bundles.influxdb-java}} as opposed to
> {{org.apache.servicemix.bundles.influxdb}}, which is how it is referenced in
> the feature file.
> However, when changing this manually, a dependency on okhttp3 can not be
> fulfilled.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)