Skip to content
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

Java 提供的Demo 在BaseBot 构造函数中抛出异常.将请求映射成对象时,报错,有谁遇到过这种问题吗? #9

Open
liuzhu1314 opened this issue Dec 13, 2018 · 19 comments

Comments

@liuzhu1314
Copy link

com.fasterxml.jackson.databind.JsonMappingException: Could not find creator property with name 'requestId' (in class com.baidu.dueros.data.request.RequestBody)
at [Source: java.io.StringReader@67e5ba; line: 1, column: 1]
at com.fasterxml.jackson.databind.JsonMappingException.from(JsonMappingException.java:164)
at com.fasterxml.jackson.databind.DeserializationContext.mappingException(DeserializationContext.java:700)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.addBeanProps(BeanDeserializerFactory.java:577)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.buildBeanDeserializer(BeanDeserializerFactory.java:270)
at com.fasterxml.jackson.databind.deser.BeanDeserializerFactory.createBeanDeserializer(BeanDeserializerFactory.java:168)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer2(DeserializerCache.java:401)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createDeserializer(DeserializerCache.java:350)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:263)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:243)
at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:144)
at com.fasterxml.jackson.databind.DeserializationContext.findContextualValueDeserializer(DeserializationContext.java:366)
at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.construct(PropertyBasedCreator.java:96)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.resolve(BeanDeserializerBase.java:414)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCache2(DeserializerCache.java:294)
at com.fasterxml.jackson.databind.deser.DeserializerCache._createAndCacheValueDeserializer(DeserializerCache.java:243)
at com.fasterxml.jackson.databind.deser.DeserializerCache.findValueDeserializer(DeserializerCache.java:144)
at com.fasterxml.jackson.databind.DeserializationContext.findRootValueDeserializer(DeserializationContext.java:381)
at com.fasterxml.jackson.databind.ObjectMapper._findRootDeserializer(ObjectMapper.java:3095)
at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:2989)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2098)
at com.baidu.dueros.bot.BaseBot.(BaseBot.java:168)
at com.baidu.dueros.samples.tax.TaxBot.(TaxBot.java:53)
at com.baidu.dueros.samples.tax.TaxAction.doPost(TaxAction.java:72)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at io.undertow.servlet.handlers.ServletHandler.handleRequest(ServletHandler.java:85)
at io.undertow.servlet.handlers.security.ServletSecurityRoleHandler.handleRequest(ServletSecurityRoleHandler.java:61)
at io.undertow.servlet.handlers.ServletDispatchingHandler.handleRequest(ServletDispatchingHandler.java:36)
at org.wildfly.extension.undertow.security.SecurityContextAssociationHandler.handleRequest(SecurityContextAssociationHandler.java:78)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
at io.undertow.servlet.handlers.security.SSLInformationAssociationHandler.handleRequest(SSLInformationAssociationHandler.java:131)
at io.undertow.servlet.handlers.security.ServletAuthenticationCallHandler.handleRequest(ServletAuthenticationCallHandler.java:56)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
at io.undertow.security.handlers.AbstractConfidentialityHandler.handleRequest(AbstractConfidentialityHandler.java:45)
at io.undertow.servlet.handlers.security.ServletConfidentialityConstraintHandler.handleRequest(ServletConfidentialityConstraintHandler.java:63)
at io.undertow.security.handlers.AuthenticationMechanismsHandler.handleRequest(AuthenticationMechanismsHandler.java:58)
at io.undertow.servlet.handlers.security.CachedAuthenticatedSessionHandler.handleRequest(CachedAuthenticatedSessionHandler.java:70)
at io.undertow.security.handlers.SecurityInitialHandler.handleRequest(SecurityInitialHandler.java:76)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
at org.wildfly.extension.undertow.security.jacc.JACCContextIdHandler.handleRequest(JACCContextIdHandler.java:61)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
at io.undertow.server.handlers.PredicateHandler.handleRequest(PredicateHandler.java:25)
at io.undertow.servlet.handlers.ServletInitialHandler.handleFirstRequest(ServletInitialHandler.java:261)
at io.undertow.servlet.handlers.ServletInitialHandler.dispatchRequest(ServletInitialHandler.java:247)
at io.undertow.servlet.handlers.ServletInitialHandler.access$000(ServletInitialHandler.java:76)
at io.undertow.servlet.handlers.ServletInitialHandler$1.handleRequest(ServletInitialHandler.java:166)
at io.undertow.server.Connectors.executeRootHandler(Connectors.java:177)
at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:727)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

