Today, my colleague encountered a problem in implementing the project, that is, the project was deployed on the Tomcat server, but the access path was always not found. Tomcat reported context [] startup failed due toprevious errors
At that time, I felt very depressed. The project was fully packaged by the local test. This problem rarely occurred during the implementation of previous projects. I searched the internet for the following solutions:
------ Solution -------------------------------------------------
Try clearing Tomcat Cache
------ Solution ------------------------------------------------
In this case, it is very likely that the class is dirty in your application. Or some java files do not have
It has passed the compiler check.
Please clean and compile again.
------ Solution -------------------------------------------------
After the framework is set up, the following information appears when you start the server:
Log4j: warn no appenders cocould be found for logger (Org. Apache. commons. digester. digester ).
Log4j: Warn please initialize the log4j system properly.
2009-11-6 21:39:17 org. Apache. Catalina. Core. standardcontext start
Severe: Error listenerstart
2009-11-6 21:39:17 org. Apache. Catalina. Core. standardcontext start
Severe: context startup failed due to previous errors
2009-11-6 21:39:17 org. Apache. Catalina. Core. standardhostdeployer install
Information: Installing web application at context path/tomcat-docs from URL File: D:/Server/tomcat 5.0/webapps/tomcat-docs
2009-11-6 21:39:17 org. Apache. Catalina. Core. standardhostdeployer install
Information: Installing web application at context path/WebDAV from URL File: D:/Server/tomcat 5.0/webapps/WebDAV
....
Possible errors:
1. Web. xml file: Web application deployment descriptor, which contains the deployed XML file or class. If these files cannot be found, a startup failed due to previous errors error occurs.
2. If spring is applied, this error will also be reported if the classes and XML files defined in the configuration file applicationcontext. xml cannot be found.
3. Any errors in the web. XML, Struts. XML, and applicationcontext. xml files may cause this problem, not just the file errors.
4. If ibatis is used, this error is returned if the XML file defined in sqlmapconfig. xml cannot be found. (Hibernate configuration uses the spring configuration file when integrating spring)
5. For JDK version problems, it is best to use JDK or a later version.
6. Compatibility Between eclipse and tomcat versions
7. This error may also occur when the jar package imported to lib conflicts during framework integration.
8. This error can also be generated if the jar package is missing or the version of the jar package is used.
9. Other reasons
Solution:
The problem above may have been caused by an internal error on the Web server, and the log information in the IDE is small, so it is difficult to solve the problem.
This problem often leads to an HTTP 404 error where the page Jump fails to find the file .....
You can add a log file to Tomcat to make the log information prompt more accurate, that is, set the log output level.
/Usr/local/tomcat2/webapps/digital/WEB-INF/classes/log4j. Properties
Log4j. properties is configured as follows (the configuration is reprinted ):
Log4j. rootlogger = info, console, R
Log4j. appender. Console = org. Apache. log4j. leleappender
Log4j. appender. Console. layout = org. Apache. log4j. patternlayout
# Log4j. appender. Console. layout. conversionpattern = % d [% T] %-5 p % C-% m % N
Log4j. appender. Console. layout. conversionpattern = % d {YY-mm-dd hh: mm: SS} % 5 P % c {1}: % L-% m % N
Log4j. appender. r = org. Apache. log4j. dailyrollingfileappender
Log4j. appender. R. File =$ {Catalina. Home}/logs/tomcat. Log
Log4j. appender. R. layout = org. Apache. log4j. patternlayout
Log4j. appender. R. layout. conversionpattern = % d {YYYY. Mm. dd hh: mm: SS} % 5 P % c {1} (% L ):? % M % N
Log4j.logger.org. Apache = info, R
Log4j.logger.org. Apache. Catalina. Core. containerbase. [Catalina]. [localhost] = debug, R
Log4j.logger.org. Apache. Catalina. Core = info, R
Log4j.logger.org. Apache. Catalina. Session = info, R
After changing the log information, I am afraid it is too full. I will not find the hard disk space in the future, so I keep the old configuration information:
# Log4j. rootlogger = info, stdout
Log4j. appender. stdout = org. Apache. log4j. leleappender
Log4j. appender. stdout. layout = org. Apache. log4j. patternlayout
Log4j. appender. stdout. layout. conversionpattern = % 5 p [% T]-% m % N
#
Log4j. appender. File = org. Apache. log4j. rollingfileappender
Log4j. appender. file. File = C:/subject. Log
Log4j. appender. file. maxfilesize = 100kb
Log4j. appender. file. maxbackupindex = 0
Log4j. appender. file. layout = org. Apache. log4j. simplelayout
Log4j. appender. file. layout. conversionpattern = [SSH] % P % T % C-% m % N
#
Log4j.logger.com. ibatis = debug, ibatis
Log4j.logger.com. ibatis. Common. JDBC. simpledatasource = debug, ibatis
Log4j.logger.com. ibatis. Common. JDBC. scriptrunner = debug, ibatis
Log4j.logger.com. ibatis. sqlmap. Engine. impl. sqlmapclientdelegate = debug, ibatis
#
Log4j. Logger. java. SQL. Connection = debug, ibatis
Log4j. Logger. java. SQL. Statement = debug, ibatis
Log4j. Logger. java. SQL. preparedstatement = debug, stdout, ibatis
Log4j. Logger. java. Lang. Exception = debug, ibatis
#
Log4j. appender. ibatis = org. Apache. log4j. rollingfileappender
Log4j. appender. ibatis. File = C:/ibatis. Log
Log4j. appender. ibatis. maxfilesize = 100kb
Log4j. appender. ibatis. maxbackupindex = 0
Log4j. appender. ibatis. layout = org. Apache. log4j. simplelayout
Log4j. appender. ibatis. layout. conversionpattern = [SSH] % P % T % C-% m % N
Log4j.logger.com. opensymphony. xwork2 = Error
2. Copy the log4j-1.2.15.jar and commons-logging.jar package... Apache Software Foundation/tomcat 5.5/common/lib.
Complete the preceding two steps. When the server is started, it will be in the tomcat installation path .. Apache Software Foundation/tomcat 5.5/logs
Generate the tomcat. Log File to record the log information.
Note: Many logs are recorded in the tomcat. log file. If it is too large, the disk space may be insufficient. We recommend that you clear the logs regularly.
The above log file information can be used to locate the specific root cause of the problem. You can solve the problem by carefully checking the problem.
After I build the framework. when the welcome page configured in the XML file is displayed, the Error 404 is reported. Two errors are found through the above method. Although it took two days, the solution is finally solved.
------ Solution -------------------------------------------------
Check the Tomcat log to see what the problem is.
According to the above, I have all the operations, and finally checked the Tomcat log, the server reported
Serious: Error listenerstart, and then trace the search to understand that it is the datasource problem of applicationcontext. XML, and the database address is wrong. Haha, a detailed problem. Busy one morning
Attached to the following error:
2-02-14 23:17:38 info drivermanagerconnectionprovider: 170-cleaning up connection pool: JDBC: jtds: sqlserver: // 192.168.88.138: 1433; databasename = szhxy_db
12-02-14 23:17:38 error contextloader: 215-context initialization failed
Org. springframework. beans. factory. beancreationexception: Error creating bean with name 'sqlmapclient' defined in file [/usr/local/tomcat1/webmediaworkflow/WEB-INF/classes/applicationcontext. XML]: Invocation of init method failed; Nested exception is Java. lang. runtimeexception: error occurred. cause: COM. ibatis. common. XML. nodeletexception: Error parsing XML. cause: Java. lang. runtimeexception: Error parsing XPath '/sqlmapconfig/sqlmap '. cause: COM. ibatis. common. XML. nodeletexception: Error parsing XML. cause: Java. lang. runtimeexception: Error parsing XPath '/sqlmap/resultmap/result '. cause: COM. ibatis. common. beans. probeexception: There is no writeable property named 'lx 'in class 'com. dsideal. xspj. bean. xspjpytype'
At org. springframework. Beans. Factory. Support. abstractautowirecapablebeanfactory. initializebean (abstractautowirecapablebeanfactory. Java: 1336)
At org. springframework. Beans. Factory. Support. abstractautowirecapablebeanfactory. docreatebean (abstractautowirecapablebeanfactory. Java: 471)
At org. springframework. Beans. Factory. Support. abstractautowirecapablebeanfactory $ 1.run( abstractautowirecapablebeanfactory. Java: 409)
At java. Security. accesscontroller. doprivileged (native method)
At org. springframework. Beans. Factory. Support. abstractautowirecapablebeanfactory. createbean (abstractautowirecapablebeanfactory. Java: 380)
At org. springframework. Beans. Factory. Support. abstractbeanfactory $1. GetObject (abstractbeanfactory. Java: 264)
At org. springframework. Beans. Factory. Support. defaultsingletonbeanregistry. getsingleton (defaultsingletonbeanregistry. Java: 220)
At org. springframework. Beans. Factory. Support. abstractbeanfactory. dogetbean (abstractbeanfactory. Java: 261)
At org. springframework. Beans. Factory. Support. abstractbeanfactory. getbean (abstractbeanfactory. Java: 185)
At org. springframework. Beans. Factory. Support. abstractbeanfactory. getbean (abstractbeanfactory. Java: 164)
At org. springframework. Beans. Factory. Support. defaultlistablebeanfactory. preinstantiatesingletons (defaultlistablebeanfactory. Java: 423)
At org. springframework. Context. Support. abstractapplicationcontext. finispolicanfactoryinitialization (abstractapplicationcontext. Java: 729)
At org. springframework. Context. Support. abstractapplicationcontext. Refresh (abstractapplicationcontext. Java: 381)
At org. springframework. Web. Context. contextloader. createwebapplicationcontext (contextloader. Java: 255)