简体   繁体   English

升级spring引导版本时,卡住如下错误。 请让我知道如何解决这个问题

[英]While upgrading the spring boot version, stuck with the following error. Pls let me know how to solve this

I'm stuck with the following error while upgrading the spring boot version.升级 spring 引导版本时遇到以下错误。 Please tell the way to fix this issue.请告知解决此问题的方法。

Error:错误:

[ERROR] 2022-05-16 13:14:27.170 [main]  TomcatStarter:61 - Error starting Tomcat context. Exception: org.springframework.beans.factory.UnsatisfiedDependencyException. Message: Error creating bean with name 'securityConfig': Unsatisfied dependency expressed through field 'userDetailsService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'appUserDetailService' defined in file [/Users/sambramhr/Documents/GitHub/DamaAPI/DamaBO/build/classes/java/main/com/dama/bo/security/AppUserDetailService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'userLoginServiceImpl': Unsatisfied dependency expressed through field 'smsNotificationService'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'smsNotificationServiceImpl': Unsatisfied dependency expressed through field 'kafkaProducer'; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'kafkaProducer': Unsatisfied dependency expressed through field 'kafkaTemplate'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'kafkaTemplate' defined in class path resource [com/dama/common/kafka/KafkaProducerConfig.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.kafka.core.KafkaTemplate]: Factory method 'kafkaTemplate' threw exception; nested exception is java.lang.VerifyError: Bad return type
Exception Details:
  Location:
    com/fasterxml/jackson/databind/cfg/MapperBuilder.streamFactory()Lcom/fasterxml/jackson/core/TokenStreamFactory; @7: areturn
  Reason:
    Type 'com/fasterxml/jackson/core/JsonFactory' (current frame, stack[0]) is not assignable to 'com/fasterxml/jackson/core/TokenStreamFactory' (from method signature)
  Current Frame:
    bci: @7
    flags: { }
    locals: { 'com/fasterxml/jackson/databind/cfg/MapperBuilder' }
    stack: { 'com/fasterxml/jackson/core/JsonFactory' }
  Bytecode:
    0x0000000: 2ab4 0002 b600 08b0                    

BUILD.gradle构建.gradle

buildscript {
    ext {
        springBootVersion = '2.6.6'
    }
    repositories {
        mavenCentral()
        maven { url "https://repo.spring.io/snapshot" }
        maven { url "https://repo.spring.io/milestone" }
        maven { url "https://plugins.gradle.org/m2/" }
    }
    dependencies {
        classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
        classpath "gradle.plugin.com.boxfuse.client:gradle-plugin-publishing:5.2.4"
    }
    ext['log4j2.version'] = '2.17.1'
}

apply plugin: 'java'
apply plugin: 'eclipse-wtp'
apply plugin: 'org.springframework.boot'
apply plugin: 'io.spring.dependency-management'
apply plugin: 'war'
apply plugin: 'org.flywaydb.flyway'
apply plugin: 'jacoco'


group = 'com.dama'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = 1.8

repositories {
    mavenCentral()
    maven { url "https://repo.spring.io/snapshot" }
    maven { url "https://repo.spring.io/milestone" }
}

configurations {
    providedRuntime
}