@longger
Copy link
Contributor

longger commented Dec 13, 2018

请问Request是什么呢?Request是从哪里来的呢?

@liuzhu1314
Copy link
Author

TaxBot bot;
try {
bot = new TaxBot(request); 我把服务放在本地,然后调试的时候,百度会来调我的接口,这个request是百度发给我的

@liuzhu1314
Copy link
Author

这是Request的代码:
certificate = new Certificate(request);
String message = certificate.getMessage();

message的内容是:
{
"version": "v2.0",
"session": {
"new": true,
"sessionId": "fe618ac6-6d41-4f5d-a895-f8f95808ebf8"
},
"context": {
"System": {
"user": {
"userId": "42239595",
"userInfo": {
"account": {}
}
},
"application": {
"applicationId": "18986658-bd6e-c789-43c0-4f0f302f8a78"
},
"device": {
"deviceId": "0a4e42cd1ccada5fc88a700a82212616",
"supportedInterfaces": {
"VoiceInput": {},
"VoiceOutput": {},
"AudioPlayer": {},
"Display": {}
},
"TVControl": {
"controlType": "DCSControl",
"controlStatus": 0
}
},
"apiAccessToken": "qUVvFFgowvWYwC8mGvcaE9Osam4zewG65MX9lI4IgO2EVkQOiPtXv+30X/d9GNEubWtJ9aOIRLteFy5bGFBGtAPWigKaLf9UgDyJPP7vHSy9cAgsBtPdxEA7nhcCAA75xPIG32Q4JRYZUTbhBrKuYtNmIj8OA1XZyXJ16Stow4dOiWOAMxA9FyK6vvbRXkbITTyGm0KUQtmksqrLM5fjtNzDTH9DI/hDVAkWUXD7woJMjZ+2V/4fTsK9bcfHU0y+Cr7h7z1dCnzEao7SrBzUNQKUpFeu8gd93VGZV2baKWHmDcmc+gwJIG6iX3RjTJHbFP2LKCr0037ejJivlmsN44WF+6dlDIAn0yUChVqV2znxj/Q8ByNxsmRPqS1VU29/ABjvibfLEU4TsgjCtTlkVA==",
"apiEndPoint": "https://xiaodu.baidu.com",
"avaliableApplicationIds": ["doudi_server", "phone", "aries_general", "ai.dueros.bot.alarm", "duer_weather", "sac", "restaurant_bot", "o2o_satisfy", "rent_car", "travel_server", "recharge", "online_shopping", "hotel", "baojie", "nba_search", "sysprofile_service", "audio_music", "ai.dueros.bot.timer", "audio_unicast", "audio_live", "ai.dueros.bot.vocal_joke", "ai.dueros.bot.smarthome", "speaker_hardware", "audio_news"]
}
},
"request": {
"type": "LaunchRequest",
"requestId": "e5da674ab0564f0e9968f1d0a7816790_0#1_0",
"timestamp": "1544750131",
"dialogRequestId": "4e31bb81-1855-4ea2-a692-ef7b125bd70f"
}
}

@longger
Copy link
Contributor

longger commented Dec 14, 2018

image
我这里没有问题,哪个版本的SDK呢?

@longger
Copy link
Contributor

longger commented Dec 14, 2018

18986658-bd6e-c789-43c0-4f0f302f8a78 这个技能的服务地址好像有问题

@longger
Copy link
Contributor

longger commented Dec 14, 2018

image
SDK里面的例子也是没有问题的

@liuzhu1314
Copy link
Author

服务地址会有啥问题呢?我配置的不对?但是已经可以调用了,java的版本是1.8。内网穿透用的是花生壳这个工具。web服务器用得是wildfly 8 配置如下:
Uploading image.png…

@liuzhu1314
Copy link
Author

这是我的配置:

@liuzhu1314
Copy link
Author

sdk的版本v2.0,我昨天刚下载的版本,您是觉得我的系统部署有问题吗

@liuzhu1314
Copy link
Author

我是觉得如果配置有问题的话,完全不会进入我的服务器,进入我的服务器首先说明,我们之间的路径是通的,只是反序列化的时候出现了问题。

@liuzhu1314
Copy link
Author

这是我的版本:
{
"version": "v2.0",
"session": {
"new": true,
"sessionId": "ef6eeb7a-82d3-4c21-bad5-6d899565b137"
},
"context": {
"System": {
"user": {
"userId": "42239595",
"userInfo": {
"account": {}
}
},
"application": {
"applicationId": "18986658-bd6e-c789-43c0-4f0f302f8a78"
},
"device": {
"deviceId": "0a4e42cd1ccada5fc88a700a82212616",
"supportedInterfaces": {
"VoiceInput": {},
"VoiceOutput": {},
"AudioPlayer": {}
},
"TVControl": {
"controlType": "DCSControl",
"controlStatus": 0
}
},
"apiAccessToken": "qUVvFFgowvWYwC8mGvcaE9Osam4zewG65MX9lI4IgO2EVkQOiPtXv+30X/d9GNEubWtJ9aOIRLteFy5bGFBGtAPWigKaLf9UgDyJPP7vHSy9cAgsBtPdxEA7nhcCAA75xPIG32Q4JRYZUTbhBrKuYtNmIj8OA1XZyXJ16Stow4fWAzXtpdNMmQci3glzN1KnTTyGm0KUQtmksqrLM5fjtNzDTH9DI/hDVAkWUXD7woJMjZ+2V/4fTsK9bcfHU0y+Cr7h7z1dCnzEao7SrBzUNQKUpFeu8gd93VGZV2baKWHmDcmc+gwJIG6iX3RjTJHbFP2LKCr0037ejJivlmsN44WF+6dlDIAn0yUChVqV2znxj/Q8ByNxsmRPqS1VU29/ABjvibfLEU4TsgjCtTlkVA==",
"apiEndPoint": "https://xiaodu.baidu.com",
"avaliableApplicationIds": ["18986658-bd6e-c789-43c0-4f0f302f8a78"]
}
},
"request": {
"type": "LaunchRequest",
"requestId": "b5fc14c3c46c42bbb9aa665bd63b2be3_0#1_0",
"timestamp": "1544768126",
"dialogRequestId": "ba962e3b-4178-4c5d-8de3-4ff867baca1b"
}
}

@longger
Copy link
Contributor

longger commented Dec 14, 2018

我把你的SDK里面的例子部署后,在我的本地,发这个Request是没有问题的
image

@liuzhu1314
Copy link
Author

您觉得可能是网络的问题吗?我试了公司的网和自己的手机wifi,都是这个情况

@liuzhu1314
Copy link
Author

postman中raw您的内容是什么呢?可以发我一下吗?我来试一下

@liuzhu1314
Copy link
Author

您可以发一下您的request给我吗?我用自己的message试的时候是有问题的

@longger
Copy link
Contributor

longger commented Dec 14, 2018

我就是用的你发的Request的
image

@liuzhu1314
Copy link
Author

我又把github上面的代码下载下来,操作是将pom的jar包改为war包,然后用wildfly8启动,我新建了一个system的接口,用postman访问是没有问题的;然后我用自己的request去访问我的tax接口,结果还是遇到了这个错:
com.fasterxml.jackson.databind.JsonMappingException: Could not find creator property with name 'requestId' (in class com.baidu.dueros.data.request.RequestBody)
at [Source: java.io.StringReader@2273ee; line: 1, column: 1]

@liuzhu1314
Copy link
Author

default

@liuzhu1314
Copy link
Author

default

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants