Java Tomcat无误地崩溃了

Java Tomcat无误地崩溃了,java,tomcat,crash,raspberry-pi,Java,Tomcat,Crash,Raspberry Pi,我开发了一个非常简单的webapp,并打算将其部署到我的raspberry pi上,我在那里运行了archlinux。从tomcat运行启动脚本后,服务器日志以 "INFO: Server startup in 322789 ms" 这已经相当长了,但我认为这可能是由于树莓提供的低性能。无论如何,在启动阶段和服务器启动命令之后 "sudo lsof -n -P -i :8080" 成功运行,即显示进程正在侦听端口8080。但是,在服务器上发出一个简单的wget之后,相同的命令不再显示任何

我开发了一个非常简单的webapp,并打算将其部署到我的raspberry pi上,我在那里运行了archlinux。从tomcat运行启动脚本后,服务器日志以

"INFO: Server startup in 322789 ms" 

这已经相当长了,但我认为这可能是由于树莓提供的低性能。无论如何,在启动阶段和服务器启动命令之后

"sudo lsof -n -P -i :8080" 
成功运行,即显示进程正在侦听端口8080。但是,在服务器上发出一个简单的wget之后,相同的命令不再显示任何进程,表明tomcat崩溃了。此外,tomcat的任何日志中都没有错误。实际上,“localhost\u access\u log.xxxxx”包含以下内容:

127.0.0.1 - - [11/Mar/2014:17:02:06 -0600] "GET /volleyball-tool-backend/index.html HTTP/1.1" 200 1068
127.0.0.1 - - [11/Mar/2014:17:02:06 -0600] "GET /volleyball-tool-backend/ HTTP/1.1" 200 1068
127.0.0.1 - - [11/Mar/2014:18:26:34 -0600] "GET /volleyball-tool-backend/ HTTP/1.1" 200 1068
表示请求已成功送达

编辑:

我仔细检查了一遍,服务器确实成功地处理了至少一个初始请求。之后它崩溃了

catalina.out日志的输出(一个启动周期):

顺便说一句:为了部署我的war文件,我在启动它之前把它放到了tomcat的webapps文件夹中

编辑:

“localhost.xxxxx”日志的内容:

编辑:

我检查了dmesg:

[12259.897659] CPU: 0 PID: 12282 Comm: java Not tainted 3.10.33-1-ARCH #1
[12259.897731] [<c0013428>] (unwind_backtrace+0x0/0xec) from [<c00112d0>] (show_stack+0x10/0x14)
[12259.897776] [<c00112d0>] (show_stack+0x10/0x14) from [<c05a1ad0>] (dump_header.isra.15+0x84/0x1c4)
[12259.897815] [<c05a1ad0>] (dump_header.isra.15+0x84/0x1c4) from [<c00b6558>] (oom_kill_process+0x278/0x3f8)
[12259.897845] [<c00b6558>] (oom_kill_process+0x278/0x3f8) from [<c00b6b6c>] (out_of_memory+0x280/0x2cc)
[12259.897877] [<c00b6b6c>] (out_of_memory+0x280/0x2cc) from [<c00babbc>] (__alloc_pages_nodemask+0x880/0x968)
[12259.897906] [<c00babbc>] (__alloc_pages_nodemask+0x880/0x968) from [<c00d2e90>] (__pte_alloc+0x20/0x180)
[12259.897936] [<c00d2e90>] (__pte_alloc+0x20/0x180) from [<c00d6000>] (handle_mm_fault+0xd8/0xf0)
[12259.897970] [<c00d6000>] (handle_mm_fault+0xd8/0xf0) from [<c05aab14>] (do_page_fault+0x26c/0x3e8)
[12259.897999] [<c05aab14>] (do_page_fault+0x26c/0x3e8) from [<c0008354>] (do_DataAbort+0x34/0x98)
[12259.898026] [<c0008354>] (do_DataAbort+0x34/0x98) from [<c05a94fc>] (__dabt_usr+0x3c/0x40)
[12259.898041] Exception stack(0xca323fb0 to 0xca323ff8)
[12259.898061] 3fa0:                                     a81fffe8 a24cd068 00000090 00000000
[12259.898082] 3fc0: 00000000 00000000 00000000 00000000 00000000 a28aaf0c b05bb570 a28aaf00
[12259.898101] 3fe0: 00000000 a18a95e4 00000000 b6de9c00 20000010 ffffffff
[12259.898112] Mem-info:
[12259.898124] Normal per-cpu:
[12259.898136] CPU    0: hi:   42, btch:   7 usd:  26
[12259.898164] active_anon:29834 inactive_anon:43 isolated_anon:0
 active_file:176 inactive_file:2050 isolated_file:0
 unevictable:0 dirty:0 writeback:0 unstable:0
 free:82664 slab_reclaimable:653 slab_unreclaimable:972
 mapped:555 shmem:95 pagetables:243 bounce:0
 free_cma:74731