dependencies {
    compile(project(':DamaCore')){
            transitive = false
    }
    compile('org.springframework.boot:spring-boot-starter-data-jpa')
    compile('org.springframework.boot:spring-boot-starter-security')
    compile('org.springframework.boot:spring-boot-starter-web')
    compile('org.springframework.boot:spring-boot-starter-log4j2')
    compile('org.springframework.boot:spring-boot-starter-mail')
    compile('org.springframework.boot:spring-boot-starter-thymeleaf')
    compile('org.springframework.kafka:spring-kafka')
    compile group: 'org.xhtmlrenderer', name: 'flying-saucer-pdf-itext5', version: '9.1.6'
    compile group: 'org.glassfish.jaxb', name: 'jaxb-runtime', version: '2.3.6'
    compile group: 'net.sf.jtidy', name: 'jtidy', version: 'r938'
    compile('ognl:ognl:3.1.12')
    implementation group: 'io.jsonwebtoken', name: 'jjwt', version: '0.9.1'
    compile group: 'org.imgscalr', name: 'imgscalr-lib', version: '4.2'
    implementation group: 'com.twilio.sdk', name: 'twilio', version: '8.22.1'
    compile('org.apache.commons:commons-lang3:3.7')
    compile('com.ancientprogramming.fixedformat4j:fixedformat4j:1.2.2')
    compile 'com.jcraft:jsch:0.1.50'
    implementation group: 'com.amazonaws', name: 'aws-java-sdk-s3', version: '1.12.121'
    compile group: 'com.coralogix.sdk', name: 'coralogix-sdk', version: '2.0.2'
    compile group: 'com.coralogix.sdk', name: 'log4j2-appender', version: '2.0.2'
    
    compile group: 'org.springframework', name: 'spring-test', version: '5.0.5.RELEASE' 
    compile "org.apache.commons:commons-csv:1.6"
    compile group: 'com.google.zxing', name: 'core', version: '3.3.1'
    
    compile group: 'org.bouncycastle', name: 'bcpg-jdk15on', version: '1.60'
    compile 'org.flywaydb:flyway-core:5.2.4'
    compile 'org.apache.poi:poi:3.12'
    compile 'org.apache.poi:poi-ooxml:3.12'
    runtime('mysql:mysql-connector-java')
    implementation group: 'io.fusionauth', name: 'fusionauth-jwt', version: '5.0.0'
    providedRuntime('org.springframework.boot:spring-boot-starter-tomcat')
    compile group: 'org.apache.lucene', name: 'lucene-spellchecker', version: '3.3.0'
    compile group: 'javax.annotation', name: 'javax.annotation-api', version: '1.3.2'
    compile('com.vladmihalcea:hibernate-types-52:2.2.0')
    compile 'commons-beanutils:commons-beanutils:1.9.4'
    compile (group: 'com.opencsv', name: 'opencsv', version: '5.1')
            {
                exclude group: 'org.apache.commons', module: 'commons-lang3'
            }
    compile (group: 'com.intuit.quickbooks-online', name: 'ipp-v3-java-devkit', version: '5.0.2', classifier: 'jar-with-dependencies')
            {
                exclude group: 'org.apache.commons', module: 'commons-lang3'
                exclude group: 'commons-beanutils'
            }
                implementation group: 'com.intuit.quickbooks-online', name: 'oauth2-platform-api', version: '6.2.0'
    compile group: 'org.apache.pdfbox', name: 'pdfbox', version: '2.0.1'
    
    implementation group: 'com.plivo', name: 'plivo-java', version: '5.5.0'
    implementation group: 'com.messagemedia.sdk', name: 'messages', version: '2.1.0'
    compile group: 'com.amazonaws', name: 'aws-java-sdk-sns', version: '1.11.13'
    compile "com.github.clicksend:clicksend-java-client:1.0.0"

    compile (group: 'com.thelastcheck.commons', name: 'tlc-io-x937', version: '2.3.0'){
            exclude  module: 'com.springsource.javax.media.jai.core'
            exclude module: 'slf4j-over-slf4j'
            exclude group: 'org.slf4j'
            exclude group: 'org.apache.commons', module: 'commons-lang3'
                        
}

    compile ('org.apache.pdfbox:pdfbox-tools:2.0.1')   
    implementation group: 'org.apache.commons', name: 'commons-imaging', version: '1.0-alpha2'
    implementation group: 'com.twelvemonkeys.imageio', name: 'imageio-tiff', version: '3.6.2'

   implementation 'org.codehaus.jackson:jackson-mapper-asl:1.9.13'

   compile('org.springframework.boot:spring-boot-starter-webflux')
   compile('org.springframework.boot:spring-boot-starter-reactor-netty')
   implementation('org.springframework.boot:spring-boot-starter-validation')
   
    compileOnly group: 'org.projectlombok', name: 'lombok', version: '1.18.20'
    annotationProcessor 'org.projectlombok:lombok:1.18.20'
    
    testImplementation 'org.springframework.boot:spring-boot-starter-test'
    testImplementation 'org.mockito:mockito-core:3.10.0'
    testImplementation group: 'org.powermock', name: 'powermock-module-junit4', version: '2.0.2'
    testImplementation group: 'org.powermock', name: 'powermock-api-mockito2', version: '2.0.2'
    // https://mvnrepository.com/artifact/org.powermock/powermock-api-easymock
    testImplementation group: 'org.powermock', name: 'powermock-api-easymock', version: '1.7.1'
    testImplementation("junit:junit:4.13.2")
    
    // https://mvnrepository.com/artifact/org.junit.vintage/junit-vintage-engine
    testImplementation group: 'org.junit.vintage', name: 'junit-vintage-engine', version: '5.8.2'
    
    
}

