linux 环境 tomcat 莫名奇妙挂掉
J2EE项目 本地运行无误,服务器运行,一段时间后报nullpointerException,但却不影响正常使用。
21-Jun-2018 05:08:37.819 SEVERE [http-nio-8080-exec-16] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NullPointerException at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:256) at org.apache.catalina.mapper.Mapper.map(Mapper.java:695) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:695) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:337) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 21-Jun-2018 07:40:23.854 SEVERE [http-nio-8080-exec-32] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NullPointerException at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:256) at org.apache.catalina.mapper.Mapper.map(Mapper.java:695) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:695) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:337) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 21-Jun-2018 07:40:24.435 SEVERE [http-nio-8080-exec-37] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NullPointerException at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:256) at org.apache.catalina.mapper.Mapper.map(Mapper.java:695) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:695) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:337) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 21-Jun-2018 07:40:24.969 INFO [http-nio-8080-exec-23] org.apache.coyote.http11.Http11Processor.service Error parsing HTTP request header Note: further occurrences of HTTP request parsing errors will be logged at DEBUG level. java.lang.IllegalArgumentException: Invalid character found in the HTTP protocol at org.apache.coyote.http11.Http11InputBuffer.parseRequestLine(Http11InputBuffer.java:517) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:291) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 21-Jun-2018 07:40:24.969 SEVERE [http-nio-8080-exec-23] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NullPointerException at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:256) at org.apache.catalina.mapper.Mapper.map(Mapper.java:695) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:695) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:337) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 21-Jun-2018 07:40:25.518 SEVERE [http-nio-8080-exec-39] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NullPointerException at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:256) at org.apache.catalina.mapper.Mapper.map(Mapper.java:695) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:695) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:337) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 21-Jun-2018 07:40:26.035 SEVERE [http-nio-8080-exec-42] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NullPointerException at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:256) at org.apache.catalina.mapper.Mapper.map(Mapper.java:695) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:695) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:337) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 21-Jun-2018 07:40:29.880 SEVERE [http-nio-8080-exec-43] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NullPointerException at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:256) at org.apache.catalina.mapper.Mapper.map(Mapper.java:695) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:695) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:337) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 21-Jun-2018 07:40:30.560 SEVERE [http-nio-8080-exec-38] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NullPointerException at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:256) at org.apache.catalina.mapper.Mapper.map(Mapper.java:695) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:695) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:337) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 21-Jun-2018 07:40:31.099 SEVERE [http-nio-8080-exec-36] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NullPointerException at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:256) at org.apache.catalina.mapper.Mapper.map(Mapper.java:695) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:695) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:337) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 21-Jun-2018 07:40:31.685 SEVERE [http-nio-8080-exec-44] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NullPointerException at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:256) at org.apache.catalina.mapper.Mapper.map(Mapper.java:695) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:695) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:337) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 21-Jun-2018 07:40:32.251 SEVERE [http-nio-8080-exec-49] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NullPointerException at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:256) at org.apache.catalina.mapper.Mapper.map(Mapper.java:695) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:695) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:337) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 21-Jun-2018 07:40:32.874 SEVERE [http-nio-8080-exec-45] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NullPointerException at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:256) at org.apache.catalina.mapper.Mapper.map(Mapper.java:695) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:695) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:337) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 21-Jun-2018 07:40:33.388 SEVERE [http-nio-8080-exec-46] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NullPointerException at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:256) at org.apache.catalina.mapper.Mapper.map(Mapper.java:695) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:695) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:337) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 21-Jun-2018 07:40:33.892 SEVERE [http-nio-8080-exec-48] org.apache.coyote.http11.Http11Processor.service Error processing request java.lang.NullPointerException at org.apache.tomcat.util.buf.CharChunk.append(CharChunk.java:256) at org.apache.catalina.mapper.Mapper.map(Mapper.java:695) at org.apache.catalina.connector.CoyoteAdapter.postParseRequest(CoyoteAdapter.java:695) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:337) at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:407) at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:754) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1376) at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) 21-Jun-2018 07:45:25.028 INFO [http-nio-8080-exec-41] org.apache.tomcat.util.http.parser.Cookie.logInvalidHeader A cookie header was received [1529391138; CNZZDATA1261058337=1187489812-1529021891-%7C1529389729; UM_distinctid=16400ef0c2f19d-0a15cb16ea153f-1c67035e-4a574-16400ef0c3044] that contained an invalid cookie. That cookie will be ignored.Note: further occurrences of this error will be logged at DEBUG level.
网上查到的原因:
1 环境jdk和tomcat版本原因;更换版本,然并卵。
2 域名配置原因;http://www.ithao123.cn/content-928555.html
需要在server.xml中的<Engine name="Catalina" defaultHost="localhost">标签下配置一个<Host name="localhost" >,这样他的defaultHost的值才不会被忽略,defaulthostname才会有值,这样就解决了那个tomcat运行时不时的报一个NullPointerException。
推荐:http://blog.csdn.net/u012906938/article/details/36718809
有结点配置,看了就明白为毛要报null指针。
但是看看还是有好处的,解决了我的另一个问题
本地服务器正常,但服务器spring mvc 定时任务跑两次
还是域名配置问题
<Engine name="Catalina" defaultHost="localhost"> <!--For clustering, please take a look at documentation at: /docs/cluster-howto.html (simple how to) /docs/config/cluster.html (reference documentation) --> <!-- <Cluster className="org.apache.catalina.ha.tcp.SimpleTcpCluster"/> --> <!-- Use the LockOutRealm to prevent attempts to guess user passwords via a brute-force attack --> <Realm className="org.apache.catalina.realm.LockOutRealm"> <!-- This Realm uses the UserDatabase configured in the global JNDI resources under the key "UserDatabase". Any edits that are performed against this UserDatabase are immediately available for use by the Realm. --> <Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/> </Realm> <!--<Host name="demo.songaw.com" appBase="/data/www/tomcat9.0-1/current/jeeplus/" unpackWARs="true" autoDeploy="true"> <Context path="" docBase="/data/www/tomcat9.0-1/current/jeeplus/jeeplus/" debug="0" reloadable="true" privileged="true"/> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="/data/var/log/tomcat/tomcat9.0-1/jeeplus" prefix="localhost_access_log" suffix=".txt" pattern="%{X-FORWARDED-FOR}i %l %u %t %r %s %b %D %q %{User-Agent}i" resolveHosts="false" /> </Host> <Host name="yl.songaw.com" appBase="/data/www/tomcat9.0-1/current/apidocs/" unpackWARs="true" autoDeploy="true"> <Context path="" docBase="/data/www/tomcat9.0-1/current/apidocs/apidocs/" debug="0" reloadable="true" privileged="true"/> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="/data/var/log/tomcat/tomcat9.0-1/apidocs" prefix="localhost_access_log" suffix=".txt" pattern="%{X-FORWARDED-FOR}i %l %u %t %r %s %b %D %q %{User-Agent}i" resolveHosts="false" /> </Host>--> <Host name="www.songaw.com" appBase="/data/www/tomcat9.0-1/current/webapps" unpackWARs="false" autoDeploy="false"> <Context docBase="/data/www/tomcat9.0-1/current/songaw/" path="" reloadable="true"/> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="/data/var/log/tomcat/tomcat9.0-1/songaw" prefix="localhost_access_log" suffix=".txt" pattern="%{X-FORWARDED-FOR}i %l %u %t %r %s %b %D %q %{User-Agent}i" resolveHosts="false" /> </Host> <Host name="localhost" appBase="/data/www/tomcat9.0-1/current/webapps" unpackWARs="true" autoDeploy="true" xmlValidation="false" xmlNamespaceAware="false"> <Context path="" docBase="/data/www/tomcat9.0-1/current/localhost/" debug="0" reloadable="true" privileged="true"/> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="/data/var/log/tomcat/tomcat9.0-1" prefix="localhost_access_log" suffix=".txt" pattern="%{X-FORWARDED-FOR}i %l %u %t %r %s %b %D %q %{User-Agent}i" resolveHosts="false" /> </Host> </Engine>
另外还有个spring mvc多个定时任务执行的小问题: 假如之前执行的一个定时任务没结束,下面的不执行的。
最后,域名配置指定项目方法。
tomcat 域名绑定到指定的项目上,也就是说http://localhost:8080/项目名=http://域名
1 更改8080 端口为80端口
2 修改上图划红蓝线的地方(蓝线那行是添加的),要说明的是 appBase="webapps"也是会运行你的定时器的,下面子结点再运行一次,可不就运行两次么
3 服务器host文件最好改,虽然不改也没什么。
我的个人首页http://www.songaw.com