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

Running selfcontained spring boot jar (fat jar) fails on help command #340

Closed
nmwael opened this issue May 3, 2022 · 20 comments
Closed

Comments

@nmwael
Copy link

nmwael commented May 3, 2022

When im running the repakaged jar made by spring I end up getting this:
Caused by: java.lang.UnsupportedOperationException: Don't know how to construct default template for WorkResponse

Running the same class from my IDE works just fine, looks like someother configuration of thymeleaf takes precidense on the condittional missiong beans here:
springbot/teams-chat-workflow-spring-boot-starter/9.0.0.BETA2/teams-chat-workflow-spring-boot-starter-9.0.0.BETA2-sources.jar!/org/finos/springbot/teams/TeamsWorkflowConfig.java:92

POSSIBLE fix? Maybe add an @order to prefer this being configured before the unkown culprit?

@nmwael nmwael changed the title Running selfcontained spring boot jar fails on help Running selfcontained spring boot jar (fat jar) fails on help command May 4, 2022
@robmoffat
Copy link
Member

ok again, I'll check this today - are you running one of the demo bots, or your own bot?

@robmoffat robmoffat reopened this May 11, 2022
@nmwael
Copy link
Author

nmwael commented May 12, 2022

one of my own, but I think its reproducible with demobots,
my code looks like this:

   @ChatRequest(value = "test", description = "Ping test your bot!")
    public MessageResponse testBot(Addressable a) {
        return new MessageResponse(a, "Hello from the other side");
    }




    @ChatRequest(value = "redirect {userA} to {userB}", description = "Redirect user calls from userA to userB, eg redirect johndoe@tdc.dk to janedoe@tdc.dk")
    public MessageResponse redirectCallToOtherUser(Addressable a, @ChatVariable(name = "userA") Word userA, @ChatVariable(name = "userB") Word userB) throws IOException, InterruptedException {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create("https://.webhook.eus.azure-automation.net/webhooks?token=")).POST(HttpRequest.BodyPublishers.ofString("{\"userA\":\"" + userA.getText() + "\",\"userB\":\"" + userB.getText() + "\"}"))
                .build();

        String response = client.send(request, HttpResponse.BodyHandlers.ofString()).body();
        return new MessageResponse(a, "redirect job now placed in queue with >>" + response + "<<");
    }
    @ChatRequest(value = "stop redirect {userA}", description = "stop redirect user calls to userA, eg stop redirect johndoe@tdc.dk")
    public MessageResponse stopRedirectCall(Addressable a, @ChatVariable(name = "userA") Word userA) throws IOException, InterruptedException {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
                .uri(URI.create("https://.webhook.eus.azure-automation.net/webhooks?token=")).POST(HttpRequest.BodyPublishers.ofString("{\"userA\":\"" + userA.getText() + "\"}"))
                .build();

        String response = client.send(request, HttpResponse.BodyHandlers.ofString()).body();
        return new MessageResponse(a, "redirect job now placed in queue with >>" + response + "<<");
    }

@robmoffat
Copy link
Member

Well, I found a different issue with demo-bot just now, leading me to do some tidying up of that. I've pushed it to spring-bot-develop branch.

... however, I didn't manage to reproduce this. I'm going to try importing your code now and see if I can get it to happen

@robmoffat
Copy link
Member

ok, I ran some of your code above. I removed the stuff to do with http, since chances are I don't have access to that..

Here's the help page:

Screenshot 2022-05-12 at 12 36 35

And I'm calling the method ok:

Screenshot 2022-05-12 at 12 37 45

This is on teams which I gather you're using, but also works on Symphony for me.

I'll update the other ticket you raised too, which was about using @ - mentions...

@nmwael
Copy link
Author

nmwael commented May 12, 2022

Ok cool, does this mean that it worked or you found a bug?

@robmoffat
Copy link
Member

It worked.

Can you provide the complete stack trace?

@nmwael
Copy link
Author

nmwael commented May 17, 2022

