Reputation: 5733
If I start my tests I get this exception:
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
These are my dependencies:
Does anyone know what I can do in order to run my Junit tests. The application works fine in productive but my tests are broken with spring boot Version 1.3.8.RELEASE and Spring 4.2.5.RELEASE.
These are the dependencies in my POM file:
<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>
Upvotes: 0
Views: 1011
Reputation: 116111
You can't use Spring Framework 4.2.5 with Spring Boot 1.3.8. As described in the documentation, Spring Boot 1.3.8 requires Spring Framework 4.2.8 or above.
You'll need to make some changes to your pom so that 4.2.8 is used. That should be as simple as allowing Spring Boot's dependency management to control the version of Spring Framework. I can't say for certain exactly what change needs to be made as the pom in your question is incomplete.
Upvotes: 1