Initialization of bean failed; nested exception is java.lang.NoSuchFieldError: org/springframework/core/convert/TypeDescriptor.NULL

StackOverflow https://stackoverflow.com/questions/23102454

Question

I have upgraded spring jars from 3.0.x to 3.2.x version in my web application. Target environment is Websphere Application Server.

I am getting the following error when I try to hit the welcome page of the webapp in the browser.

Error creating bean with name 'org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0':
Initialization of bean failed; nested exception is java.lang.NoSuchFieldError:
 org/springframework/core/convert/TypeDescriptor.NULL

It looks like some jar/jars in the build path are dependent on spring 3.0.x. I am not sure though. Will be helpful if anyone could out point the same.

I would also like to know how do I exclude dependency of other jars on spring 3.0.x in dispatcher-servlet.xml. Or should I upgrade any jar?

I am also trying to look for the culprit of the problem.

Build Path Screenshot

Was it helpful?

Solution 2

I happened to have find solution of my own problem.

I solved my original problem by removing old spring 3.0.x jars which were still there in WEB-INF/lib directory (but not in class path).

Second thing and answer to my second problem is that, In a Spring 3.2.x jar or above environment, Ajax call with content-type application/json do not support calls to url with .htm/.html extensions as web-app server throws 406 error. I had to change url extensions to anything else (.json I used for clarity).

Though there could be a different solution as well, but after searching a lot this is what proved to be a quick fix for me. Thanks for all the help.

OTHER TIPS

try this command on windows (if you are using maven)

mvn dependency:tree | find "springframework:" | find ":3.0"

or on *ix

mvn dependency:tree | grep "springframework:" | grep ":3.0"

that should be the culprit.

or manually issue

mvn dependency:tree > dep.txt

and view/edit dep.txt and search for ":3.0" (this will find other, non-spring, libraries as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top