Class bytes found but defineClass()failed for: 'org.springframework.web.servlet.view.json.JsonView'

Error registering bean with name 'jsonView' defined in ServletContext resource [/WEB-INF/views.xml]: Bean class [org.springframework.web.servlet.view.json.JsonView] not found; nested exception is java.lang.ClassNotFoundException: Class bytes found but defineClass()failed for: 'org.springframework.web.servlet.view.json.JsonView'
Amar-msAsked:
Who is Participating?
 
pallab_lahiriConnect With a Mentor Commented:
It is a Java version compatibility issue.
Check that your java version used to compile the classes ( Most probably you are using an IDE, so check the supported JDK version there)

Then check the Java version used in the container (run time environment, your app server).  There is some difference there.  

if you think why it is NOT creating problem for rest: you might have used some feature in this particular Class which is not either backward or forward compatible.
0
 
Sathish David Kumar NArchitectCommented:
ur class file is not in the path u have mentioned!
0
 
objectsCommented:
Its failing to read JsonView.class, check that it was compiled with a compiler that is compatible with the vm you are running it on
0
 
Sathish David Kumar NArchitectCommented:
Hi Amar,

Can u show me the definetion in ur xml and class
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.