Linux: Record a tortuous process that deals with the death of a Tomcat boot card without error

Source: Internet
Author: User
Tags wubi log4j

First, the environment

System: CentOS 5.5

Tomcat 6.0

jdk1.6

Second, the phenomenon of problems

Our company recently asked people to do a project to be completed, because the other side is responsible for the development of Java engineers do not know Linux, and there is no full-time Linux engineers, finally, I can only deploy, and at first did not feel that there will be more trouble, Just follow the usual routines, okay, first run the project in my local Environment (Windows), however ...

........ (Omit due to the development environment is not the same as the cause of the process, but also the other side of the code of the various pits, but I also can't get the source file ...)

A toss, finally in the local run up, thank goodness, feel the dawn is coming, walk! On the server ... what?

All right! I admit, it's all crap, let me vent, okay, get to the point.

Yes, after uploading the server, the road of twists and turns is just beginning, because when I started Tomcat, it actually started half of the move, what do you mean, at least give me a mistake? (Problem put out)

Information:  using a shared selector for servlet write/read2016-9-11 11:41:31  org.apache.coyote.http11.http11nioprotocol init Information:  initializing coyote http/1.1  on http-84842016-9-11 11:41:31 org.apache.catalina.startup.catalina load Information:  initialization processed in 549 ms2016-9-11 11:41:32  Org.apache.catalina.core.standardservice start Information: starting service catalina2016-9-11  11:41:32 org.apache.catalina.core.standardengine start Information:  starting servlet engine:  Apache Tomcat/6.0.322016-9-11 11:41:32 org.apache.catalina.startup.HostConfig  Deploydirectory Information: deploying web application directory rootclazz --->  class com.fenxiao.user.entity.userclazz ---> class  com.fenxiao.card.entity.bankcardclazz ---> class com.fenxiao.pay.entity.payrecordclazz ---> class com.fenxiao.present.entity.PresentRecordclazz ---> class  com.fenxiao.task.entity.TaskImgclazz ---> class  com.fenxiao.task.entity.taskscreenshotclazz ---> class com.fenxiao.mytask.entity.usertask

There's no more then ...


Third, processing


First instinct, don't see the problem, then you can only guess the possibility. (The final proof of this practice is ...) Not very good)


Idea 1: Is it a software version of the problem?

But the code is fine-tuned, the same software version on the Window System (WIN10), has been successfully run! No, upgrade your environment, change the server with jdk1.8, and then upgrade Tomcat to 7.0. Re-run ... And then... It's not going so well! And then in the local Windows system also a jdk1.8 and tomcat7.0 as a comparison, the result of course, it is still on the windows of the carefree! I really want to slap you to death ...


Train of thought 2: Can't it be my system?

Are you kidding! My system ran a few years of Java services, you suspect me? OK, although the version is a bit low, but ... Forget it, don't think about it, do you want me to upgrade the system? Although the Tomcat boot log also prompts me to install XXX, I know that it is neither a warning nor a mistake, and is unlikely to be the cause of the boot. But, what is the problem?


Idea 3: Since the environment is not a problem, that a little bit of troubleshooting code, elimination method ... (Torture AH ~)

Finally delete in various files ... Reboot, part code Delete ... Restart ... I can't remember how many times I've tried it all day long. Anxiety, madness, helplessness ... Finally I also just get a conclusion, as long as the Web. xml file appears in the STRUTS2 configuration file will not start, a comment on the up, this ...

Well, seems to toss out useful things, just beginning or a little excitement, it should be adjusted under the Struts2 configuration is good, various attempts ... Refer to Previous configuration ... Try again ... (no matter how hard I tried, you were there, ignoring me, as if you didn't exist!) )

Train of thought 4: rush to collapse Ah! I Baidu do not know what to search, blind to find it, "Tomcat can not Start" "Tomcat Startup Card Dead" ....

Again a toss, there is said to be a database connection problem, but that can not get stuck, up to a period of time to throw the wrong, and I this spring file basically all smoothly loaded (the key configuration file I have also removed some of the code, restart ...) N times).

Some people say that is the memory problem, the boot memory setting is not enough? Memory overflow? Some people say the database connection pool problem, or the configuration file is not written well, the dead loop problem ... Let me see how much memory you took, free-m ...

Over 500m! Look at the other Tomcat also less than 200M, as if a little meaning, but also good ah, set a big point to try to study the related configuration

http://wujt.iteye.com/blog/1699597

Http://blog.chinaunix.net/uid-26863299-id-3559878.html

I try to set the big, it actually occupies 1 g, this ... I think you have a problem ... The code is poorly written, but where is the problem? Ah ~ Ah ~ seems to be around again, where to write a problem??!

Okay, let's just leave a normal configuration in the tomcat/bin/catalina.sh.

java_opts= '-server-xms1500m-xmx1500m-xx:maxnewsize=512m-xx:maxpermsize=512m-djava.awt.headless=true '


Idea 5: No, I still need to see the error message, let me see a more detailed log, how to see? (Teenager, you should have thought that from the beginning ~ ~)

Some people say modified tomcat configuration, some people say with log4j, others say ... Let's go through the study.

http://blog.csdn.net/senssic/article/details/46225841

Http://blog.chinaunix.net/uid-22816738-id-3511411.html

All right, do it, open the project file, what? Have you already configured log4j? Open to see ... Sister's, how all comments, no wonder that this log, all untie the comments (of course, finally found that only need to change a word, it is already aware of the wrong, and fill the theoretical knowledge after the incident happened)

http://blog.csdn.net/u012422446/article/details/51199724

OK, that's it, Log4j.rootlogger=debug, stdout (change the previous error to debug)

Local, server have run a turn, I come to compare, have a annoying scheduled task execution log has been repeated printing, at the beginning of thought you are dead loop ... Although it turns out that you are innocent.

Server still did not start success, however, you probably can not escape my palm, just print so many logs, there is no error ah ~ (Juvenile, if there is an error, log4j already showed you), OK, I admit!

I'll see ...

Local all the way to the successful start, the server can run to here after the ... Only that timed task log was duplicated.

20:05:53,133 DEBUG xmlconfigurationprovider:57-loading Action Configurations from:struts-plugin.xml20:05:53,133 DEBUG filemanager:57-creating Revision for url:jar:file:/usr/local/tomcat3/webapps/fenxiao/web-inf/lib/ Struts2-json-plugin-2.3.1.2.jar!/struts-plugin.xml

And look at the local execution of ... Clearly is then loaded struts2 configuration file, no wonder you did not start up, Iers is you did not find the file you want, but also so persistent ... Refused to quit ... No error ...

20:04:39,041 debug filemanager:57 - creating revision for url: jar: FILE:/F:/SOFTWARE-TEST/TOMCAT7 (32-64)/webapps/fenxiao/web-inf/lib/struts2-spring-plugin-2.3.7.jar!/ struts-plugin.xml20:04:39,047 debug xmlconfigurationprovider:57 - loaded action  Configuration from: struts-plugin.xml20:04:39,048  info xmlconfigurationprovider:31  - Parsing configuration file [struts-plugin.xml]20:04:39,053 DEBUG  Xmlconfigurationprovider:57 - loaded type:com.opensymphony.xwork2.objectfactory name: spring impl:org.apache.struts2.spring.strutsspringobjectfactory20:04:39,053 debug  xmlconfigurationprovider:57 - loading action configurations from: struts.xml20:0 4:39,055 debug filemanager:57 - creating revision for url: file:/f:/ SOFTWARE-TEST/TOMCAT7 (32-64)/webapps/fenxiao/web-inf/Classes/struts.xml20:04:39,082 debug xmlconfigurationprovider:57 - loading action  configurations from: user.xml20:04:39,084 debug filemanager:57 - creating  REVISION FOR URL: FILE:/F:/SOFTWARE-TEST/TOMCAT7 (32-64)/webapps/fenxiao/web-inf/classes/ user.xml20:04:39,107 debug xmlconfigurationprovider:57 - loaded action  configuration from: user.xml20:04:39,107 debug xmlconfigurationprovider:57 -  loading action configurations from: agent.xml20:04:39,110 debug filemanager:57  - CREATING REVISION FOR URL: FILE:/F:/SOFTWARE-TEST/TOMCAT7 (32-64)/webapps/ fenxiao/web-inf/classes/agent.xml20:04:39,115 debug xmlconfigurationprovider:57 - loaded  action configuration from: agent.xml20:04:39,115 debug xmlconfigurationprovider : 57 - loading action&Nbsp;configurations from: role.xml20:04:39,116 debug filemanager:57 - creating  REVISION FOR URL: FILE:/F:/SOFTWARE-TEST/TOMCAT7 (32-64)/webapps/fenxiao/web-inf/classes/ role.xml20:04:39,121 debug xmlconfigurationprovider:57 - loaded action  configuration from: role.xml20:04:39,121 debug xmlconfigurationprovider:57 -  loading action configurations from: admin.xml20:04:39,123 debug filemanager:57  - CREATING REVISION FOR URL: FILE:/F:/SOFTWARE-TEST/TOMCAT7 (32-64)/webapps/ fenxiao/web-inf/classes/admin.xml20:04:39,144 debug xmlconfigurationprovider:57 - loaded  action configuration from: admin.xml20:04:39,144 debug xmlconfigurationprovider : 57 - loading action configurations from: adminrole.xml20:04:39,147 debug  filemanager:57 - crEATING REVISION FOR URL: FILE:/F:/SOFTWARE-TEST/TOMCAT7 (32-64)/webapps/FenXiao/WEB-INF/ Classes/adminrole.xml20:04:39,151 debug xmlconfigurationprovider:57 - loaded action  configuration from: adminrole.xml20:04:39,151 debug xmlconfigurationprovider:57  - loading action configurations from: kindeditor.xml20:04:39,153 debug  filemanager:57 - creating revision for url: file:/f:/software-test/tomcat7 (32-64)/webapps/fenxiao/web-inf/classes/kindeditor.xml

    Look up more logs, about struts2 in addition to loading the Struts-plugin.xml file, also loaded the Struts-default.xml file, However, the Struts-default.xml file was successfully loaded locally and on the server. What are they doing with that? Why is struts-plugin.xml loading going to die? All in Baidu search ... (or what?) )