To disable this warning the '--engine.WarnInterpreterOnly=false' option or use the '-Dpolyglot.engine.WarnInterpreterOnly=false' system property.
2022-05-09 08:39:58.234  INFO 1268 --- [           main] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2022-05-09 08:39:58.250  INFO 1268 --- [           main] d.t.n.msteamsbot.MsTeamsBotApplication   : Started MsTeamsBotApplication in 10.077 seconds (JVM running for 10.753)
2022-05-09 08:40:13.177  INFO 1268 --- [io-8080-exec-10] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2022-05-09 08:40:13.183  INFO 1268 --- [io-8080-exec-10] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2022-05-09 08:40:13.183  INFO 1268 --- [io-8080-exec-10] o.s.web.servlet.DispatcherServlet        : Completed initialization in 0 ms
2022-05-09 08:40:14.432  INFO 1268 --- [          Bot-1] com.microsoft.bot.connector.UserAgent    : UserAgent: BotBuilder/${project.version} (JVM 11.0.15; Windows Server 2022)
2022-05-09 08:41:22.493  INFO 1268 --- [          Bot-1] s.w.r.t.AbstractResourceTemplateProvider : Reverting to default template for MessageResponse [m=Message [[Paragraph [[Word [redirect], Word [job], Word [now], Word [placed], Word [in], Word [queue], Word [with], Word [>>{"JobIds":["42e7458b-f10e-4ce5-a71b-dddd6e39b783"]}<<]]]]], getData()=null, getTemplate()=null, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
2022-05-09 08:41:22.493  INFO 1268 --- [          Bot-1] s.w.r.t.AbstractResourceTemplateProvider : Template:
org.finos.springbot.teams.response.templating.MarkupAndEntities@71d94e8d
2022-05-10 08:37:37.820  INFO 1268 --- [          Bot-1] s.w.r.t.AbstractResourceTemplateProvider : Reverting to default template for MessageResponse [m=Message [[Paragraph [[Word [redirect], Word [job], Word [now], Word [placed], Word [in], Word [queue], Word [with], Word [>>{"JobIds":["626818f7-776c-4f3f-8679-c149670050e3"]}<<]]]]], getData()=null, getTemplate()=null, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
2022-05-10 08:37:37.826  INFO 1268 --- [          Bot-1] s.w.r.t.AbstractResourceTemplateProvider : Template:
org.finos.springbot.teams.response.templating.MarkupAndEntities@7ab86282
2022-05-10 09:00:37.970  INFO 1268 --- [          Bot-1] s.w.r.t.AbstractResourceTemplateProvider : Reverting to default template for MessageResponse [m=Message [[Paragraph [[Word [redirect], Word [job], Word [now], Word [placed], Word [in], Word [queue], Word [with], Word [>>{"JobIds":["30868810-27b7-4947-b79b-9c6c0e5fe3f7"]}<<]]]]], getData()=null, getTemplate()=null, getAddress()=org.finos.springbot.teams.content.TeamsUser@3d29871a]
2022-05-10 09:00:37.970  INFO 1268 --- [          Bot-1] s.w.r.t.AbstractResourceTemplateProvider : Template:
org.finos.springbot.teams.response.templating.MarkupAndEntities@23c7a1ad
2022-05-10 09:06:25.353  INFO 1268 --- [          Bot-1] s.w.r.t.AbstractResourceTemplateProvider : Reverting to default template for MessageResponse [m=Message [[Paragraph [[Word [redirect], Word [job], Word [now], Word [placed], Word [in], Word [queue], Word [with], Word [>>{"JobIds":["9555b6d7-829b-41bf-a54c-8bc1eb285c40"]}<<]]]]], getData()=null, getTemplate()=null, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
2022-05-10 09:06:25.353  INFO 1268 --- [          Bot-1] s.w.r.t.AbstractResourceTemplateProvider : Template:
org.finos.springbot.teams.response.templating.MarkupAndEntities@20053d9a
2022-05-10 09:09:46.906  INFO 1268 --- [          Bot-0] s.w.r.t.AbstractResourceTemplateProvider : Reverting to default template for MessageResponse [m=Message [[Paragraph [[Word [redirect], Word [job], Word [now], Word [placed], Word [in], Word [queue], Word [with], Word [>>{"JobIds":["59a6622f-85b8-41eb-ae8e-8d12f6d923b5"]}<<]]]]], getData()=null, getTemplate()=null, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
2022-05-10 09:09:46.906  INFO 1268 --- [          Bot-0] s.w.r.t.AbstractResourceTemplateProvider : Template:
org.finos.springbot.teams.response.templating.MarkupAndEntities@18219c53
2022-05-17 12:16:42.263  INFO 1268 --- [          Bot-0] s.w.r.t.AbstractResourceTemplateProvider : Reverting to default template for WorkResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@765ff0d5, form=org.finos.springbot.workflow.help.HelpPage@59addfe0, header=org.finos.springbot.workflow.tags.HeaderDetails@6c64551, errors=org.finos.springbot.workflow.form.ErrorMap@4508a28}, getTemplateName()=help-template, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
2022-05-17 12:16:42.263 ERROR 1268 --- [          Bot-0] s.w.j.m.ChatHandlerMappingActionConsumer : Couldn't process org.finos.springbot.workflow.actions.SimpleMessageAction@3a6587a0, error Couldn't handle response WorkResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@765ff0d5, form=org.finos.springbot.workflow.help.HelpPage@59addfe0, header=org.finos.springbot.workflow.tags.HeaderDetails@6c64551, errors=org.finos.springbot.workflow.form.ErrorMap@4508a28}, getTemplateName()=help-template, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
2022-05-17 12:16:42.267 ERROR 1268 --- [          Bot-0] o.f.s.w.a.c.ChatWorkflowErrorHandler     : Error thrown:

org.finos.springbot.teams.TeamsException: Couldn't handle response WorkResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@765ff0d5, form=org.finos.springbot.workflow.help.HelpPage@59addfe0, header=org.finos.springbot.workflow.tags.HeaderDetails@6c64551, errors=org.finos.springbot.workflow.form.ErrorMap@4508a28}, getTemplateName()=help-template, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:119) ~[teams-chat-workflow-spring-boot-starter-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:42) ~[teams-chat-workflow-spring-boot-starter-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.ChatWorkflowConfig$1.lambda$accept$0(ChatWorkflowConfig.java:140) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]
        at org.finos.springbot.ChatWorkflowConfig$1.accept(ChatWorkflowConfig.java:140) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.ChatWorkflowConfig$1.accept(ChatWorkflowConfig.java:136) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.workflow.java.converters.WorkResponseConverter.accept(WorkResponseConverter.java:25) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.workflow.java.converters.WorkResponseConverter.accept(WorkResponseConverter.java:16) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.ChatWorkflowConfig$2.lambda$accept$0(ChatWorkflowConfig.java:154) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]
        at org.finos.springbot.ChatWorkflowConfig$2.accept(ChatWorkflowConfig.java:154) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.ChatWorkflowConfig$2.accept(ChatWorkflowConfig.java:150) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.workflow.java.mapping.AbstractHandlerExecutor.execute(AbstractHandlerExecutor.java:55) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.lambda$handle$1(ChatHandlerMappingActionConsumer.java:32) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) ~[na:na]
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658) ~[na:na]
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.handle(ChatHandlerMappingActionConsumer.java:30) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.lambda$acceptInner$0(ChatHandlerMappingActionConsumer.java:26) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) ~[na:na]
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658) ~[na:na]
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.acceptInner(ChatHandlerMappingActionConsumer.java:26) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.workflow.actions.consumers.AbstractAddressedActionConsumer.accept(AbstractAddressedActionConsumer.java:30) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.workflow.actions.consumers.AbstractAddressedActionConsumer.accept(AbstractAddressedActionConsumer.java:16) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.teams.messages.MessageActivityHandler.handleActivity(MessageActivityHandler.java:78) ~[teams-chat-workflow-spring-boot-starter-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.teams.messages.MessageActivityHandler.lambda$onMessageActivity$0(MessageActivityHandler.java:64) ~[teams-chat-workflow-spring-boot-starter-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at java.base/java.util.concurrent.CompletableFuture.uniRunNow(CompletableFuture.java:815) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.uniRunStage(CompletableFuture.java:799) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.thenRun(CompletableFuture.java:2121) ~[na:na]
        at org.finos.springbot.teams.messages.MessageActivityHandler.onMessageActivity(MessageActivityHandler.java:64) ~[teams-chat-workflow-spring-boot-starter-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at com.microsoft.bot.builder.ActivityHandler.onTurn(ActivityHandler.java:78) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:99) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.MiddlewareSet.lambda$receiveActivityInternal$1(MiddlewareSet.java:110) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.BotFrameworkAdapter$TenantIdWorkaroundForTeamsMiddleware.onTurn(BotFrameworkAdapter.java:1430) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:109) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:74) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityWithStatus(MiddlewareSet.java:67) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.BotAdapter.runPipeline(BotAdapter.java:206) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.BotFrameworkAdapter.lambda$processActivity$2(BotFrameworkAdapter.java:478) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1106) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2235) ~[na:na]
        at com.microsoft.bot.builder.BotFrameworkAdapter.processActivity(BotFrameworkAdapter.java:476) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.BotFrameworkAdapter.lambda$processActivity$1(BotFrameworkAdapter.java:433) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1072) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1705) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692) ~[na:na]
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) ~[na:na]
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) ~[na:na]
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) ~[na:na]
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) ~[na:na]
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) ~[na:na]
Caused by: java.lang.UnsupportedOperationException: Don't know how to construct default template for WorkResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@765ff0d5, form=org.finos.springbot.workflow.help.HelpPage@59addfe0, header=org.finos.springbot.workflow.tags.HeaderDetails@6c64551, errors=org.finos.springbot.workflow.form.ErrorMap@4508a28}, getTemplateName()=help-template, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
        at org.finos.springbot.teams.templating.thymeleaf.ThymeleafTemplateProvider.getDefaultTemplate(ThymeleafTemplateProvider.java:58) ~[teams-chat-workflow-spring-boot-starter-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.teams.templating.thymeleaf.ThymeleafTemplateProvider.getDefaultTemplate(ThymeleafTemplateProvider.java:30) ~[teams-chat-workflow-spring-boot-starter-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.workflow.response.templating.AbstractResourceTemplateProvider.template(AbstractResourceTemplateProvider.java:37) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:109) ~[teams-chat-workflow-spring-boot-starter-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        ... 50 common frames omitted

2022-05-17 12:16:42.273  INFO 1268 --- [          Bot-0] s.w.r.t.AbstractResourceTemplateProvider : Reverting to default template for ErrorResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@1361c59f, header=org.finos.springbot.workflow.tags.HeaderDetails@4896ad7b, error=org.finos.springbot.teams.TeamsException: Couldn't handle response WorkResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@765ff0d5, form=org.finos.springbot.workflow.help.HelpPage@59addfe0, header=org.finos.springbot.workflow.tags.HeaderDetails@6c64551, errors=org.finos.springbot.workflow.form.ErrorMap@4508a28}, getTemplateName()=help-template, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:119)
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:42)
        at org.finos.springbot.ChatWorkflowConfig$1.lambda$accept$0(ChatWorkflowConfig.java:140)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
        at org.finos.springbot.ChatWorkflowConfig$1.accept(ChatWorkflowConfig.java:140)
        at org.finos.springbot.ChatWorkflowConfig$1.accept(ChatWorkflowConfig.java:136)
        at org.finos.springbot.workflow.java.converters.WorkResponseConverter.accept(WorkResponseConverter.java:25)
        at org.finos.springbot.workflow.java.converters.WorkResponseConverter.accept(WorkResponseConverter.java:16)
        at org.finos.springbot.ChatWorkflowConfig$2.lambda$accept$0(ChatWorkflowConfig.java:154)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
        at org.finos.springbot.ChatWorkflowConfig$2.accept(ChatWorkflowConfig.java:154)
        at org.finos.springbot.ChatWorkflowConfig$2.accept(ChatWorkflowConfig.java:150)
        at org.finos.springbot.workflow.java.mapping.AbstractHandlerExecutor.execute(AbstractHandlerExecutor.java:55)
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.lambda$handle$1(ChatHandlerMappingActionConsumer.java:32)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.handle(ChatHandlerMappingActionConsumer.java:30)
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.lambda$acceptInner$0(ChatHandlerMappingActionConsumer.java:26)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.acceptInner(ChatHandlerMappingActionConsumer.java:26)
        at org.finos.springbot.workflow.actions.consumers.AbstractAddressedActionConsumer.accept(AbstractAddressedActionConsumer.java:30)
        at org.finos.springbot.workflow.actions.consumers.AbstractAddressedActionConsumer.accept(AbstractAddressedActionConsumer.java:16)
        at org.finos.springbot.teams.messages.MessageActivityHandler.handleActivity(MessageActivityHandler.java:78)
        at org.finos.springbot.teams.messages.MessageActivityHandler.lambda$onMessageActivity$0(MessageActivityHandler.java:64)
        at java.base/java.util.concurrent.CompletableFuture.uniRunNow(CompletableFuture.java:815)
        at java.base/java.util.concurrent.CompletableFuture.uniRunStage(CompletableFuture.java:799)
        at java.base/java.util.concurrent.CompletableFuture.thenRun(CompletableFuture.java:2121)
        at org.finos.springbot.teams.messages.MessageActivityHandler.onMessageActivity(MessageActivityHandler.java:64)
        at com.microsoft.bot.builder.ActivityHandler.onTurn(ActivityHandler.java:78)
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:99)
        at com.microsoft.bot.builder.MiddlewareSet.lambda$receiveActivityInternal$1(MiddlewareSet.java:110)
        at com.microsoft.bot.builder.BotFrameworkAdapter$TenantIdWorkaroundForTeamsMiddleware.onTurn(BotFrameworkAdapter.java:1430)
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:109)
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:74)
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityWithStatus(MiddlewareSet.java:67)
        at com.microsoft.bot.builder.BotAdapter.runPipeline(BotAdapter.java:206)
        at com.microsoft.bot.builder.BotFrameworkAdapter.lambda$processActivity$2(BotFrameworkAdapter.java:478)
        at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1106)
        at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2235)
        at com.microsoft.bot.builder.BotFrameworkAdapter.processActivity(BotFrameworkAdapter.java:476)
        at com.microsoft.bot.builder.BotFrameworkAdapter.lambda$processActivity$1(BotFrameworkAdapter.java:433)
        at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1072)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1705)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.UnsupportedOperationException: Don't know how to construct default template for WorkResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@765ff0d5, form=org.finos.springbot.workflow.help.HelpPage@59addfe0, header=org.finos.springbot.workflow.tags.HeaderDetails@6c64551, errors=org.finos.springbot.workflow.form.ErrorMap@4508a28}, getTemplateName()=help-template, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
        at org.finos.springbot.teams.templating.thymeleaf.ThymeleafTemplateProvider.getDefaultTemplate(ThymeleafTemplateProvider.java:58)
        at org.finos.springbot.teams.templating.thymeleaf.ThymeleafTemplateProvider.getDefaultTemplate(ThymeleafTemplateProvider.java:30)
        at org.finos.springbot.workflow.response.templating.AbstractResourceTemplateProvider.template(AbstractResourceTemplateProvider.java:37)
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:109)
        ... 50 more
