Java demo 运行不起来?

  • 回答 (0)
  • 关注 (0)
  • 查看 (93)
package example;

import com.qcloud.scf.runtime.Context;

public class Hello {
    public String mainHandler(String name, Context context) {
        System.out.println("Hello world!");
        return String.format("Hello %s.", name);
    }
}

START RequestId: 2498cb0e-b515-11e9-9475-525400d2c34d

Event RequestId: 2498cb0e-b515-11e9-9475-525400d2c34d

handlerRequest IOException : com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.lang.String out of START_OBJECT token

 at [Source: (String)"{"key1":"test value 1","key2":"test value 2"}"; line: 1, column: 1]

com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.lang.String out of START_OBJECT token

 at [Source: (String)"{"key1":"test value 1","key2":"test value 2"}"; line: 1, column: 1]

at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)

at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1329)

at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1138)

at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1092)

at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:59)

at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:10)

at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4001)

at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3030)

at scfinternal.ScfJackson.readValue(ScfJackson.java:26)

at scfinternal.EventHandlerLoader$BaseMethodRequestHandler.parseValue(EventHandlerLoader.java:207)

at scfinternal.EventHandlerLoader$BaseMethodRequestHandler.handlerRequest(EventHandlerLoader.java:214)

at bootstrap.eventInvoke(bootstrap.java:147)

at bootstrap.main(bootstrap.java:210)

java.lang.RuntimeException: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.lang.String out of START_OBJECT token

 at [Source: (String)"{"key1":"test value 1","key2":"test value 2"}"; line: 1, column: 1]

at scfinternal.EventHandlerLoader$BaseMethodRequestHandler.handlerRequest(EventHandlerLoader.java:243)

at bootstrap.eventInvoke(bootstrap.java:147)

at bootstrap.main(bootstrap.java:210)

Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize instance of java.lang.String out of START_OBJECT token

 at [Source: (String)"{"key1":"test value 1","key2":"test value 2"}"; line: 1, column: 1]

at com.fasterxml.jackson.databind.exc.MismatchedInputException.from(MismatchedInputException.java:63)

at com.fasterxml.jackson.databind.DeserializationContext.reportInputMismatch(DeserializationContext.java:1329)

at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1138)

at com.fasterxml.jackson.databind.DeserializationContext.handleUnexpectedToken(DeserializationContext.java:1092)

at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:59)

at com.fasterxml.jackson.databind.deser.std.StringDeserializer.deserialize(StringDeserializer.java:10)

at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4001)

at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3030)

END RequestId: 2498cb0e-b515-11e9-9475-525400d2c34d

Report RequestId: 2498cb0e-b515-11e9-9475-525400d2c34d Duration:650.8ms Memory:128MB MaxMemoryUsed:29.8555MB

用户1179172用户1179172提问于

扫码关注云+社区

领取腾讯云代金券