-
Notifications
You must be signed in to change notification settings - Fork 130
When i try to query the data from influxdb using queryApi.query(flux), i am getting exceptions #338
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
Comments
Hi @anil123lalam, thanks for using our client. Can you share a full stacktrace? How looks like your dependency tree? Regards |
Hi bednar, FullStackTrace: Exception in thread "main" java.lang.IllegalArgumentException: Unable to create @Body converter for class com.influxdb.client.domain.Query (parameter #6) Client Version: |
It looks like problem with |
Even after i changed the gson version to 2.8.8 or remove explicit declaration of gson i am seeing the same exceptions. |
Can you try the |
When i use 6.0.0, i am getting below exceptions Exception in thread "main" java.lang.NullPointerException: Expecting a not null reference for InfluxDBClientOptions.getOrg |
This is our bug introduced by #335 :( Please as a workaround change the initialisation of InfluxDBClientOptions build = InfluxDBClientOptions.builder().url("http://localhost:8086").bucket(bucket).org(org)
.authenticateToken(token.toCharArray()).build(); |
As per your suggestion i have changed the initialization, now i am getting below exception Exception in thread "main" java.lang.IllegalArgumentException: Unable to create @Body converter for class com.influxdb.client.domain.Query (parameter #6) |
It looks like What is an output of: String version = com.google.gson.internal.GsonBuildConfig.VERSION;
System.out.println("version = " + version); ? |
version = 2.8.8 |
For 6.0.0 what is the suggestable gson version ? |
For the client |
version = 2.9.0, i am seeing the same exceptions |
I've create the following demo project with v6.0.0 client: https://github.com/bednar/java-client-dependency Can you try the demo project? For me it works correctly. |
Thanks, the above demo project works me correctly as well |
Can you share your project? Currently I am not able to find a reason of the exception. 😞 |
Sure, I will share it with you, currently I am out of station. I need to
learn influxdb, Could you please help me with resources like videos,books
etc. I am not able to find online.
Thanks
Anil Lalam
‐‐--------‐------------------------------------------------
Sent From Mobile
…On Fri, 22 Apr 2022, 10:09 am Jakub Bednář, ***@***.***> wrote:
Can you share your project? Currently I am not able to find a reason of
the exception. 😞
—
Reply to this email directly, view it on GitHub
<#338 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AUYMYH2FFXV3VMHAYOEUZJ3VGIUO7ANCNFSM5T3MQDUA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Thanks Here are some sources: |
Can you test explicitly exclude <dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.9.0</version>
</dependency>
<dependency>
<groupId>com.influxdb</groupId>
<artifactId>influxdb-client-java</artifactId>
<version>6.0.0</version>
<exclusions>
<exclusion>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</exclusion>
</exclusions>
</dependency> ? |
This issue has been closed because it has not had recent activity. Please reopen if this issue is still important to you and you have additionally information. |
package com.unitedrentals.dto;
import java.time.Instant;
import com.influxdb.annotations.Column;
import com.influxdb.annotations.Measurement;
@measurement(name = "series")
public class InfluxSeriesDto {
@column
String shardId;
@column
String equipmentId;
@column
String datatimestamp;
@column
String tagname;
@column
String uom;
@column
String datavalue;
@column(timestamp = true)
Instant time;
}
public class InfluxDBClientSample {
}
Steps to reproduce:
List the minimal actions needed to reproduce the behavior.
Exception in thread "main" java.lang.IllegalArgumentException: Unable to create @Body converter for class com.influxdb.client.domain.Query (parameter #6)
for method QueryService.postQueryResponseBody
at retrofit2.Utils.methodError(Utils.java:54)
at retrofit2.Utils.parameterError(Utils.java:60)
at retrofit2.RequestFactory$Builder.parseParameterAnnotation(RequestFactory.java:781)
at retrofit2.RequestFactory$Builder.parseParameter(RequestFactory.java:325)
at retrofit2.RequestFactory$Builder.build(RequestFactory.java:206)
at retrofit2.RequestFactory.parseAnnotations(RequestFactory.java:67)
at retrofit2.ServiceMethod.parseAnnotations(ServiceMethod.java:26)
at retrofit2.Retrofit.loadServiceMethod(Retrofit.java:202)
at retrofit2.Retrofit$1.invoke(Retrofit.java:160)
at com.sun.proxy.$Proxy4.postQueryResponseBody(Unknown Source)
at com.influxdb.client.internal.QueryApiImpl.query(QueryApiImpl.java:933)
at com.influxdb.client.internal.QueryApiImpl.query(QueryApiImpl.java:123)
at com.influxdb.client.internal.QueryApiImpl.query(QueryApiImpl.java:85)
at com.influxdb.client.internal.QueryApiImpl.query(QueryApiImpl.java:75)
at com.influxdb.InfluxDBClientSample.main(InfluxDBClientSample.java:49)
Caused by: java.lang.IllegalArgumentException: @JsonAdapter value must be TypeAdapter or TypeAdapterFactory reference.
at com.google.gson.internal.bind.JsonAdapterAnnotationTypeAdapterFactory.getTypeAdapter(JsonAdapterAnnotationTypeAdapterFactory.java:65)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getFieldAdapter(ReflectiveTypeAdapterFactory.java:133)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.access$100(ReflectiveTypeAdapterFactory.java:49)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.(ReflectiveTypeAdapterFactory.java:106)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:105)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:161)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:97)
at com.google.gson.Gson.getDelegateAdapter(Gson.java:489)
at io.gsonfire.gson.WrapTypeAdapterFactory.create(WrapTypeAdapterFactory.java:26)
at com.google.gson.Gson.getAdapter(Gson.java:407)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getFieldAdapter(ReflectiveTypeAdapterFactory.java:136)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.access$100(ReflectiveTypeAdapterFactory.java:49)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory$1.(ReflectiveTypeAdapterFactory.java:106)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.createBoundField(ReflectiveTypeAdapterFactory.java:105)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.getBoundFields(ReflectiveTypeAdapterFactory.java:161)
at com.google.gson.internal.bind.ReflectiveTypeAdapterFactory.create(ReflectiveTypeAdapterFactory.java:97)
at com.google.gson.Gson.getDelegateAdapter(Gson.java:489)
at io.gsonfire.gson.WrapTypeAdapterFactory.create(WrapTypeAdapterFactory.java:26)
at com.google.gson.Gson.getAdapter(Gson.java:407)
at retrofit2.converter.gson.GsonConverterFactory.requestBodyConverter(GsonConverterFactory.java:74)
at retrofit2.Retrofit.nextRequestBodyConverter(Retrofit.java:315)
at retrofit2.Retrofit.requestBodyConverter(Retrofit.java:293)
at retrofit2.RequestFactory$Builder.parseParameterAnnotation(RequestFactory.java:778)
... 12 more
Expected behavior:
Should display records from influxdb
Actual behavior:
Exceptions were thrown
Specifications:
com.influxdb
influxdb-client-java
6.0.0
The text was updated successfully, but these errors were encountered: