Rectangle 27 1

spring java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.isInJavaLangAnnotationPackage(LjavalangannotationAnnotation;)Z?


Sign up for our newsletter and get our top new questions delivered to your inbox (see an example).

That method appeared in that commit, which seems to be 4.0.3+. Just update spring dependencies to the latest version.

Note
Rectangle 27 1

spring java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.isInJavaLangAnnotationPackage(LjavalangannotationAnnotation;)Z?


<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-beans</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-jdbc</artifactId>
</dependency>
<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-orm</artifactId>
</dependency>
<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-framework-bom</artifactId>
            <version>4.0.5.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

Agree! Caused by having different versions of Spring.

Now in your dependencies you can remove the version and replace spring-dao with spring-orm. Added benefit is that all your spring-* dependencies will now be managed to the latest release and you only have a single location for your version number.

The problem is that you are mixing different versions of Spring, you are mixing (2.0.8, 3.1.4 and 4.0.2) in your project. That is trouble waiting to happen.

To prevent these kind of things there is now a so called "bill of materials" POM which you can import.

You could apply the same trick for Spring Data as that also has a bom.

You need to add a dependencyManagement section to import the bom.

Note
Rectangle 27 1

spring java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.isInJavaLangAnnotationPackage(LjavalangannotationAnnotation;)Z?


Replace your old jars with new one's based on the spring-framework-bom.LATEST.VERSION.pom file.

Note
Rectangle 27 1

spring java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.isInJavaLangAnnotationPackage(LjavalangannotationAnnotation;)Z?


Just a quick note that after much headache I finally resolved this issue by removing my maven project from Eclipse and re-importing.

Note
Rectangle 27 1

spring java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.isInJavaLangAnnotationPackage(LjavalangannotationAnnotation;)Z?


That method appeared in that commit, which seems to be 4.0.3+. Just update spring dependencies to the latest version.

Note
Rectangle 27 1

spring java.lang.NoSuchMethodError: org.springframework.core.annotation.AnnotationUtils.isInJavaLangAnnotationPackage(LjavalangannotationAnnotation;)Z?


Note