Eclipse running project in Tomcat environment Noclassdeffounderror/classnotfoundexception solution

Source: Internet
Author: User
Tags tomcat server

For this error, there can is different solutions. I have noted down the ones that had worked for me.

solution 1. This is all happened in deployment and debugging environment. In deployment environment, just make sure your server classpath have included the Spring Jar library (e.g Spring-4.0.4.jar) .

In debugging environment, the steps could vary from the different IDE, but the solution is same. In Eclipse, developers usually would create a tomcat, Jboss...whatever application Server for debugging, just make sure the C Orrect Spring jars is included.

    1. Double Click on your debugging server
    2. Click on the ' Open launch configuration ' to access the server environment
    3. Click on the Classpath tab
    4. Include the spring jar file here, it may also required common log jar due to Spring dependency.
    5. Done, run your application again.

.

Solution 2. If you is using Maven as a build tool and downloading dependencies using it, there can be some jar conflict. Because TOMCAT Servers normally provide some jars such as Servlet-api and Jpa-api. So if you again included them using Maven; There'll is problems in identifying them.

Solution 3. If you are using the Eclipse as your IDE and using Maven as your build tool and Tomcat as your server; Remember Tomcat server won't look on the jars which is just inside the folders. For that there ' s a small trick,

    1. Right click on your project and select Properties
    2. From the displayed window, select Deployment Assembly
    3. Select Add
    4. ADD Maven Dependencies
    5. Click Apply and click OK

Hope One of these solutions would help you to solve your problem. Happy Coding and make sure which is using Java.

Original address: https://stackoverflow.com/questions/15989325/ java-lang-noclassdeffounderror-org-springframework-context-applicationcontext/22746332#22746332

Eclipse running project in Tomcat environment Noclassdeffounderror/classnotfoundexception solution

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.