, message=Couldn't handle response WorkResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@765ff0d5, form=org.finos.springbot.workflow.help.HelpPage@59addfe0, header=org.finos.springbot.workflow.tags.HeaderDetails@6c64551, errors=org.finos.springbot.workflow.form.ErrorMap@4508a28}, getTemplateName()=help-template, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]}, getTemplateName()=default-error, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
2022-05-17 12:16:42.273  WARN 1268 --- [          Bot-0] o.f.s.w.a.c.ChatWorkflowErrorHandler     : Couldn't return error ErrorResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@1361c59f, header=org.finos.springbot.workflow.tags.HeaderDetails@4896ad7b, error=org.finos.springbot.teams.TeamsException: Couldn't handle response WorkResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@765ff0d5, form=org.finos.springbot.workflow.help.HelpPage@59addfe0, header=org.finos.springbot.workflow.tags.HeaderDetails@6c64551, errors=org.finos.springbot.workflow.form.ErrorMap@4508a28}, getTemplateName()=help-template, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:119)
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:42)
        at org.finos.springbot.ChatWorkflowConfig$1.lambda$accept$0(ChatWorkflowConfig.java:140)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
        at org.finos.springbot.ChatWorkflowConfig$1.accept(ChatWorkflowConfig.java:140)
        at org.finos.springbot.ChatWorkflowConfig$1.accept(ChatWorkflowConfig.java:136)
        at org.finos.springbot.workflow.java.converters.WorkResponseConverter.accept(WorkResponseConverter.java:25)
        at org.finos.springbot.workflow.java.converters.WorkResponseConverter.accept(WorkResponseConverter.java:16)
        at org.finos.springbot.ChatWorkflowConfig$2.lambda$accept$0(ChatWorkflowConfig.java:154)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
        at org.finos.springbot.ChatWorkflowConfig$2.accept(ChatWorkflowConfig.java:154)
        at org.finos.springbot.ChatWorkflowConfig$2.accept(ChatWorkflowConfig.java:150)
        at org.finos.springbot.workflow.java.mapping.AbstractHandlerExecutor.execute(AbstractHandlerExecutor.java:55)
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.lambda$handle$1(ChatHandlerMappingActionConsumer.java:32)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.handle(ChatHandlerMappingActionConsumer.java:30)
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.lambda$acceptInner$0(ChatHandlerMappingActionConsumer.java:26)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.acceptInner(ChatHandlerMappingActionConsumer.java:26)
        at org.finos.springbot.workflow.actions.consumers.AbstractAddressedActionConsumer.accept(AbstractAddressedActionConsumer.java:30)
        at org.finos.springbot.workflow.actions.consumers.AbstractAddressedActionConsumer.accept(AbstractAddressedActionConsumer.java:16)
        at org.finos.springbot.teams.messages.MessageActivityHandler.handleActivity(MessageActivityHandler.java:78)
        at org.finos.springbot.teams.messages.MessageActivityHandler.lambda$onMessageActivity$0(MessageActivityHandler.java:64)
        at java.base/java.util.concurrent.CompletableFuture.uniRunNow(CompletableFuture.java:815)
        at java.base/java.util.concurrent.CompletableFuture.uniRunStage(CompletableFuture.java:799)
        at java.base/java.util.concurrent.CompletableFuture.thenRun(CompletableFuture.java:2121)
        at org.finos.springbot.teams.messages.MessageActivityHandler.onMessageActivity(MessageActivityHandler.java:64)
        at com.microsoft.bot.builder.ActivityHandler.onTurn(ActivityHandler.java:78)
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:99)
        at com.microsoft.bot.builder.MiddlewareSet.lambda$receiveActivityInternal$1(MiddlewareSet.java:110)
        at com.microsoft.bot.builder.BotFrameworkAdapter$TenantIdWorkaroundForTeamsMiddleware.onTurn(BotFrameworkAdapter.java:1430)
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:109)
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:74)
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityWithStatus(MiddlewareSet.java:67)
        at com.microsoft.bot.builder.BotAdapter.runPipeline(BotAdapter.java:206)
        at com.microsoft.bot.builder.BotFrameworkAdapter.lambda$processActivity$2(BotFrameworkAdapter.java:478)
        at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1106)
        at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2235)
        at com.microsoft.bot.builder.BotFrameworkAdapter.processActivity(BotFrameworkAdapter.java:476)
        at com.microsoft.bot.builder.BotFrameworkAdapter.lambda$processActivity$1(BotFrameworkAdapter.java:433)
        at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1072)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1705)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.UnsupportedOperationException: Don't know how to construct default template for WorkResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@765ff0d5, form=org.finos.springbot.workflow.help.HelpPage@59addfe0, header=org.finos.springbot.workflow.tags.HeaderDetails@6c64551, errors=org.finos.springbot.workflow.form.ErrorMap@4508a28}, getTemplateName()=help-template, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
        at org.finos.springbot.teams.templating.thymeleaf.ThymeleafTemplateProvider.getDefaultTemplate(ThymeleafTemplateProvider.java:58)
        at org.finos.springbot.teams.templating.thymeleaf.ThymeleafTemplateProvider.getDefaultTemplate(ThymeleafTemplateProvider.java:30)
        at org.finos.springbot.workflow.response.templating.AbstractResourceTemplateProvider.template(AbstractResourceTemplateProvider.java:37)
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:109)
        ... 50 more
