Giter Club home page Giter Club logo

Comments (2)

jsabin avatar jsabin commented on September 27, 2024

I tried your code and it works for me. The key issue is this exception

Caused by: java.lang.EnumConstantNotPresentException:
org.codehaus.jackson.map.annotate.JsonSerialize$Inclusion.NON_EMPTY

My guess is that you are using a different version of Jackson-mapper-asl. I
am using version 1.9.8 which is what is included in the pom. My guess is
that you have an older version.

It look like NON_EMPTY was included in 1.9.x versions and did not exist in
prior versions. I tried 1.8.8 and saw the same thing you did.

On Wed, Nov 27, 2013 at 11:31 PM, kering-wang [email protected]:

when i execute query with then kairos-client , i met a exception like this

Exception in thread "main" org.codehaus.jackson.map.JsonMappingException:
org.codehaus.jackson.map.annotate.JsonSerialize$Inclusion.NON_EMPTY
(through reference chain:
org.kairosdb.client.builder.QueryBuilder["metrics"]->java.util.ArrayList[0])
at
org.codehaus.jackson.map.JsonMappingException.wrapWithPath(JsonMappingException.java:215)
at
org.codehaus.jackson.map.JsonMappingException.wrapWithPath(JsonMappingException.java:194)
at
org.codehaus.jackson.map.ser.SerializerBase.wrapAndThrow(SerializerBase.java:154)
at
org.codehaus.jackson.map.ser.ContainerSerializers$IndexedListSerializer.serializeContents(ContainerSerializers.java:278)
at
org.codehaus.jackson.map.ser.ContainerSerializers$IndexedListSerializer.serializeContents(ContainerSerializers.java:229)
at
org.codehaus.jackson.map.ser.ContainerSerializers$AsArraySerializer.serialize(ContainerSerializers.java:130)
at
org.codehaus.jackson.map.ser.BeanPropertyWriter.serializeAsField(BeanPropertyWriter.java:428)
at
org.codehaus.jackson.map.ser.BeanSerializer.serializeFields(BeanSerializer.java:244)
at
org.codehaus.jackson.map.ser.BeanSerializer.serialize(BeanSerializer.java:211)
at org.codehaus.jackson.map.ser.StdSerializerProvider.

serializeValue(StdSerializerProvider.java:586) at
org.codehaus.jackson.map.ser.StdSerializerProvider.serializeValue(StdSerializerProvider.java:244)
at org.codehaus.jackson.map.ObjectMapper.

configAndWriteValue(ObjectMapper.java:1990)
at org.codehaus.jackson.map.ObjectMapper.writeValue(ObjectMapper.java:1576)
at org.kairosdb.client.builder.QueryBuilder.build(QueryBuilder.java:234)
at org.kairosdb.client.AbstractClient.query(AbstractClient.java:82)
at Get.main(Get.java:42)
Caused by: java.lang.EnumConstantNotPresentException:
org.codehaus.jackson.map.annotate.JsonSerialize$Inclusion.NON_EMPTY
at
sun.reflect.annotation.EnumConstantNotPresentExceptionProxy.generateException(EnumConstantNotPresentExceptionProxy.java:47)
at
sun.reflect.annotation.AnnotationInvocationHandler.invoke(AnnotationInvocationHandler.java:75)
at sun.proxy.$Proxy6.include(Unknown Source)
at
org.codehaus.jackson.map.introspect.JacksonAnnotationIntrospector.findSerializationInclusion(JacksonAnnotationIntrospector.java:289)
at
org.codehaus.jackson.map.ser.PropertyBuilder.buildWriter(PropertyBuilder.java:108)
at org.codehaus.jackson.map.ser.BeanSerializerFactory.

constructWriter(BeanSerializerFactory.java:727) at
org.codehaus.jackson.map.ser.BeanSerializerFactory.findBeanProperties(BeanSerializerFactory.java:536)
at
org.codehaus.jackson.map.ser.BeanSerializerFactory.constructBeanSerializer(BeanSerializerFactory.java:375)
at
org.codehaus.jackson.map.ser.BeanSerializerFactory.findBeanSerializer(BeanSerializerFactory.java:291)
at
org.codehaus.jackson.map.ser.BeanSerializerFactory.createSerializer(BeanSerializerFactory.java:241)
at org.codehaus.jackson.map.ser.StdSerializerProvider.

createUntypedSerializer(StdSerializerProvider.java:747)
at org.codehaus.jackson.map.ser.StdSerializerProvider.

createAndCacheUntypedSerializer(StdSerializerProvider.java:688) at
org.codehaus.jackson.map.ser.StdSerializerProvider.findValueSerializer(StdSerializerProvider.java:363)
at
org.codehaus.jackson.map.ser.impl.PropertySerializerMap.findAndAddSerializer(PropertySerializerMap.java:39)
at org.codehaus.jackson.map.ser.ContainerSerializers$AsArraySerializer.

findAndAddDynamic(ContainerSerializers.java:209)
at
org.codehaus.jackson.map.ser.ContainerSerializers$IndexedListSerializer.serializeContents(ContainerSerializers.java:271)
... 12 more

the execute code like this

QueryBuilder builder = QueryBuilder.getInstance();

builder.setStart(Calendar.getInstance().getTime()).addMetric("kairosdb.jvm.free_memory");
HttpClient client = new HttpClient("10.11.0.9", 8015);
QueryResponse response = client.query(builder);
System.out.println("Response Code =" + response.getStatusCode());

client.shutdown();


Reply to this email directly or view it on GitHubhttps://github.com//issues/8
.

from kairosdb-client.

jsabin avatar jsabin commented on September 27, 2024

Moved from Jackson to Gson.

from kairosdb-client.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.