20:04:38,364 debug filemanager:57 - creating revision for url: jar: FILE:/F:/SOFTWARE-TEST/TOMCAT7 (32-64)/webapps/fenxiao/web-inf/lib/struts2-core-2.3.7.jar!/struts-default.xml20 :04:38,785 debug xmlconfigurationprovider:57 - loaded action configuration  From: struts-default.xml20:04:38,790  info xmlconfigurationprovider:31 - parsing  configuration file [struts-default.xml]20:04:38,798 debug xmlconfigurationprovider : 57 - loaded type: name:xwork impl:com.opensymphony.xwork2.objectfactory20:04:38,802  debug xmlconfigurationprovider:57 - loaded type: Com.opensymphony.xwork2.objectfactory name:struts impl:org.apache.struts2.impl.strutsobjectfactory20 : 04:38,804 debug xmlconfigurationprovider:57 - loaded type: Com.opensymphony.xwork2.filemanager name:system impl:com.opensymphony.xwork2.util.fs.defaultfilemanager20:04:38,809 debug xmlconfigurationprovider:57 - loaded  type:com.opensymphony.xwork2.filemanagerfactory name:xwork impl: Com.opensymphony.xwork2.util.fs.defaultfilemanagerfactory20:04:38,809 debug xmlconfigurationprovider : 57 - loaded type:com.opensymphony.xwork2.filemanagerfactory name:struts impl: Com.opensymphony.xwork2.util.fs.DefaultFileManagerFactory

