shutdown

JAVA企业级应用TOMCAT实战

大兔子大兔子 提交于 2019-12-03 08:11:45
1. Tomcat简介 Tomcat是Apache软件基金会(Apache Software Foundation)的Jakarta 项目中的一个核心项目,由Apache、Sun和其他一些公司及个人共同开发而成。 Tomcat服务器是一个免费的开放源代码的 Web应用服务器 ,属于轻量级应用服务器,在中小型系统和并发访问用户不是很多的场合下被普遍使用,是开发和调试JSP程序的首选。 Tomcat和Nginx、Apache(httpd)、lighttpd等Web服务器一样,具有处理HTML页面的功能,另外它还是一个Servlet和JSP容器,独立的Servlet容器是Tomcat的默认模式。不过,Tomcat处理静态HTML的能力不如Nginx/Apache服务器。 对比php软件,区别? 目前Tomcat最新版本为9.0。Java容器还有resin、weblogic等。 2. Tomcat安装 2.1 软件准备 JDK下载: http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html Tomcat下载: http://tomcat.apache.org/ 2.2 部署java环境 [root@tomcat ~]# cd /application/tools/ [root

What happens when the JVM is terminated?

╄→гoц情女王★ 提交于 2019-12-03 05:15:29
What happens when the JVM is terminated with System.exit(0) or ^C or anything of that kind? I read things like "the process is just blown away" and "every single thread is stopped", but I would like to know what happens exactly. I already know there is the shutdownHook that somehow still gets executed, but what happens before the shutdownHooks are invoked and does anything happen after all these threads have finished? I would like to implement such a shutdownHook correctly and to do so I need to make the right assumptions about what might still be executed and what will not. update: some code:

Send windows message to a Windows Service

徘徊边缘 提交于 2019-12-03 03:54:38
Is there any tool to send (mimic) a windows message like 'WM_ENDSESSION' to a windows service? OR How can I send a windows message to a process using C#? (I know only C#) EDIT: Purpose: Basically I have to debug a windows service for fixing a bug that occurs only on system shut down. Generally, services don't have windows (let alone message pumps) to receive a windows message. If the bug really does only happen on shutdown (as opposed to just stopping the service), it may be the case that something depends on a resource that is going away, which is not being handled gracefully (in which case,

01-linux介绍

人走茶凉 提交于 2019-12-03 02:41:42
一、Linux简介    Linux 内核最初只是由芬兰人林纳斯.托瓦兹在大学时出于爱好写出来的,是一套免费使用和自由传播的类 Unix 操作系统,是基于 POSIX 和 UNIX 的多用户、多任务、支持多线程和多 CPU 的操作系统。 Linux 能运行主要的 UNIX 工具软件、应用程序和网络协议。 Linux 继承了 Unix 以网络核心的设计思想,是一个性能稳定的多用户网络操作系统。换句话说, Unix 是 Linux 的前身,因为收费,才导致 Linux 的诞生。 Linux的发行版:   发行版说简单点就是将 Linux 内核与应用软件做一个打包: 目前知名发行版有:Ubuntu、RedHat、CentOS、Debian、Fedora、SuSE、OpenSUSE、Arch Linux、SolusOS 等。 Linux系统启动过程 内核的引导-------运行init------系统初始化--------建立终端------用户登录系统   1、计算机打开电源,首先是BIOS开机自检,按照BIOS设置的启动设备(硬盘)来启动。操作系统接管硬件以后,首先读入/boot目录下的内核文件。   2、init进程是系统所有进程的起点,你可以把它当做系统所有进程的父亲,没有这个进程,系统其它进程都不会启动。init程序首先是需要读取配置文件/etc/initab。   运行级别:

Application.Current.Shutdown() doesn't

匿名 (未验证) 提交于 2019-12-03 02:06:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Title's about it. WPF app with some WCF stuff for IPC. I call Application.Current.Shutdown() and the app continues on happily. I thought Shutdown was supposed to be unstoppable. Perhaps because it's being called from a background thread? Do I need to do some dispatcher fiddling? 回答1: You get an exception when I call Application.Current.Shutdown in any thread other than the main one, so I'd assume you where using "dispatcher fiddling" properly already. In any case, this compiles and quits an application, so if the dispatcher bit

App shutdown with EXC_RESOURCE, WAKEUPS exception on iOS 8 GM

限于喜欢 提交于 2019-12-03 01:39:30
问题 Does anyone know what this kind of exception is on iOS 8? === from crash report === Exception Type: EXC_RESOURCE Exception Subtype: WAKEUPS Exception Message: (Limit 150/sec) Observed 206/sec over 300 secs Triggered by Thread: 14 Seems to only happen on iOS 8... Our app is shut down quite randomly at arbitrary intervals with this exception.. Any clues are welcome. Thanks! 回答1: Your app is sending a wakeup command to a particular thread in the app quite often - apparently an average of 206

Why does Spark exit with exitCode: 16?

匿名 (未验证) 提交于 2019-12-03 01:22:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am using Spark 2.0.0 with Hadoop 2.7 and use the yarn-cluster mode. Every time, I get the following error: 17/01/04 11:18:04 INFO spark.SparkContext: Successfully stopped SparkContext 17/01/04 11:18:04 INFO yarn.ApplicationMaster: Final app status: FAILED, exitCode: 16, (reason: Shutdown hook called before final status was reported.) 17/01/04 11:18:04 INFO util.ShutdownHookManager: Shutdown hook called 17/01/04 11:18:04 INFO util.ShutdownHookManager: Deleting directory /tmp/hadoop-hduser/nm-local-dir/usercache/harry/appcache/application

pymongo.errors.ConnectionFailure: could not connect to localhost:27017: [Errno 111] Connection refused

匿名 (未验证) 提交于 2019-12-03 01:19:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: When i faced his error i deleted mongod.lock from /var/lib/mongodb then i did mongod -repair SO it listed all these things Fri Mar 21 14:21:17.511 [initandlisten] MongoDB starting : pid=21182 port=27017 dbpath=/data/db/ 64-bit host=thara-Precision-T1600 Fri Mar 21 14:21:17.511 [initandlisten] db version v2.4.9 Fri Mar 21 14:21:17.511 [initandlisten] git version: 52fe0d21959e32a5bdbecdc62057db386e4e029c Fri Mar 21 14:21:17.511 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64

How to stop flask application without using ctrl-c

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to implement a command which can stop flask application by using flask-script. I have searched the solution for a while. Because the framework doesn't provide "app.stop()" API, I am curious about how to code this. I am working on Ubuntu 12.10 and Python 2.7.3. 回答1: If you are just running the server on your desktop, you can expose an endpoint to kill the server (read more at Shutdown The Simple Server ): from flask import request def shutdown_server(): func = request.environ.get('werkzeug.server.shutdown') if func is None: raise

How to cancel shutdown in Mac OS X when application is an agent?

匿名 (未验证) 提交于 2019-12-03 01:03:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have a Java application that I need to hide from Dock and I also need to be able to interrupt. This is how I handle shutdown: import com.apple.eawt.AppEvent.QuitEvent; import com.apple.eawt.QuitHandler; import com.apple.eawt.QuitResponse; import com.apple.eawt.Application; public class MacOSXCustomizer { public void init() { Application application = Application.getApplication(); application.setQuitHandler(new QuitHandler() { public void handleQuitRequestWith(QuitEvent qe, QuitResponse qr) { if(Main.prepareForExit()) { qr.performQuit(); }