Newbie: After deploying struts2.0.9, start Tomcat 6 and report an error.

Source: Internet
Author: User
Tags apache tomcat

I am a newbie and I am a beginner in struts. I recorded errors.

Tomcat version: tomcat-6.0.18

Myeclipse: myeclipse 8.5

Struts version: Struts-2.0.9

After being deployed to the Tomcat 6 server, the following error is reported when the server is started::

2012-8-17 15:12:36 org. Apache. Catalina. Core. aprlifecyclelistener init
Information: The APR based Apache Tomcat native library which allows optimal performance in production environments was not found

On the java. Library. Path: D: \ Java \ jdk1.6.0 _ 10 \ bin; D: \ Tomcat 6.0 \ bin
15:12:36 org. Apache. Coyote. http11.http11protocol init
Information: initializing coyote HTTP/1.1 on http-8080
15:12:36 org. Apache. Catalina. startup. Catalina Load
Information: initialization processed in 469 MS
2012-8-17 15:12:36 org. Apache. Catalina. Core. standardservice start
Information: starting service Catalina
2012-8-17 15:12:36 org. Apache. Catalina. Core. standardengine start
Information: Starting Servlet Engine: Apache Tomcat/6.0.18
15:12:37 com. opensymphony. xwork2.config. providers. xmlconfigurationprovider register
Information: parsing configuration file [struts-default.xml]
15:12:38 com. opensymphony. xwork2.config. providers. xmlconfigurationprovider register
Information: parsing configuration file [struts-plugin.xml]
15:12:38 org. Apache. Catalina. Core. standardcontext filterstart
Severe: exception starting filter struts2
Unable to load Bean: Type: COM. opensymphony. xwork2.objectfactory class: org. Apache. struts2.spring. strutsspringobjectfactory-

Bean-jar: file:/D:/tomcat % 206.0/webapps/struts2userlogin/WEB-INF/lib/struts2-spring-plugin-2.0.9.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)
At com. opensymphony. xwork2.config. impl. defaultconfiguration. Reload (defaultconfiguration. Java: 131)
At com. opensymphony. xwork2.config. configurationmanager. getconfiguration (configurationmanager. Java: 52)
At org. Apache. struts2.dispatcher. Dispatcher. init_preloadconfiguration (dispatcher. Java: 395)
At org. Apache. struts2.dispatcher. Dispatcher. INIT (dispatcher. Java: 452)
At org. Apache. struts2.dispatcher. filterdispatcher. INIT (filterdispatcher. Java: 201)
....
Caused by: Java. Lang. noclassdeffounderror: ORG/springframework/Context/applicationcontextaware
At java. Lang. classloader. defineclass1 (native method)
At java. Lang. classloader. defineclass (classloader. Java: 621)
At java. Security. secureclassloader. defineclass (secureclassloader. Java: 124)
At org. Apache. Catalina. loader. webappclassloader. findclassinternal (webappclassloader. Java: 1847)
At org. Apache. Catalina. loader. webappclassloader. findclass (webappclassloader. Java: 890)
At org. Apache. Catalina. loader. webappclassloader. loadclass (webappclassloader. Java: 1354)
At org. Apache. Catalina. loader. webappclassloader. loadclass (webappclassloader. Java: 1233)
... More
Caused by: Java. Lang. classnotfoundexception: org. springframework. Context. applicationcontextaware
At org. Apache. Catalina. loader. webappclassloader. loadclass (webappclassloader. Java: 1387)
At org. Apache. Catalina. loader. webappclassloader. loadclass (webappclassloader. Java: 1233)
At java. Lang. classloader. loadclassinternal (classloader. Java: 320)
... More
15:12:38 org. Apache. Catalina. Core. standardcontext start
Severe: Error filterstart
15:12:38 org. Apache. Catalina. Core. standardcontext start
Severe: context [/struts2userlogin] startup failed due to previous errors
15:12:38 org. Apache. Coyote. http11.http11protocol start
Information: Starting coyote HTTP/1.1 on http-8080
15:12:38 org. Apache. JK. Common. channelsocket init
Information: JK: ajp13 listening on/0.0.0.0: 8009
2012-8-17 15:12:38 org. Apache. JK. server. jkmain start
Description: JK running id = 0 time = 0/29 Config = NULL
15:12:38 org. Apache. Catalina. startup. Catalina start
Information: server startup in 1663 MS

I searched for the materials online, Because I imported jar files.Package yes. If one is missing, the following packages should be imported::

