Could not build ClassFile – ArchiveException

The issue can be a conflict between a java version and a javaassist version. If you’re using the java 8 on your server you should make sure to use the latest javassist version as well. This blog shows the origin of a conflict being inside the thymeleaf which pulls in an older javassist, the solution being to exclude it from the dependencies

<dependency>
    <groupId>org.thymeleaf</groupId>
    <artifactId>thymeleaf</artifactId>
    <version>${thymeleaf.version}</version>
    <exclusions>
        <exclusion>
            <artifactId>javassist</artifactId>
            <groupId>org.javassist</groupId>
        </exclusion>
    </exclusions>
</dependency>

your case could be different, so you should inspect the dependency tree to find a suitable solution

Leave a Comment