当前位置: 首页 > 知识库问答 >
问题:

使用spring boot azure blob存储时发生版本冲突

姬魁
2023-03-14

我正在尝试使用Spring启动应用程序将图像上传到azure blob。我得到了下面的错误

2022-02-02 23:28:39【qtp1371397528-21】信息16824 c.a.c.i.jackson。JacksonVersion-信息:包版本:jackson annotations=2.12.4,jackson core=2.12.4,jackson databind=2.12.4,jackson dataformat xml=2.12.4,jackson-datatype-jsr310=2.12.4,azure core=1.21.0

2022-02-02 23:28:39[qtp1371397528-21]WARN 16824org.eclipse.jetty.server.HttpChannel-handleException:/api/v1/项目/选项/图像/上传

组织。springframework。网状物util。NestedServletException:处理程序调度失败;嵌套异常为java。lang.NoClassDefFoundError:io/netty/handler/logging/ByteBufFormat

Java代码

BlobContainerClient containerClient = new BlobContainerClientBuilder()
                .connectionString("connectionstring")
                .containerName("container-name")
                .buildClient();

        BlobClient client = containerClient.getBlobClient(file.getOriginalFilename());
        try {
            client.upload(file.getInputStream(), file.getSize(), true);
        } catch (IOException e) {
            logger.error("error is {}", e.getMessage());
        }

pom。xml

    <project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.2.2.RELEASE</version>
    </parent>


    <groupId>org.sample</groupId>
    <artifactId>sample</artifactId>
    <version>1.0-SNAPSHOT</version>

    <name>sample</name>

    <properties>
        <springfox.version>2.9.2</springfox.version>
        <maven.compiler.source>11</maven.compiler.source>
        <maven.compiler.target>11</maven.compiler.target>
        <jackson-bom.version>2.12.4</jackson-bom.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
            <exclusions>
                <exclusion>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-starter-tomcat</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-jetty</artifactId>
        </dependency>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-actuator</artifactId>
        </dependency>
        <!--        Azure Blob-->
        <dependency>
            <groupId>com.azure</groupId>
            <artifactId>azure-storage-blob</artifactId>
            <version>12.14.1</version>
        </dependency>
        <dependency>
            <groupId>com.azure</groupId>
            <artifactId>azure-core</artifactId>
            <version>1.21.0</version>
        </dependency>
        <dependency>
            <groupId>io.projectreactor.netty</groupId>
            <artifactId>reactor-netty</artifactId>
            <version>1.0.10</version>
        </dependency>

        <!--Security-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>
        <dependency>
            <groupId>com.auth0</groupId>
            <artifactId>java-jwt</artifactId>
            <version>3.8.3</version>
        </dependency>
        <dependency>
            <groupId>com.auth0</groupId>
            <artifactId>jwks-rsa</artifactId>
            <version>0.9.0</version>
        </dependency>
        <!--Swagger/OpenAPI UI-->
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger2</artifactId>
            <version>${springfox.version}</version>
        </dependency>
        <dependency>
            <groupId>io.springfox</groupId>
            <artifactId>springfox-swagger-ui</artifactId>
            <version>${springfox.version}</version>
        </dependency>
        <!--Jersey-->
        <dependency>
            <groupId>org.glassfish.jersey.core</groupId>
            <artifactId>jersey-client</artifactId>
            <version>2.26</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.media</groupId>
            <artifactId>jersey-media-json-jackson</artifactId>
            <version>2.35</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.jersey.inject</groupId>
            <artifactId>jersey-hk2</artifactId>
            <version>2.26</version>
        </dependency>
        <!--Testing-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
            <exclusions>
                <exclusion>
                    <groupId>org.junit.vintage</groupId>
                    <artifactId>junit-vintage-engine</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.github.shiver-me-timbers</groupId>
            <artifactId>smt-random</artifactId>
            <version>1.8</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>org.mockito</groupId>
            <artifactId>mockito-core</artifactId>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.8.0</version>
                <configuration>
                    <release>11</release>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

共有1个答案

拓拔松
2023-03-14

过去几天,我在Azure依赖项上面临着同样的问题。将spring-boot-starter-家长升级到版本2.5.5为我修复了它。

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.5.5</version>
</parent>
 类似资料:
  • 问:如何处理maven多项目构建的功能分支? Jenkins构建和部署这些分支以将开发人员的构建开销保持在最低限度,但开发和功能分支无法构建相同的maven版本,否则我们将面临工件和源代码不匹配的风险。 我们有一个脚本来更改子pom中的父版本和根pom中的版本。虽然这会隔离maven空间中的分支,但在合并时会导致额外的工作。 我认为nexus pro暂存功能可能会帮助我们避免这一要求,并使每个功能

  • 问题内容: 我意识到我的一个项目使用slf4j 1.5.8,而Hibernate使用slf4j 1.6。在使用Maven进行构建时,它会下载两个jar,但是我猜想使用了1.5.8的类文件。因此,当我运行程序时,出现以下错误: 在我把 1.5.8是依赖项的一部分,因此可以单独下载。 问题答案: 您发现自己时,有两个库(Hibernate和其他一些库)以两个不同的版本可传递地导入SLF4J。不幸的是,

  • 我目前正试图在一个非bazel项目中使用Tensorflow的共享库,所以我创建了一个。所以使用bazel从tensorflow归档。 但当我启动一个同时使用Opencv和Tensorflow的c程序时,它会让我产生以下错误: [libprotobuf FATAL external/protobuf/src/google/protobuf/stubs/common.cc:78]此程序是根据协议缓冲

  • 关于如何解决此错误的建议,以便我可以使用最新版本的akka、akka streams和akka HTTP?谢了!

  • 我正在尝试显示我正在使用的下载文件夹中的图像。 但在执行此操作时,我得到了异常,我已经检查了该路径,图像位于那里。我已经在清单中授予了和权限 原木猫 E/BitmapFactory:无法解码流:java.io.FileNotFound异常: /file:/存储/sdcard0/13448File. jpg:打开失败:ENOENT(没有这样的文件或目录)

  • 我正在从国家美术馆的在线目录中检索信息。由于目录的结构,我无法通过提取和跟踪条目之间的链接来导航。幸运的是,集合中的每个对象都有一个可预测的url。我希望我的爬行器通过生成开始URL来导航集合。 我试图通过实现这个线程中的解决方案来解决我的问题。不幸的是,这似乎打破了我蜘蛛的另一部分。错误日志显示我的网址正在成功生成,但它们没有被正确处理。如果我正确地解释了日志——我怀疑我没有——在重新定义允许我