war {
    enabled = true
    from 'aws_ebextensions'
}

configurations {
    all*.exclude module : 'spring-boot-starter-logging'
}

I am getting similar error.我收到类似的错误。 You can remove the org.codehaus.jackson and use com.fasterxml.jackson in following ways:- Following are some of the changes identified between Jackson 1.9.x and Jackson 2.9.8您可以通过以下方式删除 org.codehaus.jackson 并使用 com.fasterxml.jackson:- 以下是 Jackson 1.9.x 和 Jackson 2.9.8 之间确定的一些更改

  1. org.codehaus.jackson changed to com.fasterxml.jackson org.codehaus.jackson 改为 com.fasterxml.jackson
  2. org.codehaus.jackson.map changed to com.fasterxml.jackson.databind org.codehaus.jackson.map改为com.fasterxml.jackson.databind
  3. SerializationConfig.Feature changed and spitted to SerializationFeature,MapperFeature SerializationConfig.Feature 更改并吐到 SerializationFeature,MapperFeature
  4. DeSerializationConfig.Feature changed and splitted to DeSerializationFeature,MapperFeature DeSerializationConfig.Feature 更改并拆分为 DeSerializationFeature,MapperFeature
  5. AnnotationIntrospector.Pair changed to AnnotationIntrospectorPair AnnotationIntrospector.Pair 更改为 AnnotationIntrospectorPair
  6. SerializationConfig.withAnnotationIntrospectro(...) changed to SerializationConfig.with(...) SerializationConfig.withAnnotationIntrospectro(...) 更改为 SerializationConfig.with(...)
  7. ObjectMapper.getSerilizationConfig().addMixInAnnotations(...) changed to ObjectMapper.addMixIn(....) ObjectMapper.getSerilizationConfig().addMixInAnnotations(...) 更改为 ObjectMapper.addMixIn(....)
  8. JSonSerialize.include changed to JSonInclude JSonSerialize.include 更改为 JSonInclude
  9. ObjectMapper.readValue(JSonNode,...) changed to OjbjectMapper.readValue(ObjectMapper.treeAsTokens(JSonNode),...) ObjectMapper.readValue(JSonNode,...) 更改为 OjbjectMapper.readValue(ObjectMapper.treeAsTokens(JSonNode),...)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 spring引导版本升级到2.6.6报错 - Error upgrading spring boot version to 2.6.6 将 Spring 引导版本从 2.1.6 迁移到 Spring 引导 2.4 时出现以下错误 - Getting following error while migrating Spring boot version from 2.1.6 to Spring boot 2.4 升级到 Spring 引导 2.7.5 时侦探错误 - Sleuth error while upgrading to Spring boot 2.7.5 Spring 安全性:在 Spring 引导 2.7.2 中升级已弃用的 WebSecurityConfigurerAdapter 时出错 - Spring Security: Error while upgrading the deprecated WebSecurityConfigurerAdapter in Spring Boot 2.7.2 当我运行我的 Spring 引导应用程序时,我收到以下错误。 我正在使用 spring 启动版本 2.4.5 - While I am running my Spring Boot application, I am getting the below error. I am using spring boot version 2.4.5 如何解决此 Spring Boot Whitelabel 错误 - How to solve this Spring Boot Whitelabel error 升级 Spring 时出现 NullPointerException 启动到版本 2.6.2 - NullPointerException when upgrading Spring Boot to version 2.6.2 我得到这个错误..pls指导我解决它 - I m getting this error ..pls guide me to solve it 如何解决通过 Z03D476861AFD3854510 测试 spring 引导 rest api 时遇到的错误? - How can I solve the error I get while testing the spring boot rest api via postman? 如何知道spring boot中嵌入了哪个tomcat版本 - How to know which tomcat version embedded in spring boot
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM