I'm stuck with the following error while upgrading the spring boot version. 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
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
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.