botbuilder-java icon indicating copy to clipboard operation
botbuilder-java copied to clipboard

BotDependencyConfiguration defines ExecutorService bean but its not in use

Open przem opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. The problem i've stumbled upon is that i was getting com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type `java.time.OffsetDateTime` not supported by default: add Module "com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: com.microsoft.bot.schema.Activity["timestamp"]) error for missing module that was already in the deps. The cause was that ExecutorFactory#factory was using wrong classloader and module was not there. Had to do nasty reflection tricks to exchange the factory.

Describe the solution you'd like I'd like that BotFrameworkAdapter utilize the ExecutorService spring bean. This could be done by expanding constructor of BotFrameworkAdapter to accept ExecutorService, and also other classes like BotFrameworkHttpAdapter AdapterWithErrorHandler

przem avatar Oct 14 '21 09:10 przem

@przem Hi, may I ask how you swapped out the ExecutorFactory#factory. In my case, I could not load classpath resources from within the SpringBoot jar, because of the wrong class loader ExecutorFactory#factory uses. Love to find out the fix. Appreciate it!

btw, if JDK 1.8 is used, do you still have the same issue?

johnmiroki avatar Jul 12 '22 13:07 johnmiroki