You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been working on a google app engine project using the v2 branch. Looking for some guidence. I copied the DialogflowWebhook example and got a late init error that went away when I set Serializer.aogGson = Gson()
now I'm getting this exception
Uncaught exception from servlet
java.lang.Error: No response has been set. Is this being used in an async call that was not returned as a promise to the intent handler?
at actions.service.actionssdk.conversation.Conversation.response(Conversation.kt:391)
at actions.service.dialogflow.DialogflowConversation.commonPayload(Conv.kt:321)
at actions.service.dialogflow.DialogflowConversation.serialize(Conv.kt:366)
at actions.service.dialogflow.DialogflowSdk$handler$1.handle(Dialogflow.kt:450)
at actions.framework.StandardHandler$DefaultImpls.handle$default(Framework.kt:51)
at actions.expected.ServletHandler.handle(BuiltinFrameworks.kt:36)
at actions.service.dialogflow.DialogflowSdk$1.handle(Dialogflow.kt:463)
at actions.ServiceBaseApp.invoke(Assistant.kt:21)
at scott.servlets.FitnessAssistantServlet.simpleDialogFlowExample(FitnessAssistantServlet.kt:30)
at scott.servlets.FitnessAssistantServlet.doPost(FitnessAssistantServlet.kt:21)
My code
data class MyConversation(val temp: String? = null)
data class MyArgument(val temp: String? = null, var resultType: String? = null, var userDescision: String? = null)
class FitnessAssistantServlet: HttpServlet() {
val logger = Logger.getLogger("TestServlet")
@Throws(ServletException::class, IOException::class)
override fun doPost(req: HttpServletRequest, resp: HttpServletResponse) {
val dfApp = dialogflow<UserStorage<Any>, MyConversation, MyArgument>()
dfApp.frameworks.add(ServletFramework())
dfApp.intent("test") { conv -> conv.ask("Can you hear me?") }
dfApp(req, res
}
}
It feels like I'm missing some initialization logic somewhere, not sure where though.
Thoughts?
The text was updated successfully, but these errors were encountered:
scottlahay
changed the title
V2 working on getting a simple example going. Need some guidance
Working on getting a simple v2 example going. Need some guidance
Oct 16, 2018
As you asked I ensured the servlet framework is only getting initialized once. I did have to add org.slf4j:slf4j-jdk14:1.7.25 as a dependency. Different error!
My code
class MainServlet : HttpServlet() {
data class MyConversation(val temp: String? = null)
data class MyArgument(val temp: String? = null, var resultType: String? = null, var userDescision: String? = null)
var hasAddedFramework = false
@Throws(ServletException::class, IOException::class)
override fun doPost(req: HttpServletRequest, resp: HttpServletResponse) {
val dfApp = dialogflow<UserStorage<Any>, MyConversation, MyArgument>()
if (!hasAddedFramework) {
Serializer.aogGson = Gson()
dfApp.frameworks.add(ServletFramework())
hasAddedFramework = true
}
dfApp.intent("help") { conv -> conv.ask("Can you hear me?") }
dfApp(req, resp)
}}
Log data
ava.lang.ClassCastException: org.eclipse.jetty.server.Request cannot be cast to actions.service.actionssdk.api.GoogleActionsV2AppRequest
at actions.service.dialogflow.DialogflowSdk$1.handle(Dialogflow.kt:466)
at actions.ServiceBaseApp.invoke(Assistant.kt:21)
at scott.servlets.MainServlet.actionsOnGoogleStuff(MainServlet.kt:38)
at scott.servlets.MainServlet.doPost(MainServlet.kt:26)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
I'm taking a look now, to see if I can figure out whats causing the class cast
I have been working on a google app engine project using the v2 branch. Looking for some guidence. I copied the DialogflowWebhook example and got a late init error that went away when I set
Serializer.aogGson = Gson()
now I'm getting this exception
Uncaught exception from servlet
java.lang.Error: No response has been set. Is this being used in an async call that was not returned as a promise to the intent handler?
at actions.service.actionssdk.conversation.Conversation.response(Conversation.kt:391)
at actions.service.dialogflow.DialogflowConversation.commonPayload(Conv.kt:321)
at actions.service.dialogflow.DialogflowConversation.serialize(Conv.kt:366)
at actions.service.dialogflow.DialogflowSdk$handler$1.handle(Dialogflow.kt:450)
at actions.framework.StandardHandler$DefaultImpls.handle$default(Framework.kt:51)
at actions.expected.ServletHandler.handle(BuiltinFrameworks.kt:36)
at actions.service.dialogflow.DialogflowSdk$1.handle(Dialogflow.kt:463)
at actions.ServiceBaseApp.invoke(Assistant.kt:21)
at scott.servlets.FitnessAssistantServlet.simpleDialogFlowExample(FitnessAssistantServlet.kt:30)
at scott.servlets.FitnessAssistantServlet.doPost(FitnessAssistantServlet.kt:21)
My code
It feels like I'm missing some initialization logic somewhere, not sure where though.
Thoughts?
The text was updated successfully, but these errors were encountered: