首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >春季引导版本1.3.8 Version和Spring4.2.5.Version -> IllegalAccessError

春季引导版本1.3.8 Version和Spring4.2.5.Version -> IllegalAccessError
EN

Stack Overflow用户
提问于 2018-04-10 09:46:13
回答 1查看 793关注 0票数 0

如果我开始测试,我就会得到这样的例外:

代码语言:javascript
复制
java.lang.IllegalAccessError: tried to access method org.springframework.core.convert.support.DefaultConversionService.addCollectionConverters(Lorg/springframework/core/convert/converter/ConverterRegistry;)V from class org.springframework.boot.bind.RelaxedConversionService

这些是我的依赖:

有没有人知道我能做些什么来运行我的Junit测试。该应用程序在生产上运行良好,但我的测试使用了spring 1.3.8.RELEASE和Spring4.2.5.RELEASE。

这些是我的POM文件中的依赖项:

代码语言:javascript
复制
   <project xmlns="http://maven.apache.org/POM/4.0.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

  <artifactId>smartinnotec-legalprojectmanagement-dao</artifactId>
  <packaging>jar</packaging>
  <name>smartinnotec-legalprojectmanagement-dao</name>
  <url>http://maven.apache.org</url>

  <parent>
    <groupId>com.smartinnotec.legalprojectmanagement</groupId>
    <artifactId>smartinnotec-legalprojectmanagement-main</artifactId>
    <version>1.0.1-SNAPSHOT</version>
    <relativePath>../smartinnotec-legalprojectmanagement-main/pom.xml</relativePath>
  </parent>

  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-data-mongodb</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-aop</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>com.smartinnotec.legalprojectmanagement</groupId>
        <artifactId>smartinnotec-legalprojectmanagement-core</artifactId>
    </dependency>
    <dependency>
        <groupId>joda-time</groupId>
        <artifactId>joda-time</artifactId>
    </dependency>
    <dependency> 
        <groupId>org.projectlombok</groupId> 
        <artifactId>lombok</artifactId> 
    </dependency>
  </dependencies>
  <build>
     <plugins>
        <plugin>
           <artifactId>maven-compiler-plugin</artifactId>
           <configuration>
             <source>1.8</source>
             <target>1.8</target>
           </configuration>
       </plugin>
     </plugins>
   </build>
</project>
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-04-10 10:27:14

您不能在Spring 1.3.8中使用SpringFramework4.2.5。作为在文档中描述,SpringBoot1.3.8需要SpringFramework4.2.8或更高版本。

您需要对pom进行一些更改,以便使用4.2.8。这应该和允许Spring的依赖关系管理来控制Spring版本一样简单。我不能确切地说出需要做什么改变,因为你的问题中的内容是不完整的。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49750445

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档