当我在AWS Lambda服务器上运行代码时,会显示此消息 https://gyazo.com/7b26f2af77451117cea8ab38f52fcbde 显然是错误的,堆栈跟踪是
{
"errorMessage":
"com.fasterxml.jackson.datatype.jsr310.deser.JSR310DateTimeDeserializerBase.findFormatOverrides(Lcom/fasterxml/jackson/databind/DeserializationContext;Lcom/fasterxml/jackson/databind/BeanProperty;Ljava/lang/Class;)Lcom/fasterxml/jackson/annotation/JsonFormat$Value;",
"errorType": "java.lang.NoSuchMethodError",
"stackTrace": [
"com.fasterxml.jackson.datatype.jsr310.deser.JSR310DateTimeDeserializerBase.createContextual(JSR310DateTimeDeserializerBase.java:34)",
"com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer.createContextual(InstantDeserializer.java:235)",
"com.fasterxml.jackson.databind.DeserializationContext.handleSecondaryContextualization(DeserializationContext.java:669)",
"com.fasterxml.jackson.databind.DeserializationContext.findContextualValueDeserializer(DeserializationContext.java:430)",
"com.fasterxml.jackson.databind.deser.std.StdDeserializer.findDeserializer(StdDeserializer.java:947)",
"com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:439)",
"com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:296)",
"com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:244)",
"com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:142)",
"com.fasterxml.jackson.databind.DeserializationContext.findContextualValueDeserializer(DeserializationContext.java:428)",
"com.fasterxml.jackson.databind.jsontype.impl.TypeDeserializerBase._findDeserializer(TypeDeserializerBase.java:179)",
"com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:108)",
"com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:93)",
"com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:131)",
"com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:518)",
"com.fasterxml.jackson.databind.deser.impl.MethodProperty.deserializeSetAndReturn(MethodProperty.java:107)",
"com.fasterxml.jackson.databind.deser.BuilderBasedDeserializer.vanillaDeserialize(BuilderBasedDeserializer.java:255)",
"com.fasterxml.jackson.databind.deser.BuilderBasedDeserializer.deserialize(BuilderBasedDeserializer.java:145)",
"com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:3736)",
"com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2726)",
"com.amazon.ask.util.JacksonSerializer.deserialize(JacksonSerializer.java:69)",
"com.andrewtech.alexaskills.MagicDiceHandler.handleRequest(MagicDiceHandler.java:33)",
"sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)",
"sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)",
"sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)",
"java.lang.reflect.Method.invoke(Method.java:498)"
]
}
我的Java代码错误很奇怪,但是我的测试返回了这个... https://gyazo.com/975bd574e090be351c53cb7d65a89d84
{"version":"1.0","userAgent":"ask-java/2.5.5 Java/1.8.0_181","response":{"outputSpeech":{"type":"SSML","ssml":"<speak>Number is 10</speak>"}}}
我似乎无法找出发生错误的原因。 Im编译时应该是一个错误,但我似乎无法弄清楚到底是什么...如果有帮助,我的依赖项将基于Maven。
我的代码:https://github.com/Realmm/MagicDiceGitHub/tree/master/MagicDice
答案 0 :(得分:0)
没关系,事实证明该错误实际上根本没有发生……大声笑。修复之前,我只是没有在红色框上按X,而是在修复它时让我认为每次我提交一个新的jar文件时它都会出现。