, message=Couldn't handle response WorkResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@765ff0d5, form=org.finos.springbot.workflow.help.HelpPage@59addfe0, header=org.finos.springbot.workflow.tags.HeaderDetails@6c64551, errors=org.finos.springbot.workflow.form.ErrorMap@4508a28}, getTemplateName()=help-template, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]}, getTemplateName()=default-error, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d] due to error {}

org.finos.springbot.teams.TeamsException: Couldn't handle response ErrorResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@1361c59f, header=org.finos.springbot.workflow.tags.HeaderDetails@4896ad7b, error=org.finos.springbot.teams.TeamsException: Couldn't handle response WorkResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@765ff0d5, form=org.finos.springbot.workflow.help.HelpPage@59addfe0, header=org.finos.springbot.workflow.tags.HeaderDetails@6c64551, errors=org.finos.springbot.workflow.form.ErrorMap@4508a28}, getTemplateName()=help-template, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:119)
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:42)
        at org.finos.springbot.ChatWorkflowConfig$1.lambda$accept$0(ChatWorkflowConfig.java:140)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
        at org.finos.springbot.ChatWorkflowConfig$1.accept(ChatWorkflowConfig.java:140)
        at org.finos.springbot.ChatWorkflowConfig$1.accept(ChatWorkflowConfig.java:136)
        at org.finos.springbot.workflow.java.converters.WorkResponseConverter.accept(WorkResponseConverter.java:25)
        at org.finos.springbot.workflow.java.converters.WorkResponseConverter.accept(WorkResponseConverter.java:16)
        at org.finos.springbot.ChatWorkflowConfig$2.lambda$accept$0(ChatWorkflowConfig.java:154)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
        at org.finos.springbot.ChatWorkflowConfig$2.accept(ChatWorkflowConfig.java:154)
        at org.finos.springbot.ChatWorkflowConfig$2.accept(ChatWorkflowConfig.java:150)
        at org.finos.springbot.workflow.java.mapping.AbstractHandlerExecutor.execute(AbstractHandlerExecutor.java:55)
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.lambda$handle$1(ChatHandlerMappingActionConsumer.java:32)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.handle(ChatHandlerMappingActionConsumer.java:30)
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.lambda$acceptInner$0(ChatHandlerMappingActionConsumer.java:26)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.acceptInner(ChatHandlerMappingActionConsumer.java:26)
        at org.finos.springbot.workflow.actions.consumers.AbstractAddressedActionConsumer.accept(AbstractAddressedActionConsumer.java:30)
        at org.finos.springbot.workflow.actions.consumers.AbstractAddressedActionConsumer.accept(AbstractAddressedActionConsumer.java:16)
        at org.finos.springbot.teams.messages.MessageActivityHandler.handleActivity(MessageActivityHandler.java:78)
        at org.finos.springbot.teams.messages.MessageActivityHandler.lambda$onMessageActivity$0(MessageActivityHandler.java:64)
        at java.base/java.util.concurrent.CompletableFuture.uniRunNow(CompletableFuture.java:815)
        at java.base/java.util.concurrent.CompletableFuture.uniRunStage(CompletableFuture.java:799)
        at java.base/java.util.concurrent.CompletableFuture.thenRun(CompletableFuture.java:2121)
        at org.finos.springbot.teams.messages.MessageActivityHandler.onMessageActivity(MessageActivityHandler.java:64)
        at com.microsoft.bot.builder.ActivityHandler.onTurn(ActivityHandler.java:78)
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:99)
        at com.microsoft.bot.builder.MiddlewareSet.lambda$receiveActivityInternal$1(MiddlewareSet.java:110)
        at com.microsoft.bot.builder.BotFrameworkAdapter$TenantIdWorkaroundForTeamsMiddleware.onTurn(BotFrameworkAdapter.java:1430)
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:109)
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:74)
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityWithStatus(MiddlewareSet.java:67)
        at com.microsoft.bot.builder.BotAdapter.runPipeline(BotAdapter.java:206)
        at com.microsoft.bot.builder.BotFrameworkAdapter.lambda$processActivity$2(BotFrameworkAdapter.java:478)
        at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1106)
        at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2235)
        at com.microsoft.bot.builder.BotFrameworkAdapter.processActivity(BotFrameworkAdapter.java:476)
        at com.microsoft.bot.builder.BotFrameworkAdapter.lambda$processActivity$1(BotFrameworkAdapter.java:433)
        at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1072)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1705)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.UnsupportedOperationException: Don't know how to construct default template for WorkResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@765ff0d5, form=org.finos.springbot.workflow.help.HelpPage@59addfe0, header=org.finos.springbot.workflow.tags.HeaderDetails@6c64551, errors=org.finos.springbot.workflow.form.ErrorMap@4508a28}, getTemplateName()=help-template, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
        at org.finos.springbot.teams.templating.thymeleaf.ThymeleafTemplateProvider.getDefaultTemplate(ThymeleafTemplateProvider.java:58)
        at org.finos.springbot.teams.templating.thymeleaf.ThymeleafTemplateProvider.getDefaultTemplate(ThymeleafTemplateProvider.java:30)
        at org.finos.springbot.workflow.response.templating.AbstractResourceTemplateProvider.template(AbstractResourceTemplateProvider.java:37)
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:109)
        ... 50 more