[12259.898231] Normal free:330656kB min:32768kB low:40960kB high:49152kB active_anon:119336kB inactive_anon:172kB active_file:704kB inactive_file:8200kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:487424kB managed:170128kB mlocked:0kB dirty:0kB writeback:0kB mapped:2220kB shmem:380kB slab_reclaimable:2612kB slab_unreclaimable:3888kB kernel_stack:824kB pagetables:972kB unstable:0kB bounce:0kB free_cma:298924kB writeback_tmp:0kB pages_scanned:331 all_unreclaimable? yes
[12259.898248] lowmem_reserve[]: 0 0
[12259.898266] Normal: 74*4kB (UEMC) 53*8kB (EC) 43*16kB (UEM) 21*32kB (UEC) 26*64kB (UEM) 16*128kB (EMC) 13*256kB (UEMC) 10*512kB (UEMC) 3*1024kB (UEC) 3*2048kB (UMC) 75*4096kB (MRC) = 330656kB
[12259.898353] 2321 total pagecache pages
[12259.898368] 0 pages in swap cache
[12259.898379] Swap cache stats: add 0, delete 0, find 0/0
[12259.898388] Free swap  = 0kB
[12259.898396] Total swap = 0kB
[12259.929094] 121856 pages of RAM
[12259.929126] 82868 free pages
[12259.929136] 3488 reserved pages
[12259.929145] 1275 slab pages
[12259.929154] 263343 pages shared
[12259.929163] 0 pages swap cached
[12259.929174] [ pid ]   uid  tgid total_vm      rss nr_ptes swapents oom_score_adj name
[12259.929219] [   69]     0    69     4980      140      12        0             0 systemd-journal
[12259.929240] [   83]     0    83     2372       80       6        0         -1000 systemd-udevd
[12259.929260] [  106]     0   106      418       12       5        0             0 rngd
[12259.929279] [  107]     0   107     1568       96       6        0         -1000 sshd
[12259.929298] [  108]     0   108      700      127       4        0             0 crond
[12259.929320] [  110]     0   110      520       22       5        0             0 avahi-dnsconfd
[12259.929340] [  111]     0   111      435       24       4        0             0 ifplugd
[12259.929359] [  114]     0   114      639       45       5        0             0 systemd-logind
[12259.929378] [  115]    84   115      794       53       5        0             0 avahi-daemon
[12259.929397] [  116]    81   116      929       99       5        0          -900 dbus-daemon
[12259.929416] [  117]     0   117     1202      767       6        0             0 haveged
[12259.929436] [  118]    84   118      758       35       5        0             0 avahi-daemon
[12259.929455] [  123]     0   123      445       20       5        0             0 agetty
[12259.929473] [  124]     0   124      445       19       5        0             0 agetty
[12259.929523] [  234]     0   234      512       37       5        0             0 dhcpcd
[12259.929545] [  365]    89   365   127778    12469      57        0             0 mysqld
[12259.929568] [11939]     0 11939     2572      167       8        0             0 sshd
[12259.929587] [11943]     0 11943      851       66       5        0             0 systemd
[12259.929607] [11944]     0 11944     1770      273       6        0             0 (sd-pam)
[12259.929626] [11945]     0 11945      811       65       5        0             0 bash
[12259.929644] [11946]     0 11946     1094       66       6        0             0 su
[12259.929663] [11947]  1000 11947      840       78       5        0             0 bash
[12259.929701] [12280]     0 12280    99612    15513      63        0             0 java
[12259.929717] Out of memory: Kill process 12280 (java) score 127 or sacrifice child
[12259.937632] Killed process 12280 (java) total-vm:398448kB, anon-rss:60236kB, file-rss:1816kB
我在这里进一步捕获了Top的输出:

注意显示为红色的关于交换空间的行。但是我不知道从这个可以推断出什么。正如我所说,我使用Raspberry站点上的“Noobs”工具进行了一次全新的安装,所以我认为他们或操作系统将负责交换