Search a circle, ah ~ Certainly did not see the same problem with me! (This ...) have been very accustomed to it, but there is an article let me think about it, in fact, it is decided to continue to mask a (cough ~ hope or to have, in case of the right!) )

http://blog.csdn.net/chexitianxia/article/details/6746345

However, the jar package is so much, or someone else's project, I can not pinpoint which jar to deal with, OK, then I will look at the beginning of struts the jar package, only found the three. There are two "plugin" words, see them my heart is complex ...

650) this.width=650; "Src=" Http://s4.51cto.com/wyfs02/M00/87/43/wKioL1fZRW3BvfiBAAANudyG5zs156.png-wh_500x0-wm_3 -wmp_4-s_2884366783.png "title=" QQ Wubi not named. png "alt=" wkiol1fzrw3bvfibaaanudyg5zs156.png-wh_50 "/>

And then I can only compare with those projects that are running on the server what's different about the Struts2 jar package? Finally, it's just that their version is a little bit higher than the version of the jar package. But, you! The spring and Hibernate versions you used for this project are taller than me, why is the jar package version of struts2 lower than mine? Must be upgraded! (There's usually no harm in doing this ...) Yes, it is. Cough ~)

I looked at the other jar bags, and when I saw Spring's large area, my heart was messy, this strange name, and the word "test", and there were two! Stick it out and look (cough ~ It's a little off-topic, just want to spit a groove). Wait a minute... There is also a "struts", just above the "test", I think it conflicts with one of the jar package, delete it, just I always feel this project struts2 and spring is very disharmony, why? Or the so-called intuition ... (However, it turns out that it's not its fault, it's okay, I'll put it back for you, cough ~)

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M02/87/44/wKioL1fZSmGw9ddXAAAqHx9Xv3I264.png-wh_500x0-wm_3 -wmp_4-s_4258023433.png "title=" QQ Wubi unnamed 3.png "alt=" Wkiol1fzsmgw9ddxaaaqhx9xv3i264.png-wh_50 "/>

In this way, I upgrade the server's three struts2 jar package, then delete the Spring jar package and reboot to see ... what? Started so fast, did it succeed? Why Because Struts2 's package version is low? Or is that spring jar-bag conflict? (yes, I was surprised at the time, a little excited, a little dull, also ...) A bit of a crash ... Because dealing with this problem, I was tossing for three days, this ... )

I am a serious person, I never wrong a jar bag, cough ~ I decided to put that spring jar bag back and try again ... Results... The result of this project is my problem ah, actually just struts2 jar package version is a little low, to be cured! At least upgrade to three years ago this server favor version ~~!


Iv. Conclusion


This... Things have come to this, I don't know what to say ... (Just, teenager, if you encounter a similar situation, remember starting with the idea 5, "Please let me see more detailed data first ...")

Well, it's been a problem for three days, and then another three hours to write an article, well, that's it.

It's 21:43 in the evening, it's time to eat, but not this time. Not on time to eat, is not to listen to the performance of Mother words, tomorrow is the mid-Autumn Festival! What? Moon Cakes? That's for tomorrow.



This article is from the "Art Morning Blog" blog, please be sure to keep this source http://ycgit.blog.51cto.com/8590215/1852863

Linux: Record a tortuous process that deals with the death of a Tomcat boot card without error

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.