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

Posted on 2009-12-22
Last Modified: 2013-11-11
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'
Question by:Amar-ms
    LVL 20

    Expert Comment

    by:Sathish David Kumar N
    ur class file is not in the path u have mentioned!
    LVL 92

    Expert Comment

    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
    LVL 20

    Expert Comment

    by:Sathish David Kumar N
    Hi Amar,

    Can u show me the definetion in ur xml and class
    LVL 1

    Accepted Solution

    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.

    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
    Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
    The viewer will learn how to implement Singleton Design Pattern in Java.
    The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now