Startupsequence:sudo./[TOMCATDIR]/startup.sh


关于

确保您已将应用部署到webapp目录

创建交换文件成功。这真的是一次内存流失。

你查过catalina.out日志了吗?有错误吗?所以Tomcat提供了请求,所以它没有崩溃。那么你的问题是什么?你有真正的问题吗,或者仅仅是
lsof
让你困惑?这确实是一个真正的问题。服务器实际上停止运行,即在初始请求后停止提供任何内容。有关更多信息,请参阅上面的编辑。应该有另一个日志文件localhost.yyy-mm-dd.log,它记录JVM的输出,包括错误,而localhost\u access\u log.yyy-mm-dd.log只记录HTTP事务。你能检查一下吗?我在日志里也找不到任何不寻常的东西。我把它的内容贴在了我第一篇文章的底部。这里没有证据表明他没有这样做,如果他的webapp被部署为
/volleybool-backend
,这里有证据表明他这样做了-1.
Mar 11, 2014 5:01:52 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Mar 11, 2014 5:01:52 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Mar 11, 2014 5:01:52 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@1f718f2')
Mar 11, 2014 6:25:43 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Mar 11, 2014 6:25:43 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Mar 11, 2014 6:25:43 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@19df57a')
Mar 11, 2014 6:38:00 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Mar 11, 2014 6:38:00 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Mar 11, 2014 6:38:00 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@1dfdee0')
Mar 11, 2014 6:55:58 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Mar 11, 2014 6:55:58 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Mar 11, 2014 6:55:59 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@162108e')
Mar 11, 2014 7:41:11 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: contextInitialized()
Mar 11, 2014 7:41:11 PM org.apache.catalina.core.ApplicationContext log
INFO: SessionListener: contextInitialized()
Mar 11, 2014 7:41:11 PM org.apache.catalina.core.ApplicationContext log
INFO: ContextListener: attributeAdded('org.apache.jasper.compiler.TldLocationsCache', 'org.apache.jasper.compiler.TldLocationsCache@162108e')
[12259.897659] CPU: 0 PID: 12282 Comm: java Not tainted 3.10.33-1-ARCH #1
[12259.897731] [<c0013428>] (unwind_backtrace+0x0/0xec) from [<c00112d0>] (show_stack+0x10/0x14)
[12259.897776] [<c00112d0>] (show_stack+0x10/0x14) from [<c05a1ad0>] (dump_header.isra.15+0x84/0x1c4)
[12259.897815] [<c05a1ad0>] (dump_header.isra.15+0x84/0x1c4) from [<c00b6558>] (oom_kill_process+0x278/0x3f8)
[12259.897845] [<c00b6558>] (oom_kill_process+0x278/0x3f8) from [<c00b6b6c>] (out_of_memory+0x280/0x2cc)
[12259.897877] [<c00b6b6c>] (out_of_memory+0x280/0x2cc) from [<c00babbc>] (__alloc_pages_nodemask+0x880/0x968)
[12259.897906] [<c00babbc>] (__alloc_pages_nodemask+0x880/0x968) from [<c00d2e90>] (__pte_alloc+0x20/0x180)
[12259.897936] [<c00d2e90>] (__pte_alloc+0x20/0x180) from [<c00d6000>] (handle_mm_fault+0xd8/0xf0)
[12259.897970] [<c00d6000>] (handle_mm_fault+0xd8/0xf0) from [<c05aab14>] (do_page_fault+0x26c/0x3e8)
[12259.897999] [<c05aab14>] (do_page_fault+0x26c/0x3e8) from [<c0008354>] (do_DataAbort+0x34/0x98)
[12259.898026] [<c0008354>] (do_DataAbort+0x34/0x98) from [<c05a94fc>] (__dabt_usr+0x3c/0x40)
[12259.898041] Exception stack(0xca323fb0 to 0xca323ff8)
[12259.898061] 3fa0:                                     a81fffe8 a24cd068 00000090 00000000
[12259.898082] 3fc0: 00000000 00000000 00000000 00000000 00000000 a28aaf0c b05bb570 a28aaf00
[12259.898101] 3fe0: 00000000 a18a95e4 00000000 b6de9c00 20000010 ffffffff
[12259.898112] Mem-info:
[12259.898124] Normal per-cpu:
[12259.898136] CPU    0: hi:   42, btch:   7 usd:  26
[12259.898164] active_anon:29834 inactive_anon:43 isolated_anon:0
 active_file:176 inactive_file:2050 isolated_file:0
 unevictable:0 dirty:0 writeback:0 unstable:0
 free:82664 slab_reclaimable:653 slab_unreclaimable:972
 mapped:555 shmem:95 pagetables:243 bounce:0
 free_cma:74731
