ClassNotFoundException:org.springframework.web.reactive.function.client.WebClient$Builder not found

Anil Mishra
Contributor
October 10, 2023

Hi Community,

I'm trying to use spring webflux jar in my custom plugin, have added dependency in pom as well but getting class not found error during run time

Dependency

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webflux</artifactId>
<version>5.3.22</version>
<scope>provided</scope>
</dependency>

Error--

Caused by: java.lang.IllegalStateException: Failed to introspect Class [com.citi.cti.jiraptsintegration.service.PTSProjectWorkFlowValidator] from ClassLoader [com.citi.cti.cti_sdlc_jiraptsintegration [308]]
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:485)
at org.springframework.util.ReflectionUtils.doWithLocalMethods(ReflectionUtils.java:321)
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.determineCandidateConstructors(AutowiredAnnotationBeanPostProcessor.java:267)
... 29 more
Caused by: java.lang.NoClassDefFoundError: org/springframework/web/reactive/function/client/WebClient$Builder
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:467)
... 31 more
Caused by: java.lang.ClassNotFoundException: org.springframework.web.reactive.function.client.WebClient$Builder not found by com.citi.cti.cti_sdlc_jiraptsintegration [308]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1585)
at org.apache.felix.framework.BundleWiringImpl.access$300(BundleWiringImpl.java:79)
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1970)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
... 35 more

 

 

1 answer

1 accepted

0 votes
Answer accepted
Anil Mishra
Contributor
October 13, 2023

I was able to resolve this, the bean scope has to be compile and has to add spring bean dependency 

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>5.3.22</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webflux</artifactId>
<version>5.3.22</version>
<scope>compile</scope>
</dependency>

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
9.5.1
TAGS
AUG Leaders

Atlassian Community Events