, message=Couldn't handle response WorkResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@765ff0d5, form=org.finos.springbot.workflow.help.HelpPage@59addfe0, header=org.finos.springbot.workflow.tags.HeaderDetails@6c64551, errors=org.finos.springbot.workflow.form.ErrorMap@4508a28}, getTemplateName()=help-template, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]}, getTemplateName()=default-error, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:119) ~[teams-chat-workflow-spring-boot-starter-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:42) ~[teams-chat-workflow-spring-boot-starter-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.ChatWorkflowConfig$1.lambda$accept$0(ChatWorkflowConfig.java:140) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1541) ~[na:na]
        at org.finos.springbot.ChatWorkflowConfig$1.accept(ChatWorkflowConfig.java:140) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.ChatWorkflowConfig$1.accept(ChatWorkflowConfig.java:136) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.workflow.actions.consumers.ChatWorkflowErrorHandler.handleError(ChatWorkflowErrorHandler.java:32) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.lambda$handle$1(ChatHandlerMappingActionConsumer.java:36) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) ~[na:na]
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658) ~[na:na]
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.handle(ChatHandlerMappingActionConsumer.java:30) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.lambda$acceptInner$0(ChatHandlerMappingActionConsumer.java:26) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655) ~[na:na]
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658) ~[na:na]
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.acceptInner(ChatHandlerMappingActionConsumer.java:26) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.workflow.actions.consumers.AbstractAddressedActionConsumer.accept(AbstractAddressedActionConsumer.java:30) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.workflow.actions.consumers.AbstractAddressedActionConsumer.accept(AbstractAddressedActionConsumer.java:16) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.teams.messages.MessageActivityHandler.handleActivity(MessageActivityHandler.java:78) ~[teams-chat-workflow-spring-boot-starter-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.teams.messages.MessageActivityHandler.lambda$onMessageActivity$0(MessageActivityHandler.java:64) ~[teams-chat-workflow-spring-boot-starter-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at java.base/java.util.concurrent.CompletableFuture.uniRunNow(CompletableFuture.java:815) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.uniRunStage(CompletableFuture.java:799) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.thenRun(CompletableFuture.java:2121) ~[na:na]
        at org.finos.springbot.teams.messages.MessageActivityHandler.onMessageActivity(MessageActivityHandler.java:64) ~[teams-chat-workflow-spring-boot-starter-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at com.microsoft.bot.builder.ActivityHandler.onTurn(ActivityHandler.java:78) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:99) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.MiddlewareSet.lambda$receiveActivityInternal$1(MiddlewareSet.java:110) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.BotFrameworkAdapter$TenantIdWorkaroundForTeamsMiddleware.onTurn(BotFrameworkAdapter.java:1430) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:109) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:74) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityWithStatus(MiddlewareSet.java:67) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.BotAdapter.runPipeline(BotAdapter.java:206) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.BotFrameworkAdapter.lambda$processActivity$2(BotFrameworkAdapter.java:478) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1106) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2235) ~[na:na]
        at com.microsoft.bot.builder.BotFrameworkAdapter.processActivity(BotFrameworkAdapter.java:476) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at com.microsoft.bot.builder.BotFrameworkAdapter.lambda$processActivity$1(BotFrameworkAdapter.java:433) ~[bot-builder-4.14.2.jar!/:4.14.2]
        at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1072) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1705) ~[na:na]
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692) ~[na:na]
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) ~[na:na]
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) ~[na:na]
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) ~[na:na]
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) ~[na:na]
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) ~[na:na]
Caused by: java.lang.UnsupportedOperationException: Don't know how to construct default template for ErrorResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@1361c59f, header=org.finos.springbot.workflow.tags.HeaderDetails@4896ad7b, error=org.finos.springbot.teams.TeamsException: Couldn't handle response WorkResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@765ff0d5, form=org.finos.springbot.workflow.help.HelpPage@59addfe0, header=org.finos.springbot.workflow.tags.HeaderDetails@6c64551, errors=org.finos.springbot.workflow.form.ErrorMap@4508a28}, getTemplateName()=help-template, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:119)
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:42)
        at org.finos.springbot.ChatWorkflowConfig$1.lambda$accept$0(ChatWorkflowConfig.java:140)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
        at org.finos.springbot.ChatWorkflowConfig$1.accept(ChatWorkflowConfig.java:140)
        at org.finos.springbot.ChatWorkflowConfig$1.accept(ChatWorkflowConfig.java:136)
        at org.finos.springbot.workflow.java.converters.WorkResponseConverter.accept(WorkResponseConverter.java:25)
        at org.finos.springbot.workflow.java.converters.WorkResponseConverter.accept(WorkResponseConverter.java:16)
        at org.finos.springbot.ChatWorkflowConfig$2.lambda$accept$0(ChatWorkflowConfig.java:154)
        at java.base/java.util.ArrayList.forEach(ArrayList.java:1541)
        at org.finos.springbot.ChatWorkflowConfig$2.accept(ChatWorkflowConfig.java:154)
        at org.finos.springbot.ChatWorkflowConfig$2.accept(ChatWorkflowConfig.java:150)
        at org.finos.springbot.workflow.java.mapping.AbstractHandlerExecutor.execute(AbstractHandlerExecutor.java:55)
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.lambda$handle$1(ChatHandlerMappingActionConsumer.java:32)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.handle(ChatHandlerMappingActionConsumer.java:30)
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.lambda$acceptInner$0(ChatHandlerMappingActionConsumer.java:26)
        at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1655)
        at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:658)
        at org.finos.springbot.workflow.java.mapping.ChatHandlerMappingActionConsumer.acceptInner(ChatHandlerMappingActionConsumer.java:26)
        at org.finos.springbot.workflow.actions.consumers.AbstractAddressedActionConsumer.accept(AbstractAddressedActionConsumer.java:30)
        at org.finos.springbot.workflow.actions.consumers.AbstractAddressedActionConsumer.accept(AbstractAddressedActionConsumer.java:16)
        at org.finos.springbot.teams.messages.MessageActivityHandler.handleActivity(MessageActivityHandler.java:78)
        at org.finos.springbot.teams.messages.MessageActivityHandler.lambda$onMessageActivity$0(MessageActivityHandler.java:64)
        at java.base/java.util.concurrent.CompletableFuture.uniRunNow(CompletableFuture.java:815)
        at java.base/java.util.concurrent.CompletableFuture.uniRunStage(CompletableFuture.java:799)
        at java.base/java.util.concurrent.CompletableFuture.thenRun(CompletableFuture.java:2121)
        at org.finos.springbot.teams.messages.MessageActivityHandler.onMessageActivity(MessageActivityHandler.java:64)
        at com.microsoft.bot.builder.ActivityHandler.onTurn(ActivityHandler.java:78)
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:99)
        at com.microsoft.bot.builder.MiddlewareSet.lambda$receiveActivityInternal$1(MiddlewareSet.java:110)
        at com.microsoft.bot.builder.BotFrameworkAdapter$TenantIdWorkaroundForTeamsMiddleware.onTurn(BotFrameworkAdapter.java:1430)
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:109)
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityInternal(MiddlewareSet.java:74)
        at com.microsoft.bot.builder.MiddlewareSet.receiveActivityWithStatus(MiddlewareSet.java:67)
        at com.microsoft.bot.builder.BotAdapter.runPipeline(BotAdapter.java:206)
        at com.microsoft.bot.builder.BotFrameworkAdapter.lambda$processActivity$2(BotFrameworkAdapter.java:478)
        at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1106)
        at java.base/java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2235)
        at com.microsoft.bot.builder.BotFrameworkAdapter.processActivity(BotFrameworkAdapter.java:476)
        at com.microsoft.bot.builder.BotFrameworkAdapter.lambda$processActivity$1(BotFrameworkAdapter.java:433)
        at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1072)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:506)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1705)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1692)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.UnsupportedOperationException: Don't know how to construct default template for WorkResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@765ff0d5, form=org.finos.springbot.workflow.help.HelpPage@59addfe0, header=org.finos.springbot.workflow.tags.HeaderDetails@6c64551, errors=org.finos.springbot.workflow.form.ErrorMap@4508a28}, getTemplateName()=help-template, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
        at org.finos.springbot.teams.templating.thymeleaf.ThymeleafTemplateProvider.getDefaultTemplate(ThymeleafTemplateProvider.java:58)
        at org.finos.springbot.teams.templating.thymeleaf.ThymeleafTemplateProvider.getDefaultTemplate(ThymeleafTemplateProvider.java:30)
        at org.finos.springbot.workflow.response.templating.AbstractResourceTemplateProvider.template(AbstractResourceTemplateProvider.java:37)
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:109)
        ... 50 more
