Struts 2 Learning (errors related to unable to load Bean: Type: Class: COM. opensymphony. xwork2.objectfactory)

Source: Internet
Author: User

I think the first example on the official struts2 website is not very good,
Put all the jar packages of struts2 under Web-INF/lib, and the result is always incorrect.

The following two errors are returned:

-------------------------------------------------------------------
Unable to load Bean: Type: COM. opensymphony. xwork2.objectfactory class: Org. apache. struts2.spring. strutsspringobjectfactory-bean-jar: file:/D:/workspace /. metadata /. plugins/org. eclipse. WST. server. core/tmp0/wtpwebapps/teststruts/WEB-INF/lib/struts2-spring-plugin-2.0.6.jar! /Struts-plugin.xml: 8: 132
At com. opensymphony. xwork2.config. providers. xmlconfigurationprovider. Register (xmlconfigurationprovider. Java: 208)
At org. Apache. struts2.config. strutsxmlconfigurationprovider. Register (strutsxmlconfigurationprovider. Java: 101)

Caused by: Java. Lang. noclassdeffounderror: ORG/springframework/Context/applicationcontextaware

---------------------------------------------------------------------

I checked it several times in other places, but an error occurred when I ran tomcat. I found it for half a day because it turned out to be
Don't see the following http://struts.apache.org/2.x/docs/simple-setup.html

If any struts 2 plugins are encoded, then other jars may be needed too. For example, the optional spring plugin requires the spring jars to be present.

This is too demanding for beginners. If you don't know what spring is, don't use struts2.

Remove those jar packages, (simple, leave xwork-2.0.4.jar, commons-logging-1.0.4.jar, freemarker-2.3.8.jar, ognl-2.6.11.jar, struts2-core-2.0.11.jar) can run.

 

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.