Search code examples
nosuchmethoderrorspring5spring-flex

spring-flex 1.0.3.RELEASE issue in integrating spring 5.3.20


Currently using spring-flex 1.0.0.M2, As part of spring upgrade to 5.3.20, upgraded spring-flex to 1.5.2.RELEASE. I'm getting the following error:

ERROR [org.springframework.web.servlet.DispatcherServlet] [localhost-startStop-1] Context initialization failed - org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/flex] Offending resource: ServletContext resource [/WEB-INF/applicationContext-flex.xml]

I added the dependency on pom.xml, still getting the same error.

I see spring-flex-1.5.2.RELEASE does not have jar. It only has pom file. So, I changed the version to spring-flex-1.0.3.RELEASE, which has the jar and I am getting the below error:

ERROR [org.springframework.web.servlet.DispatcherServlet] [localhost-startStop-1] Context initialization failed - org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from ServletContext resource [/WEB-INF/applicationContext-flex.xml]; nested exception is org.springframework.beans.FatalBeanException: Unresolvable class definition for NamespaceHandler class [org.springframework.flex.config.xml.FlexNamespaceHandler] for namespace [http://www.springframework.org/schema/flex]; nested exception is java.lang.NoSuchMethodError: org.springframework.util.ClassUtils.forName(Ljava/lang/String;)Ljava/lang/Class;

One of the classes in the 1.0.3.RELEASE jar is referring to class in spring 3.

I want to know what is the compatible spring-flex version for spring 5 or I need to resolve the above error.

Any help would be appreciated.


Solution

  • https://github.com/spring-projects/spring-framework/issues/28737

    Spring Flex is not active and there is no official support for it. This has been the case for many years now. As a result, there is no version compatible with Spring Framework 5.