Spring boot starter minio выдает ошибку «компонент типа, который не найден» для весенней загрузки 3 ⇐ JAVA
-
Anonymous
Spring boot starter minio выдает ошибку «компонент типа, который не найден» для весенней загрузки 3
Я пытаюсь обновить свое приложение Spring Boot до Spring Boot 3 и получаю сообщение об ошибке при обновлении версии minio. Ниже вы можете найти файлы моего проекта.
build.gradle.kts
зависимости { реализация("org.springframework.boot:spring-boot-starter-actuator") реализация("org.springframework.boot:spring-boot-starter-cache") реализация("org.springframework.boot:spring-boot-starter-data-jdbc") реализация("org.springframework.boot:spring-boot-starter-data-jpa") реализация("org.springframework.boot:spring-boot-starter-oauth2-client") реализация("org.springframework.boot:spring-boot-starter-security") реализация("org.springframework.boot:spring-boot-starter-thymeleaf") реализация("org.springframework.boot:spring-boot-starter-web") реализация("com.azure.spring:spring-cloud-azure-starter-active-directory") реализация("com.azure.spring:spring-cloud-azure-starter-actuator") реализация("com.fasterxml.jackson.module:jackson-module-kotlin") реализация("org.jetbrains.kotlin:kotlin-reflect") реализация("org.liquibase:liquibase-core") реализация("org.thymeleaf.extras:thymeleaf-extras-springsecurity6") реализация("org.hibernate.orm:hibernate-core:6.4.0.Final") реализация("org.apache.httpcomComponents.client5:httpclient5:5.2.2") developmentOnly("org.springframework.boot:spring-boot-devtools") runtimeOnly("com.h2database:h2") runtimeOnly("io.micrometer:micrometer-registry-prometheus") runtimeOnly("org.postgresql:postgresql") testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.springframework.security:spring-security-test") //реализация("nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect") реализация(файлы("libs/jconn4.jar")) //реализация("org.springframework.security:spring-security-oauth2-jose") реализация("com.jlefebure:spring-boot-starter-minio:1.1") реализация("org.jetbrains.kotlin:kotlin-stdlib-jdk8") testImplementation("de.cronn:test-utils:0.9.0") реализация("com.fasterxml.jackson.dataformat:jackson-dataformat-csv") реализация("org.webjars:bootstrap:5.3.0") реализация("org.webjars:jquery:3.6.0") реализация("org.webjars:jquery-validation:1.19.3") реализация("org.webjars.npm:swiper:8.3.2") реализация("org.webjars.npm:panzoom__panzoom:4.5.1") реализация("org.webjars.npm:notiflix:3.2.5") реализация("org.webjars:selectize.js:0.12.4") реализация("org.webjars:select2:4.0.13") реализация("org.springframework.boot:spring-boot-starter-mail") реализация("org.apache.logging.log4j:log4j-to-slf4j:2.14.1") реализация("org.apache.logging.log4j:log4j-api:2.14.1") реализация("org.apache.poi:poi-ooxml:5.1.0") реализация("org.springdoc:springdoc-openapi-ui:1.7.0") реализация("org.apache.poi:poi:5.2.3") } config.kt
пакет se.astrego.centralDatabase импортировать org.springframework.beans.factory.annotation.Autowired импортировать org.springframework.context.annotation.Configuration импортировать org.springframework.scheduling.annotation.EnableScheduling импортировать org.springframework.scheduling.annotation.Scheduled импортировать org.springframework.transaction.annotation.Transactional импортировать se.astrego.centralDatabase.repositories.AssayRepository импортировать se.astrego.centralDatabase.repositories.enteties.Assay импортировать se.astrego.centralDatabase.repositories.enteties.FinalQcAssayRepo импортировать se.astrego.centralDatabase.services.AssayService импортировать java.io.File импортировать java.nio.file.Paths импортировать java.util.* @Конфигурация @EnableScheduling Конфигурация класса @Autowired конструктор( репозиторий val: AssayRepository, вал assayService: AssayService, вал FinalQcAssayRepo: FinalQcAssayRepo ) { //мой код } CentralDatabaseApplication.kt
пакет se.astrego.centralDatabase импортировать org.apache.catalina.Context импортировать org.apache.catalina.connector.Connector импортировать org.apache.tomcat.util.descriptor.web.SecurityCollection импортировать org.apache.tomcat.util.descriptor.web.SecurityConstraint импортировать org.springframework.boot.autoconfigure.SpringBootApplication импортировать org.springframework.boot.context.properties.ConfigurationPropertiesScan импортировать org.springframework.boot.runApplication импортировать org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory импортировать org.springframework.boot.web.servlet.server.ServletWebServerFactory импортировать org.springframework.cache.annotation.EnableCaching импортировать org.springframework.context.annotation.Bean импортировать org.springframework.stereotype.Component @SpringBootApplication @EnableCaching @ConfigurationPropertiesScan("se.astrego.centralDatabase.services.monitor") класс CentralDatabaseApplication fun main(args: Array) { runApplication(*args) } @Компонент класс ServletConfig(){ @Бин весело servletContainer(): ServletWebServerFactory? { val tomcat: TomcatServletWebServerFactory = объект: TomcatServletWebServerFactory() { переопределить удовольствие postProcessContext(context: Context) { val securityConstraint = SecurityConstraint() SecurityConstraint.userConstraint = "КОНФИДЕНЦИАЛЬНО" коллекция val = SecurityCollection() коллекция.addPattern("/*") SecurityConstraint.addCollection(коллекция) context.addConstraint(securityConstraint) } } tomcat.addAdditionalTomcatConnectors(redirectConnector()) вернуть кота } весело redirectConnector(): Коннектор { val Connector = Connector("org.apache.coyote.http11.Http11NioProtocol") соединитель.схема = "http" разъем.порт = 8080 разъем.secure = ложь разъем.redirectPort = 8443 обратный разъем } } FileApiController.kt
пакет se.astrego.centralDatabase.apiControllers импортировать com.jlefebure.spring.boot.minio.MinioService импортировать org.springframework.beans.factory.annotation.Autowired импортировать org.springframework.http.HttpStatus импортировать org.springframework.web.bind.annotation.* импортировать org.springframework.web.multipart.MultipartFile импортировать se.astrego.centralDatabase.apiControllers.DTOs.FileMetadata импортировать se.astrego.centralDatabase.services.LocalFilesService импортировать java.io.ByteArrayInputStream импортировать java.io.ByteArrayOutputStream импортировать java.io.FileNotFoundException импортировать java.io.InputStream импортировать java.nio.file.Path импортировать java.nio.file.Paths импортировать javax.imageio.ImageIO val NOT_CHIP_ID_ERROR_MESSAGE = "Ожидаемый полный идентификатор чипа, а НЕ с положением лотка для распыления: %s"; @RestController класс FileApiController { @Autowired частный lateinit var minioService: MinioService @Autowired частный lateinit var localFilesService: LocalFilesService @GetMapping("/api/files") весело getAllFiles(): List { вернуть minioService.list().map { FileMetadata(it,"/api/file/" + it.objectName()) } } // другой код } При запуске проекта я получаю
Полю minioService в se.astrego.centralDatabase.apiControllers.FileApiController требовался bean-компонент типа com.jlefebure.spring.boot.minio.MinioService, который не удалось найти. Точка инъекции имеет следующие аннотации: - @org.springframework.beans.factory.annotation.Autowired(обязательно=true) Действие: Рассмотрите возможность определения bean-компонента типа com.jlefebure.spring.boot.minio.MinioService в вашей конфигурации. как это решить. любая помощь приветствуется
Я пытаюсь обновить свое приложение Spring Boot до Spring Boot 3 и получаю сообщение об ошибке при обновлении версии minio. Ниже вы можете найти файлы моего проекта.
build.gradle.kts
зависимости { реализация("org.springframework.boot:spring-boot-starter-actuator") реализация("org.springframework.boot:spring-boot-starter-cache") реализация("org.springframework.boot:spring-boot-starter-data-jdbc") реализация("org.springframework.boot:spring-boot-starter-data-jpa") реализация("org.springframework.boot:spring-boot-starter-oauth2-client") реализация("org.springframework.boot:spring-boot-starter-security") реализация("org.springframework.boot:spring-boot-starter-thymeleaf") реализация("org.springframework.boot:spring-boot-starter-web") реализация("com.azure.spring:spring-cloud-azure-starter-active-directory") реализация("com.azure.spring:spring-cloud-azure-starter-actuator") реализация("com.fasterxml.jackson.module:jackson-module-kotlin") реализация("org.jetbrains.kotlin:kotlin-reflect") реализация("org.liquibase:liquibase-core") реализация("org.thymeleaf.extras:thymeleaf-extras-springsecurity6") реализация("org.hibernate.orm:hibernate-core:6.4.0.Final") реализация("org.apache.httpcomComponents.client5:httpclient5:5.2.2") developmentOnly("org.springframework.boot:spring-boot-devtools") runtimeOnly("com.h2database:h2") runtimeOnly("io.micrometer:micrometer-registry-prometheus") runtimeOnly("org.postgresql:postgresql") testImplementation("org.springframework.boot:spring-boot-starter-test") testImplementation("org.springframework.security:spring-security-test") //реализация("nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect") реализация(файлы("libs/jconn4.jar")) //реализация("org.springframework.security:spring-security-oauth2-jose") реализация("com.jlefebure:spring-boot-starter-minio:1.1") реализация("org.jetbrains.kotlin:kotlin-stdlib-jdk8") testImplementation("de.cronn:test-utils:0.9.0") реализация("com.fasterxml.jackson.dataformat:jackson-dataformat-csv") реализация("org.webjars:bootstrap:5.3.0") реализация("org.webjars:jquery:3.6.0") реализация("org.webjars:jquery-validation:1.19.3") реализация("org.webjars.npm:swiper:8.3.2") реализация("org.webjars.npm:panzoom__panzoom:4.5.1") реализация("org.webjars.npm:notiflix:3.2.5") реализация("org.webjars:selectize.js:0.12.4") реализация("org.webjars:select2:4.0.13") реализация("org.springframework.boot:spring-boot-starter-mail") реализация("org.apache.logging.log4j:log4j-to-slf4j:2.14.1") реализация("org.apache.logging.log4j:log4j-api:2.14.1") реализация("org.apache.poi:poi-ooxml:5.1.0") реализация("org.springdoc:springdoc-openapi-ui:1.7.0") реализация("org.apache.poi:poi:5.2.3") } config.kt
пакет se.astrego.centralDatabase импортировать org.springframework.beans.factory.annotation.Autowired импортировать org.springframework.context.annotation.Configuration импортировать org.springframework.scheduling.annotation.EnableScheduling импортировать org.springframework.scheduling.annotation.Scheduled импортировать org.springframework.transaction.annotation.Transactional импортировать se.astrego.centralDatabase.repositories.AssayRepository импортировать se.astrego.centralDatabase.repositories.enteties.Assay импортировать se.astrego.centralDatabase.repositories.enteties.FinalQcAssayRepo импортировать se.astrego.centralDatabase.services.AssayService импортировать java.io.File импортировать java.nio.file.Paths импортировать java.util.* @Конфигурация @EnableScheduling Конфигурация класса @Autowired конструктор( репозиторий val: AssayRepository, вал assayService: AssayService, вал FinalQcAssayRepo: FinalQcAssayRepo ) { //мой код } CentralDatabaseApplication.kt
пакет se.astrego.centralDatabase импортировать org.apache.catalina.Context импортировать org.apache.catalina.connector.Connector импортировать org.apache.tomcat.util.descriptor.web.SecurityCollection импортировать org.apache.tomcat.util.descriptor.web.SecurityConstraint импортировать org.springframework.boot.autoconfigure.SpringBootApplication импортировать org.springframework.boot.context.properties.ConfigurationPropertiesScan импортировать org.springframework.boot.runApplication импортировать org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory импортировать org.springframework.boot.web.servlet.server.ServletWebServerFactory импортировать org.springframework.cache.annotation.EnableCaching импортировать org.springframework.context.annotation.Bean импортировать org.springframework.stereotype.Component @SpringBootApplication @EnableCaching @ConfigurationPropertiesScan("se.astrego.centralDatabase.services.monitor") класс CentralDatabaseApplication fun main(args: Array) { runApplication(*args) } @Компонент класс ServletConfig(){ @Бин весело servletContainer(): ServletWebServerFactory? { val tomcat: TomcatServletWebServerFactory = объект: TomcatServletWebServerFactory() { переопределить удовольствие postProcessContext(context: Context) { val securityConstraint = SecurityConstraint() SecurityConstraint.userConstraint = "КОНФИДЕНЦИАЛЬНО" коллекция val = SecurityCollection() коллекция.addPattern("/*") SecurityConstraint.addCollection(коллекция) context.addConstraint(securityConstraint) } } tomcat.addAdditionalTomcatConnectors(redirectConnector()) вернуть кота } весело redirectConnector(): Коннектор { val Connector = Connector("org.apache.coyote.http11.Http11NioProtocol") соединитель.схема = "http" разъем.порт = 8080 разъем.secure = ложь разъем.redirectPort = 8443 обратный разъем } } FileApiController.kt
пакет se.astrego.centralDatabase.apiControllers импортировать com.jlefebure.spring.boot.minio.MinioService импортировать org.springframework.beans.factory.annotation.Autowired импортировать org.springframework.http.HttpStatus импортировать org.springframework.web.bind.annotation.* импортировать org.springframework.web.multipart.MultipartFile импортировать se.astrego.centralDatabase.apiControllers.DTOs.FileMetadata импортировать se.astrego.centralDatabase.services.LocalFilesService импортировать java.io.ByteArrayInputStream импортировать java.io.ByteArrayOutputStream импортировать java.io.FileNotFoundException импортировать java.io.InputStream импортировать java.nio.file.Path импортировать java.nio.file.Paths импортировать javax.imageio.ImageIO val NOT_CHIP_ID_ERROR_MESSAGE = "Ожидаемый полный идентификатор чипа, а НЕ с положением лотка для распыления: %s"; @RestController класс FileApiController { @Autowired частный lateinit var minioService: MinioService @Autowired частный lateinit var localFilesService: LocalFilesService @GetMapping("/api/files") весело getAllFiles(): List { вернуть minioService.list().map { FileMetadata(it,"/api/file/" + it.objectName()) } } // другой код } При запуске проекта я получаю
Полю minioService в se.astrego.centralDatabase.apiControllers.FileApiController требовался bean-компонент типа com.jlefebure.spring.boot.minio.MinioService, который не удалось найти. Точка инъекции имеет следующие аннотации: - @org.springframework.beans.factory.annotation.Autowired(обязательно=true) Действие: Рассмотрите возможность определения bean-компонента типа com.jlefebure.spring.boot.minio.MinioService в вашей конфигурации. как это решить. любая помощь приветствуется
Мобильная версия