, message=Couldn't handle response WorkResponse [getData()={buttons=org.finos.springbot.workflow.form.ButtonList@765ff0d5, form=org.finos.springbot.workflow.help.HelpPage@59addfe0, header=org.finos.springbot.workflow.tags.HeaderDetails@6c64551, errors=org.finos.springbot.workflow.form.ErrorMap@4508a28}, getTemplateName()=help-template, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]}, getTemplateName()=default-error, getAddress()=org.finos.springbot.teams.content.TeamsUser@55566e3d]
        at org.finos.springbot.teams.templating.thymeleaf.ThymeleafTemplateProvider.getDefaultTemplate(ThymeleafTemplateProvider.java:58) ~[teams-chat-workflow-spring-boot-starter-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.teams.templating.thymeleaf.ThymeleafTemplateProvider.getDefaultTemplate(ThymeleafTemplateProvider.java:30) ~[teams-chat-workflow-spring-boot-starter-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.workflow.response.templating.AbstractResourceTemplateProvider.template(AbstractResourceTemplateProvider.java:37) ~[chat-workflow-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        at org.finos.springbot.teams.handlers.TeamsResponseHandler.accept(TeamsResponseHandler.java:109) ~[teams-chat-workflow-spring-boot-starter-9.0.0.BETA2.jar!/:9.0.0.BETA2]
        ... 44 common frames omitted












@robmoffat
Copy link
Member

  • So, you're asking for help.
  • And the template is help-template.

This line:

Caused by: java.lang.UnsupportedOperationException: Don't know how to construct default template for WorkResponse ...
org.finos.springbot.teams.templating.thymeleaf.ThymeleafTemplateProvider.getDefaultTemplate(ThymeleafTemplateProvider.java:58)

  • means it failed to resolve the help-template and instead tried to do a default template.

To me, this points to a classpath problem with AbstractResourceTemplateProvider, line 58:

	protected InputStream loadTemplateStream(String name) throws IOException {
		return getResource(name).getInputStream();
	}

Is there any way you can debug at this line and tell me what happens with the getResource() call?

@nmwael
Copy link
Author

nmwael commented May 20, 2022

from what I can see it tries to discover the template from classpath but cannot find it, I susspect it has something todo with the way thymeleaf class path scanning are setup? its a little different when running in a fat jar.

@robmoffat
Copy link
Member

yeah I was also trying to replicate the problem by running from the fat jar. I couldn't replicate it though - hence me asking you.

Maybe it's a java version or something?

Anyway, if you can get back to me on the above maybe we can figure it out together

@nmwael
Copy link
Author

nmwael commented May 23, 2022

Okay, so this is the java version:
On windows 2022
C:\Users\Administrator>java -version
openjdk version "11.0.15" 2022-04-19
OpenJDK Runtime Environment Temurin-11.0.15+10 (build 11.0.15+10)
OpenJDK 64-Bit Server VM Temurin-11.0.15+10 (build 11.0.15+10, mixed mode)

@robmoffat
Copy link
Member

You know maybe it'd be easier if we did this on a call? My email is rob -at- kite9 -dot- com - can you drop me a mail and we'll try and schedule something? I think it'd be easier if I see it running on your machine. I'd definitely like to get to the bottom of this.

Are you ok with that?

@robmoffat
Copy link
Member

robmoffat commented Jun 29, 2022

We managed to reproduce this on a call.

Looking at it, symphony looks for this:

TEMPLATE LOCATION: classpath:/templates/symphony/help-template.ftl

whereas teams does this:

TEMPLATE LOCATION: classpath:/templates/teams/help-template.html
TEMPLATE LOCATION: classpath:/templates/teams/help-template.json
TEMPLATE LOCATION: classpath:/templates/teams/help-template.html

We attached a debugger:

 java  -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000  -jar spring-bot/demos/todo-bot/target/todo-bot-9.0.1-SNAPSHOT.jar

Debugging into AbstractResourceTemplateProvider, getResource, we can call this from the debugger:

rl.getResource("classpath:/templates/symphony/help-template.ftl").exists()

This works from the Symphony bean, but fails from the teams bean.

rl is the same in both: org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext@932bc4a, started on Wed Jun 29 12:12:07 BST 2022

The resource looks like this from teams:

	ClassPathResource  (id=678)	
	classLoader	ClassLoaders$AppClassLoader  (id=320)	
	clazz	null	
	path	"templates/teams/help-template.html" (id=682)	

Whereas from symphony it looks like this:

org.springframework.boot.loader.LaunchedURLClassLoader@482f8f11
null
templates/symphony/help-template.ftl

Thymeleaf Engine is loaded using LaunchedURLClassLoader

When we call the code from Symphony, it uses Thread.currentThread().getContextClassLoader() thread = SimpleAsyncTaskExecutor-17

When done from teams, it uses Thread.currentThread().getContextClassLoader(); thread = Bot-9

@robmoffat
Copy link
Member

Answer is to set the class loader on the ResourceLoader that all these templaters use, rather than allowing it to default to Thread.currentThread().getContextClassLoader()

@nmwael
Copy link
Author

nmwael commented Jun 30, 2022

I've tried this in my spring boot project:

    @PostConstruct
    public void setResourceLoader() {
        System.out.println("rl = " + rl);
        System.out.println("cl = " + rl.getClassLoader());
        Resource resource = rl.getResource("classpath:/templates/teams/help-template.html");

    }

rl = org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServ
erApplicationContext@429bffaa, started on Thu Jun 30 07:41:16 CEST 2022
cl = org.springframework.boot.loader.LaunchedURLClassLoader@4501b7af
resource.exists() = true

In the fat jar..

@robmoffat
Copy link
Member

robmoffat commented Jul 4, 2022 via email

@nmwael
Copy link
Author

nmwael commented Jul 4, 2022 via email

@robmoffat
Copy link
Member

Ok, I had a spare few minutes right now. The reason you get exists() == true in your code above is because the resource loader defaults to using the current thread's classloader.

As we discovered last week, teams is doing some shenanigans with it's thread pool, and the teams threads end up with a different class loader. So, this is why templates got loaded in symphony but not teams.

To fix this, we have to supply a classloader, so the default one isn't used.

I tested this code out inside ToDoWorkflowApp:

  /**
     * https://github.com/finos/spring-bot/issues/340
     */
    @PostConstruct
    public void setResourceLoaderClassLoader() {
        rl.setClassLoader(this.getClass().getClassLoader());

    }

... and everything was well in the world!

I will submit a PR and add this to our teams library for the next version, but you should add this snippet to a spring @configuration class for now.

robmoffat added a commit that referenced this issue Jul 4, 2022
@nmwael
Copy link
Author

nmwael commented Jul 6, 2022

I can confirm this fix works for me too :) Great work and support!

@robmoffat
Copy link
Member

Pleasure working with you, Nino! Keep in touch

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