Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/384.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 由于NoSuchMethodException,Spring boot azure函数未启动_Java_Spring_Azure_Spring Boot_Maven - Fatal编程技术网

Java 由于NoSuchMethodException,Spring boot azure函数未启动

Java 由于NoSuchMethodException,Spring boot azure函数未启动,java,spring,azure,spring-boot,maven,Java,Spring,Azure,Spring Boot,Maven,我正在构建几个函数,以便在Microsoft Azure中有一些cron作业。 但是,这个cronjobs需要编辑数据库,就像做一个当天的用户一样,我从数据库中随机选择一个人,并在数据库中设置一个标志,表示这个人实际上是当天的用户。 问题是,当我启动SpringBoot应用程序(作为eclipse中的常规SpringBoot或作为azure函数应用程序在命令行中)时,它有一个异常,阻止与数据库的连接。 我正在使用Azure CosmosDB的spring boot starter(我在主应用程序

我正在构建几个函数,以便在Microsoft Azure中有一些cron作业。 但是,这个cronjobs需要编辑数据库,就像做一个当天的用户一样,我从数据库中随机选择一个人,并在数据库中设置一个标志,表示这个人实际上是当天的用户。 问题是,当我启动SpringBoot应用程序(作为eclipse中的常规SpringBoot或作为azure函数应用程序在命令行中)时,它有一个异常,阻止与数据库的连接。 我正在使用Azure CosmosDB的spring boot starter(我在主应用程序中使用它并可以正常工作)。 这是我得到的一个例外:

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

    com.azure.data.cosmos.internal.http.HttpClient.createFixed(HttpClient.java:47)

The following method did not exist:

    reactor.netty.resources.ConnectionProvider.fixed(Ljava/lang/String;IJLjava/time/Duration;)Lreactor/netty/resources/ConnectionProvider;

The method's class, reactor.netty.resources.ConnectionProvider, is available from the following locations:

    jar:file:/C:/Users/gonca/.m2/repository/io/projectreactor/netty/reactor-netty-core/1.0.1/reactor-netty-core-1.0.1.jar!/reactor/netty/resources/ConnectionProvider.class

The class hierarchy was loaded from the following locations:

    reactor.netty.resources.ConnectionProvider: file:/C:/Users/gonca/.m2/repository/io/projectreactor/netty/reactor-netty-core/1.0.1/reactor-netty-core-1.0.1.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of reactor.netty.resources.ConnectionProvider
由于这很可能是一个依赖项错误,下面是我的pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.4.0</version>
        <relativePath />
    </parent>
    <groupId>com.scc</groupId>
    <artifactId>scc-functions</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <name>scc-functions</name>
    <description>Demo project for Spring Boot</description>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <java.version>11</java.version>
        <azure.functions.maven.plugin.version>1.9.0</azure.functions.maven.plugin.version>
        <functionAppName>scc-47167-47316-47588-functions</functionAppName>
        <functionAppRegion>westeurope</functionAppRegion>
        <subscriptionId>77718b4d-8b63-400b-ba08-08914f82af8d</subscriptionId>
        <functionPricingTier>B1</functionPricingTier>
        <stagingDirectory>${project.build.directory}/azure-functions/${functionAppName}</stagingDirectory>
        <functionResourceGroup>scc-47167-47316-47588-functions</functionResourceGroup>
        <start-class>com.scc.SccFunctionsApplication</start-class>
        <spring.boot.wrapper.version>1.0.25.RELEASE</spring.boot.wrapper.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-function-adapter-azure</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-function-web</artifactId>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-devtools</artifactId>
            <optional>true</optional>
        </dependency>
        <dependency>
            <groupId>com.microsoft.azure</groupId>
            <artifactId>azure-cosmosdb-spring-boot-starter</artifactId>
            </dependency>
        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>
    </dependencies>
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.microsoft.azure</groupId>
                <artifactId>azure-spring-boot-bom</artifactId>
                <version>2.3.5</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-function-dependencies</artifactId>
                <version>3.0.10.RELEASE</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>com.microsoft.azure</groupId>
                    <artifactId>azure-functions-maven-plugin</artifactId>
                    <version>${azure.functions.maven.plugin.version}</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-dependency-plugin</artifactId>
                    <version>3.1.2</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-clean-plugin</artifactId>
                    <version>3.1.0</version>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>com.microsoft.azure</groupId>
                <artifactId>azure-functions-maven-plugin</artifactId>
                <configuration>
                    <resourceGroup>${functionResourceGroup}</resourceGroup>
                    <appName>${functionAppName}</appName>
                    <region>${functionAppRegion}</region>
                    <appSettings>
                        <property>
                            <name>WEBSITE_RUN_FROM_PACKAGE</name>
                            <value>1</value>
                        </property>
                        <property>
                            <name>FUNCTIONS_EXTENSION_VERSION</name>
                            <value>~3</value>
                        </property>
                        <property>
                            <name>FUNCTIONS_WORKER_RUNTIME</name>
                            <value>java</value>
                        </property>
                    </appSettings>
                </configuration>
                <executions>
                    <execution>
                        <id>package-functions</id>
                        <goals>
                            <goal>package</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-resources-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-resources</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-resources</goal>
                        </goals>
                        <configuration>
                            <overwrite>true</overwrite>
                            <outputDirectory>
                                ${project.build.directory}/azure-functions/${functionAppName}
                            </outputDirectory>
                            <resources>
                                <resource>
                                    <directory>${project.basedir}/src/main/azure
                                    </directory>
                                    <includes>
                                        <include>**</include>
                                    </includes>
                                </resource>
                            </resources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${stagingDirectory}/lib</outputDirectory>
                            <overWriteReleases>false</overWriteReleases>
                            <overWriteSnapshots>false</overWriteSnapshots>
                            <overWriteIfNewer>true</overWriteIfNewer>
                            <includeScope>runtime</includeScope>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <artifactId>maven-clean-plugin</artifactId>
                <configuration>
                    <filesets>
                        <fileset>
                            <directory>obj</directory>
                        </fileset>
                    </filesets>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <dependencies>
                    <dependency>
                        <groupId>org.springframework.boot.experimental</groupId>
                        <artifactId>spring-boot-thin-layout</artifactId>
                        <version>${spring.boot.wrapper.version}</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>
    <repositories>
        <repository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>https://repo.spring.io/libs-snapshot-local</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </repository>
        <repository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/libs-milestone-local</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>spring-releases</id>
            <name>Spring Releases</name>
            <url>https://repo.spring.io/release</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
    <pluginRepositories>
        <pluginRepository>
            <id>spring-snapshots</id>
            <name>Spring Snapshots</name>
            <url>https://repo.spring.io/libs-snapshot-local</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
            <releases>
                <enabled>false</enabled>
            </releases>
        </pluginRepository>
        <pluginRepository>
            <id>spring-milestones</id>
            <name>Spring Milestones</name>
            <url>https://repo.spring.io/libs-milestone-local</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>spring-releases</id>
            <name>Spring Releases</name>
            <url>https://repo.spring.io/libs-release-local</url>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
</project>

4.0.0
org.springframework.boot
spring启动程序父级
2.4.0
com.scc
scc功能
0.0.1-快照
scc功能
SpringBoot的演示项目
UTF-8
11
11
11
1.9.0
scc-47167-47316-47588-功能
西欧
77718b4d-8b63-400b-ba08-08914f82af8d
地下一层
${project.build.directory}/azure functions/${functionAppName}
scc-47167-47316-47588-功能
com.scc.scc功能应用
1.0.25.1发布
org.springframework.cloud
spring云函数适配器azure
org.springframework.cloud
SpringCloudStarter功能web
假如
org.springframework.boot
弹簧靴开发工具
真的
com.microsoft.azure
azure cosmosdb春季启动程序
org.projectlombok
龙目
假如
com.microsoft.azure
azure spring引导bom
2.3.5
聚甲醛
进口
org.springframework.cloud
spring云函数依赖关系
3.0.10.1发布
聚甲醛
进口
com.microsoft.azure
azure函数maven插件
${azure.functions.maven.plugin.version}
org.apache.maven.plugins
maven资源插件
3.1.0
org.apache.maven.plugins
maven依赖插件
3.1.2
org.apache.maven.plugins
maven清洁插件
3.1.0
com.microsoft.azure
azure函数maven插件
${functionResourceGroup}
${functionAppName}
${functionAppRegion}
网站\u从\u包运行\u
1.
功能\扩展\版本
~3
函数\u工作者\u运行时
JAVA
包函数
包裹
maven资源插件
复制资源
包裹
复制资源
真的
${project.build.directory}/azure functions/${functionAppName}
${project.basedir}/src/main/azure
**
org.apache.maven.plugins
maven依赖插件
复制依赖项
准备包装
复制依赖项
${stagingDirectory}/lib
假的
假的
真的
运行时
maven清洁插件
obj
org.springframework.boot
springbootmaven插件
org.springframework.boot.experimental
弹簧靴薄布局
${spring.boot.wrapper.version}
春季快照
弹簧锡