Issue while testing teneo teams connector

Hello Team,

We are implemeting the teneo teams connector in our environment.
We have followed the exact steps provided in below url.

We are using java 17 and latest maven version shown below.

$ java -version
java version “17.0.9” 2023-10-17 LTS
Java™ SE Runtime Environment (build 17.0.9+11-LTS-201)
Java HotSpot™ 64-Bit Server VM (build 17.0.9+11-LTS-201, mixed mode, sharing)

$ /data/apache-maven-3.9.6/bin/mvn -version
Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)
Maven home: /data/apache-maven-3.9.6
Java version: 17.0.9, vendor: Oracle Corporation, runtime: /usr/lib/jvm/jdk-17-oracle-x64
Default locale: en_US, platform encoding: UTF-8
OS name: “linux”, version: “4.18.0-477.27.1.el8_8.x86_64”, arch: “amd64”, family: “unix”

We started the connector and further dropped the message from “test in webchat” , but on connectoer we are receiving below error.

java.lang.NoSuchMethodError: ‘void org.springframework.http.ResponseEntity.(org.springframework.http.HttpStatus)’

Request you to please help us to resolve the issue.

Thanks and Regards,
Akshay

Providing the entire stack trace capture in debug mode.

Dec 05, 2023 2:01:49 PM org.apache.catalina.core.ApplicationContext log
INFO: Initializing Spring DispatcherServlet ‘dispatcherServlet’
[INFO ] 2023-12-05 14:01:49.700 [http-nio-8082-exec-6] DispatcherServlet - Initializing Servlet ‘dispatcherServlet’
[DEBUG] 2023-12-05 14:01:49.700 [http-nio-8082-exec-6] DispatcherServlet - Detected StandardServletMultipartResolver
[DEBUG] 2023-12-05 14:01:49.700 [http-nio-8082-exec-6] DispatcherServlet - Detected AcceptHeaderLocaleResolver
[DEBUG] 2023-12-05 14:01:49.700 [http-nio-8082-exec-6] DispatcherServlet - Detected FixedThemeResolver
[DEBUG] 2023-12-05 14:01:49.701 [http-nio-8082-exec-6] DispatcherServlet - Detected org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator@654726f9
[DEBUG] 2023-12-05 14:01:49.702 [http-nio-8082-exec-6] DispatcherServlet - Detected org.springframework.web.servlet.support.SessionFlashMapManager@44869581
[DEBUG] 2023-12-05 14:01:49.702 [http-nio-8082-exec-6] DispatcherServlet - enableLoggingRequestDetails=‘false’: request parameters and headers will be masked to prevent unsafe logging of potentially sensitive data
[INFO ] 2023-12-05 14:01:49.702 [http-nio-8082-exec-6] DispatcherServlet - Completed initialization in 2 ms
[DEBUG] 2023-12-05 14:01:49.713 [http-nio-8082-exec-6] DispatcherServlet - POST “/api/messages”, parameters={}
[DEBUG] 2023-12-05 14:01:49.729 [http-nio-8082-exec-6] RequestMappingHandlerMapping - Mapped to com.microsoft.bot.integration.spring.BotController#incoming(Activity, String)
[DEBUG] 2023-12-05 14:01:49.890 [http-nio-8082-exec-6] RequestResponseBodyMethodProcessor - Read “application/json;charset=utf-8” to [com.microsoft.bot.schema.Activity@5aba87f0]
[DEBUG] 2023-12-05 14:01:49.953 [http-nio-8082-exec-6] WebAsyncManager - Started async request
[DEBUG] 2023-12-05 14:01:49.955 [http-nio-8082-exec-6] DispatcherServlet - Exiting but response remains open for further handling
[DEBUG] 2023-12-05 14:01:50.304 [Bot-0] WebAsyncManager - Async error, dispatch to /api/messages
[DEBUG] 2023-12-05 14:01:50.322 [http-nio-8082-exec-7] DispatcherServlet - “ASYNC” dispatch for POST “/api/messages”, parameters={}
[DEBUG] 2023-12-05 14:01:50.324 [http-nio-8082-exec-7] RequestMappingHandlerAdapter - Resume with async result [java.lang.NoSuchMethodError: 'void org.springframework.http.ResponseEntity.(org.springframewor (truncated)…]
[DEBUG] 2023-12-05 14:01:50.330 [http-nio-8082-exec-7] DispatcherServlet - Unresolved failure from “ASYNC” dispatch: jakarta.servlet.ServletException: Async processing failed: java.lang.NoSuchMethodError: ‘void org.springframework.http.ResponseEntity.(org.springframework.http.HttpStatus)’
Dec 05, 2023 2:01:50 PM org.apache.catalina.core.ApplicationDispatcher invoke
SEVERE: Servlet.service() for servlet [dispatcherServlet] threw exception
java.lang.NoSuchMethodError: ‘void org.springframework.http.ResponseEntity.(org.springframework.http.HttpStatus)’
at com.microsoft.bot.integration.spring.BotController.lambda$incoming$0(BotController.java:101)
at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)
at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

