将 Spring Boot 从 1.3.5 迁移到 1.5.6

将 Spring Boot 从 1.3.5 迁移到 1.5.6

我需要将我的 SpringBoot 项目从 1.3.5 迁移到 1.5.3。1.3.5 没有问题,但 1.5.3 却出现异常。以下是代码片段:

  ext {
    springBootVersion = "1.5.6.RELEASE"
    springFrameworkVersion = "4.3.0.RELEASE"
    lombokVersion = "1.14.4"
    emailNotification = "[email protected]"
  }

    compile "org.springframework.data:spring-data-cassandra:1.3.2.RELEASE"
    compile "org.springframework.data:spring-data-commons:1.11.2.RELEASE"
    compile "org.springframework.data:spring-cql:1.3.2.RELEASE"
    compile "com.datastax.cassandra:cassandra-driver-dse:2.1.9"

    compile "com.oracle.jdbc:ojdbc8:12.2.0.1"

    compile "org.springframework.boot:spring-boot-starter-web:${springBootVersion}"
    compile "org.springframework.boot:spring-boot-starter:${springBootVersion}"
    compile "org.springframework.boot:spring-boot-starter-actuator:${springBootVersion}"
    compile "org.springframework.boot:spring-boot-configuration-processor:${springBootVersion}"

    compile "org.springframework.security:spring-security-core:4.0.0.RELEASE"
    compile "org.springframework.security:spring-security-web:4.0.0.RELEASE"
    compile "org.springframework.security:spring-security-config:4.0.0.RELEASE"

    compile "com.apple.ist.idms:DSClient:FY15R15_1.6"
    compile "com.apple.ist.idms:i3rpc:FY15R10"

    compile(group: 'com.apple.ais.accountsecurity', name: 'totp-java', version: '1.0.7')

    compile "com.fasterxml.jackson.core:jackson-annotations:2.7.5"
    compile "com.fasterxml.jackson.core:jackson-databind:2.7.5"

    compile "joda-time:joda-time:2.3"
    compile "commons-lang:commons-lang:2.6"
    compile('org.apache.httpcomponents:httpclient:4.3.2') { exclude(module: 'commons-logging') }
    compile 'com.googlecode.json-simple:json-simple:1.1'
    compile 'com.googlecode.plist:dd-plist:1.16'

    // Lombok
    annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
    compileOnly "org.projectlombok:lombok:${lombokVersion}"


    testCompile "junit:junit:4.12"

以下是例外情况:

Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/data/cassandra/mapping/UserTypeResolver
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
    at java.lang.Class.getDeclaredMethods(Class.java:1975)
    at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:613)
    at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:524)
    at org.springframework.util.ReflectionUtils.doWithMethods(ReflectionUtils.java:510)
    at org.springframework.util.ReflectionUtils.getUniqueDeclaredMethods(ReflectionUtils.java:570)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.getTypeForFactoryMethod(AbstractAutowireCapableBeanFactory.java:697)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.determineTargetType(AbstractAutowireCapableBeanFactory.java:640)
    at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.predictBeanType(AbstractAutowireCapableBeanFactory.java:609)
    at org.springframework.beans.factory.support.AbstractBeanFactory.isFactoryBean(AbstractBeanFactory.java:1484)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.doGetBeanNamesForType(DefaultListableBeanFactory.java:425)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:395)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:515)
    at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeansOfType(DefaultListableBeanFactory.java:508)
    at org.springframework.context.support.AbstractApplicationContext.getBeansOfType(AbstractApplicationContext.java:1186)
    at org.springframework.boot.SpringApplication.getExitCodeFromMappedException(SpringApplication.java:818)
    at org.springframework.boot.SpringApplication.getExitCodeFromException(SpringApplication.java:804)
    at org.springframework.boot.SpringApplication.handleExitCode(SpringApplication.java:790)
    at org.springframework.boot.SpringApplication.handleRunFailure(SpringApplication.java:744)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
    at com.apple.store.ApplicationBoot.main(ApplicationBoot.java:28)
Caused by: java.lang.ClassNotFoundException: org.springframework.data.cassandra.mapping.UserTypeResolver
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

相关内容