[12259.898231] Normal free:330656kB min:32768kB low:40960kB high:49152kB active_anon:119336kB inactive_anon:172kB active_file:704kB inactive_file:8200kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:487424kB managed:170128kB mlocked:0kB dirty:0kB writeback:0kB mapped:2220kB shmem:380kB slab_reclaimable:2612kB slab_unreclaimable:3888kB kernel_stack:824kB pagetables:972kB unstable:0kB bounce:0kB free_cma:298924kB writeback_tmp:0kB pages_scanned:331 all_unreclaimable? yes
[12259.898248] lowmem_reserve[]: 0 0
[12259.898266] Normal: 74*4kB (UEMC) 53*8kB (EC) 43*16kB (UEM) 21*32kB (UEC) 26*64kB (UEM) 16*128kB (EMC) 13*256kB (UEMC) 10*512kB (UEMC) 3*1024kB (UEC) 3*2048kB (UMC) 75*4096kB (MRC) = 330656kB
[12259.898353] 2321 total pagecache pages
[12259.898368] 0 pages in swap cache
[12259.898379] Swap cache stats: add 0, delete 0, find 0/0
[12259.898388] Free swap  = 0kB
[12259.898396] Total swap = 0kB
[12259.929094] 121856 pages of RAM
[12259.929126] 82868 free pages
[12259.929136] 3488 reserved pages
[12259.929145] 1275 slab pages
[12259.929154] 263343 pages shared
[12259.929163] 0 pages swap cached
[12259.929174] [ pid ]   uid  tgid total_vm      rss nr_ptes swapents oom_score_adj name
[12259.929219] [   69]     0    69     4980      140      12        0             0 systemd-journal
[12259.929240] [   83]     0    83     2372       80       6        0         -1000 systemd-udevd
[12259.929260] [  106]     0   106      418       12       5        0             0 rngd
[12259.929279] [  107]     0   107     1568       96       6        0         -1000 sshd
[12259.929298] [  108]     0   108      700      127       4        0             0 crond
[12259.929320] [  110]     0   110      520       22       5        0             0 avahi-dnsconfd
[12259.929340] [  111]     0   111      435       24       4        0             0 ifplugd
[12259.929359] [  114]     0   114      639       45       5        0             0 systemd-logind
[12259.929378] [  115]    84   115      794       53       5        0             0 avahi-daemon
[12259.929397] [  116]    81   116      929       99       5        0          -900 dbus-daemon
[12259.929416] [  117]     0   117     1202      767       6        0             0 haveged
[12259.929436] [  118]    84   118      758       35       5        0             0 avahi-daemon
[12259.929455] [  123]     0   123      445       20       5        0             0 agetty
[12259.929473] [  124]     0   124      445       19       5        0             0 agetty
[12259.929523] [  234]     0   234      512       37       5        0             0 dhcpcd
[12259.929545] [  365]    89   365   127778    12469      57        0             0 mysqld
[12259.929568] [11939]     0 11939     2572      167       8        0             0 sshd
[12259.929587] [11943]     0 11943      851       66       5        0             0 systemd
[12259.929607] [11944]     0 11944     1770      273       6        0             0 (sd-pam)
[12259.929626] [11945]     0 11945      811       65       5        0             0 bash
[12259.929644] [11946]     0 11946     1094       66       6        0             0 su
[12259.929663] [11947]  1000 11947      840       78       5        0             0 bash
[12259.929701] [12280]     0 12280    99612    15513      63        0             0 java
[12259.929717] Out of memory: Kill process 12280 (java) score 127 or sacrifice child
[12259.937632] Killed process 12280 (java) total-vm:398448kB, anon-rss:60236kB, file-rss:1816kB
-RaspberryPi
-ArchlinuxARM
-OracleJVM/OpenJDK (both don't work)
-ApacheTomcat from: https://tomcat.apache.org/download-60.cgi
-MariaDB
-Maria JDBC Connector from https://downloads.mariadb.org/client-java/