Dec 05, 2023 2:01:50 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [dispatcherServlet] in context with path threw exception [Async processing failed: java.lang.NoSuchMethodError: ‘void org.springframework.http.ResponseEntity.(org.springframework.http.HttpStatus)’] with root cause
java.lang.NoSuchMethodError: ‘void org.springframework.http.ResponseEntity.(org.springframework.http.HttpStatus)’
at com.microsoft.bot.integration.spring.BotController.lambda$incoming$0(BotController.java:101)
at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)
at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911)
at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.exec(CompletableFuture.java:1760)
at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:373)
at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1182)
at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1655)
at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1622)
at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:165)

[DEBUG] 2023-12-05 14:01:50.332 [http-nio-8082-exec-7] DispatcherServlet - “ERROR” dispatch for POST “/error”, parameters={}
[DEBUG] 2023-12-05 14:01:50.333 [http-nio-8082-exec-7] RequestMappingHandlerMapping - Mapped to org.springframework.boot.autoconfigure.web.servlet.error.BasicErrorController#error(HttpServletRequest)
[DEBUG] 2023-12-05 14:01:50.346 [http-nio-8082-exec-7] HttpEntityMethodProcessor - Using ‘application/json’, given [/] and supported [application/json, application/*+json]
[DEBUG] 2023-12-05 14:01:50.349 [http-nio-8082-exec-7] HttpEntityMethodProcessor - Writing [{timestamp=Tue Dec 05 14:01:50 CET 2023, status=500, error=Internal Server Error, path=/api/messages (truncated)…]
[DEBUG] 2023-12-05 14:01:50.372 [http-nio-8082-exec-7] DispatcherServlet - Exiting from “ERROR” dispatch, status 500

Hi Akshay, Thanks for reaching out.
Given the stack trace you provided, it seems there might be an issue related to compatibility of Spring Framework Libraries. Can you check if you’re using Spring Framework 5.3 or later? The error may be due to the absence of the required constructor in your current version.

Hello,

Thank you for your response.

I can see the version is 3.0.1.

                            <groupId>org.springframework.boot</groupId>
                            <artifactId>spring-boot-maven-plugin</artifactId>
                            <version>3.0.1</version>
                            <executions>

I am providing the pom.xml. Request you to please check and let us know if we need to perform any changes in this file.

Thanks and Regards,
Akshay

<?xml version="1.0" encoding="UTF-8"?> 4.0.0
    <groupId>com.artificialsolutions.teamsconnector</groupId>
    <artifactId>asolteamsconnector</artifactId>
    <version>1.0.0</version>
    <packaging>jar</packaging>

    <name>${project.groupId}:${project.artifactId}</name>
    <description>This package contains a Java Echo.</description>
    <url>http://maven.apache.org</url>

    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>3.0.1</version>
            <relativePath />
    </parent>

    <properties>
            <java.version>17</java.version>
            <maven.compiler.target>17</maven.compiler.target>
            <maven.compiler.source>17</maven.compiler.source>
            <log4j>2.19.0</log4j>
            <start-class>com.artificialsolutions.teamsconnector.Application</start-class>
            <repo.url>https://botbuilder.myget.org/F/botbuilder-v4-java-daily/maven/</repo.url>

            <maven.compiler.source>${java.version}</maven.compiler.source>
            <maven.compiler.target>${java.version}</maven.compiler.target>
            <maven.compiler.release>${java.version}</maven.compiler.release>
            <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
            <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
            <failOnMissingWebXml>false</failOnMissingWebXml>
    </properties>

    <dependencies>
            <dependency>
                    <groupId>com.microsoft.graph</groupId>
                    <artifactId>microsoft-graph</artifactId>
                    <version>[5.0,)</version>
            </dependency>
            <dependency>
                    <groupId>com.azure</groupId>
                    <artifactId>azure-identity</artifactId>
                    <version>[1.5,)</version>
            </dependency>
            <dependency>
              <groupId>com.microsoft.bot</groupId>
              <artifactId>bot-azure</artifactId>
              <version>4.14.3</version>
            </dependency>
            <dependency>
                    <groupId>junit</groupId>
                    <artifactId>junit</artifactId>
                    <version>4.13.2</version>
                    <scope>test</scope>
            </dependency>

            <dependency>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-test</artifactId>
                    <version>3.0.1</version>
                    <scope>test</scope>
                    <exclusions>
                            <exclusion>
                                    <groupId>ch.qos.logback</groupId>
                                    <artifactId>logback-classic</artifactId>
                            </exclusion>
                            <exclusion>
                                    <groupId>org.apache.logging.log4j</groupId>
                                    <artifactId>log4j-to-slf4j</artifactId>
                            </exclusion>
                    </exclusions>
            </dependency>

            <dependency>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                    <version>5.9.1</version>
                    <scope>test</scope>
            </dependency>

            <dependency>
                    <groupId>com.microsoft.bot</groupId>
                    <artifactId>bot-integration-spring</artifactId>
                    <version>4.14.3</version>
                    <scope>compile</scope>
                    <exclusions>
                            <exclusion>
                                    <groupId>ch.qos.logback</groupId>
                                    <artifactId>logback-classic</artifactId>
                            </exclusion>
                    </exclusions>
            </dependency>

            <dependency>
                    <groupId>org.junit.jupiter</groupId>
                    <artifactId>junit-jupiter</artifactId>
                    <version>5.9.1</version>
                    <scope>test</scope>
            </dependency>

            <dependency>
                    <groupId>org.slf4j</groupId>
                    <artifactId>slf4j-api</artifactId>
                    <version>2.0.6</version>
            </dependency>

            <dependency>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-api</artifactId>
                    <version>${log4j}</version>
            </dependency>

            <dependency>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-core</artifactId>
                    <version>${log4j}</version>
            </dependency>

            <dependency>
                    <groupId>org.apache.logging.log4j</groupId>
                    <artifactId>log4j-slf4j-impl</artifactId>
                    <version>${log4j}</version>
                    <exclusions>
                            <exclusion>
                                    <groupId>org.apache.logging.log4j</groupId>
                                    <artifactId>log4j-core</artifactId>
                            </exclusion>
                    </exclusions>
            </dependency>
    </dependencies>

    <build>
            <resources>
                    <resource>
                            <directory>src/main/resources</directory>
                            <filtering>false</filtering>
                    </resource>
            </resources>

            <plugins>
                    <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-clean-plugin</artifactId>
                            <version>3.2.0</version>
                    </plugin>

                    <plugin>
                            <artifactId>maven-compiler-plugin</artifactId>
                            <version>3.10.1</version>
                            <configuration>
                                    <source>${java.version}</source>
                                    <target>${java.version}</target>
                                    <release>${java.version}</release>
                            </configuration>
                    </plugin>

                    <!-- plugin>
                            <artifactId>maven-war-plugin</artifactId>
                            <version>3.3.2</version>
                            <configuration>
                                    <warSourceDirectory>src/main/webapp</warSourceDirectory>
                            </configuration>
                    </plugin -->

                    <plugin>
                            <groupId>org.springframework.boot</groupId>
                            <artifactId>spring-boot-maven-plugin</artifactId>
                            <version>3.0.1</version>
                            <executions>
                                    <execution>
                                            <goals>
                                                    <goal>repackage</goal>
                                            </goals>
                                            <configuration>
                                                    <mainClass>com.artificialsolutions.teamsconnector.Application</mainClass>
                                            </configuration>
                                    </execution>
                            </executions>
                    </plugin>

                    <plugin>
                            <groupId>com.microsoft.azure</groupId>
                            <artifactId>azure-webapp-maven-plugin</artifactId>
                            <version>2.8.0</version>
                            <configuration>
                                    <schemaVersion>V2</schemaVersion>
                                    <resourceGroup>${groupname}</resourceGroup>
                                    <appName>${botname}</appName>
                                    <region>eastus</region>
                                    <pricingTier>F1</pricingTier>
                                    <appSettings>
                                            <property>
                                                    <name>JAVA_OPTS</name>
                                                    <value>-Dserver.port=443</value>
                                            </property>
                                    </appSettings>
                                    <runtime>
                                            <os>linux</os>
                                            <javaVersion>java17</javaVersion>
                                            <webContainer>java17</webContainer>
                                    </runtime>
                                    <deployment>
                                            <resources>
                                                    <resource>
                                                            <directory>${project.basedir}/target</directory>
                                                            <includes>
                                                                    <include>*.jar</include>
                                                            </includes>
                                                    </resource>
                                            </resources>
                                    </deployment>
                            </configuration>
                    </plugin>

                    <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-site-plugin</artifactId>
                            <version>3.12.1</version>
                    </plugin>

                    <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-project-info-reports-plugin</artifactId>
                            <version>3.4.1</version>
                    </plugin>
            </plugins>
    </build>

Hi Akshay.
I will need more detailed info on this and will contact you via direct message

Hello JP,

Sure, thank you so much :slight_smile:

Regards,
Akshay

Hi! I am having the exact same error. How did you fix it? Did you change anything in the pom? @JP-Artsol @dhaneakshay