Add commons-logging-1.0.4.jarAnd do not report these errors. However, the following error is reported.:

Severe: Document is invalid: No grammar found. At (null: 3: 8)
Org. xml. Sax. saxparseexception: Document is invalid: No grammar found.
At com.sun.org. Apache. xerces. Internal. util. errorhandlerwrapper. createsaxparseexception (errorhandlerwrapper. Java: 195)
At com.sun.org. Apache. xerces. Internal. util. errorhandlerwrapper. Error (errorhandlerwrapper. Java: 131)
Omitted ....

At org. Apache. Catalina. startup. Bootstrap. Main (Bootstrap. Java: 413)
15:37:11 org. Apache. Catalina. Core. standardcontext filterstart
Severe: exception starting filter struts2
File:/D:/tomcat % 206.0/webapps/struts2userlogin/WEB-INF/classes/struts. xml: 3: 8
At com. opensymphony. xwork2.config. providers. xmlconfigurationprovider. loadconfigurationfiles (xmlconfigurationprovider. Java: 835)
At com. opensymphony. xwork2.config. providers. xmlconfigurationprovider. loadconfigurents (xmlconfigurationprovider. Java: 131)
At com. opensymphony. xwork2.config. providers. xmlconfigurationprovider. INIT (xmlconfigurationprovider. Java: 100)
Omitted...

Caused by: Document is invalid: No grammar found.-file:/D:/tomcat % 206.0/webapps/struts2userlogin/WEB-INF/classes/struts. xml: 3: 8
At com. opensymphony. xwork2.util. domhelper. parse (domhelper. Java: 123)
At com. opensymphony. xwork2.config. providers. xmlconfigurationprovider. loadconfigurationfiles (xmlconfigurationprovider. Java: 830)
... 34 more
Caused by: org. xml. Sax. saxparseexception: Document is invalid: No grammar found.
At com.sun.org. Apache. xerces. Internal. util. errorhandlerwrapper. createsaxparseexception (errorhandlerwrapper. Java: 195)
At com.sun.org. Apache. xerces. Internal. util. errorhandlerwrapper. Error (errorhandlerwrapper. Java: 131)

Omitted...

At com. opensymphony. xwork2.util. domhelper. parse (domhelper. Java: 121)
... 35 more
15:37:11 org. Apache. Catalina. Core. standardcontext start
Severe: Error filterstart
15:37:11 org. Apache. Catalina. Core. standardcontext start
Severe: context [/struts2userlogin] startup failed due to previous errors
15:37:11 org. Apache. Coyote. http11.http11protocol start
Information: Starting coyote HTTP/1.1 on http-8080
15:37:11 org. Apache. JK. Common. channelsocket init
Information: JK: ajp13 listening on/0.0.0.0: 8009
2012-8-17 15:37:11 org. Apache. JK. server. jkmain start
Description: JK running id = 0 time = 0/30 Config = NULL
15:37:11 org. Apache. Catalina. startup. Catalina start
Information: server startup in 1758 MS

The content of the Struts. xml configuration file is as follows:

<? XML version = "1.0" encoding = "UTF-8"?> <Struts> <! -- Add the default struts2 configuration file --> <include file = "struts-default.xml"/> <! -- Inherits the default struts2 configuration file, similar to Java inheritance --> <package name = "default" extends = "struts-Default"> <! -- Here, "hello" is the URL name of "Hello. Action" --> <action name = "hello" class = "Controller. helloaction"> <! -- Success points to configuration --> <result name = "success"> success.html </result> </Action> </package> </struts>

 Because the doctypt definition is missing in the Struts. xml file, add:

<!DOCTYPE struts PUBLIC    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"    "http://struts.apache.org/dtds/struts-2.0.dtd">

The correct configuration file is as follows:

<? XML version = "1.0" encoding = "UTF-8"?> <! Doctype struts public "-// Apache Software Foundation // DTD struts configuration 2.0 // en" "http://struts.apache.org/dtds/struts-2.0.dtd"> <struts> <! -- Add the default struts2 configuration file --> <include file = "struts-default.xml"/> <! -- Inherits the default struts2 configuration file, similar to Java inheritance --> <package name = "default" extends = "struts-Default"> <! -- Here, "hello" is the URL name of "Hello. Action" --> <action name = "hello" class = "Controller. helloaction"> <! -- Success points to configuration --> <result name = "success"> success.html </result> </Action> </package> </struts>

 

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.