Eclipse loads spring and struts2

Source: Internet
Author: User

Spring link:

Http://s3.amazonaws.com/dist.springframework.org/release/SPR/spring-framework-3.0.5.RELEASE.zip

 

After the download is complete, decompress the package to the appropriate directory. We recommend that you put the package in the eclipse directory.

There are two import methods. recommended method 1.

Method 1:

Preferences-> JAVA-> build path-> User Libraries

  • A new user library named spring
  • Add jars to add the jar package that has been decompressed to spring.
  • Click OK. OK.

  • Left-click Project name-> Properties

Java build path-> Add library-> User library-> next

Select the previously added user library and finish

The spring library is imported successfully.

Method 2:

Directly import the spring library file to the Java build path attribute of the project.

An error is reported when the spring test program is run after the spring library is imported:

 

Exception in thread "Main" Java. Lang. noclassdeffounderror: ORG/Apache/commons/logging/logfactory
 At org. springframework. Context. Support. abstractapplicationconteXT. <init> (abstractapplicationconteXT. Java: 160)
 At org. springframework. Context. Support. abstractrefreshableappliCationcontext. <init> (abstractrefreshableappliCationcontext. Java: 89)
 At org. springframework. Context. Support. abstractrefreshableconfiGapplicationcontext. <init> (abstractrefreshableconfiGapplicationcontext. Java: 59)
 At org. springframework. Context. Support. abstractxmlapplicationcoNtext. <init> (abstractxmlapplicationcoNtext. Java: 61)
 At org. springframework. Context. Support. filesystemxmlapplicationContext. <init> (filesystemxmlapplicationContext. Java: 137)
 At org. springframework. Context. Support. filesystemxmlapplicationContext. <init> (filesystemxmlapplicationContext. Java: 84)
 At erictest. erictest. Main (erictest. Java: 8)

It is found that the Spring-dependent commons-logging library is missing.

Commons-logging Library: http://commons.apache.org/logging/download_logging.cgi

After you import commons-logging in the same way, the program runs correctly.

Scatter flowers!

It is similar when eclipse loads struts2.

Reference http://www.cnblogs.com/ericsun/archive/2011/07/11/2103504.html

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.