NoClassDefFoundError for javax.security.RunAs when using Jakarta Annotations API 2.1.1 on Spring Boot 2.7

37 Views Asked by At

I am using spring boot 2.7 version and recently upgraded jakarta.annotations-api.2.1.1 version. After this when I started application, I getting error like

No class deffounderror for javax.security.RunAs

How can I fix this issue?

1

There are 1 best solutions below

0
raiwaqar On

Javax API what you need to add.

<!-- https://mvnrepository.com/artifact/javax.annotation/javax.annotation-api -->
<dependency>
    <groupId>javax.annotation</groupId>
    <artifactId>javax.annotation-api</artifactId>
    <version>1.3.2</version>
</dependency>

You can also visit this answer.