startup

How do I run an action on server startup using Struts2?

[亡魂溺海] 提交于 2019-12-04 06:07:00
I have to execute a struts2 action on server startup rather than on the first request. Loading data on startup of an application is a common task, you will find several examples on the web. As said in other answers, you should implement a ServletContextListener (that is not Struts2 specific)... you can read a great example here . The important thing here is understanding the Action concept: In Struts2 MVC (Model View Controller) Framework, an Action is the Controller (and part of the Model ). Action s are invoked by Request s coming from the Client s (and one Action is created on every request

Startup script for scala REPL

筅森魡賤 提交于 2019-12-04 04:58:02
问题 What is the name of startup script for the scala REPL. For example something along the lines of the following: ~/.scalarc 回答1: You could try something like: $ alias scala='scala -i ~/.scalarc ' Note the trailing space—if you omit it your alias will disregard parameters. Further use of 'scala' (once the alias is defined) will work as expected for REPL. If you use the alias for launching compiled programs, '~/.scalarc' will simply be ignored. edit : It seems using '-i' in this way causes a

Tomcat启动找不到项目依赖jar的解决方式

一世执手 提交于 2019-12-04 04:43:43
一、背景 最近在写一个MQ框架-gmq,先写的服务端,然后写客户端。感觉服务端和客户端分成两个独立的项目不合适,于是改成了maven父子模块的形式。父项目相当于一个壳,里面包含服务端、客户端两个模块。 二、问题描述 1、当时服务端是单独一个项目的时候,启动是正常的。pom配置如下: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.shuimutong</groupId> <artifactId>gmq-server</artifactId> <packaging>war</packaging> <version>0.0.1-SNAPSHOT</version> <name>gmq</name> <url>http://maven.apache.org</url> <properties> <project.build

Clojure application startup performance

走远了吗. 提交于 2019-12-04 02:59:35
问题 I have written a few small utility applications in Clojure that I compile into self-contained executable JAR files ("uberjars") using Maven and the maven-shade-plugin. These uberjars contain unpacked versions of clojure.jar and other libraries (i.e.: commons-cli) that the application depends on. They are convenient because I can send them to a customer without requiring that the customer install Clojure (all customers already have the JRE installed). I have found that the Clojure applications

Liferay startup takes way too long

倖福魔咒の 提交于 2019-12-04 02:43:18
I'm new to Liferay developing and I’m facing troubles with the startup of my Liferay Tomcat server. It takes almost 3 minutes (169048 ms) which is unacceptable for development. I’d like to get it down to about one minute. Here are the specs of my machine: Intel Core Duo T2300 @ 1.66GHz 4GB RAM (3.24GB in use) Windows 7 Enterprise 32 bit with Service Pack 1 I’m using: Liferay 6.1.1-ce-ga2 bundled with Tomcat 7 Eclipse IDE Juno Release In order to speed things up, I’ve: removed all unnecessary portlets from the tomcat\webapps folder. put the Tomcat native library 1.1.24 in the tomcat\bin folder

tomcat 日志详解

瘦欲@ 提交于 2019-12-04 02:12:40
1 tomcat 日志详解 1.1 tomcat 日志配置文件    tomcat 对应日志的配置文件 :tomcat目录下的/conf/logging.properties。    tomcat 的日志等级有: 日志输出级别:SEVERE (最高级别) > WARNING > INFO > CONFIG > FINE > FINER(精心) > FINEST (所有内容,最低级别)    tomcat 有五类日志 : catalina、localhost、manager、admin、host-manager   /conf/logging.properties 配置文件: 1 #可配置项(5类日志):catalina、localhost、manager、admin、host-manager 2 handlers = 1catalina.org.apache.juli.FileHandler, 2localhost.org.apache.juli.FileHandler, 3 3manager.org.apache.juli.FileHandler, 4host-manager.org.apache.juli.FileHandler, java.util.logging.ConsoleHandler 4 5 #日志输出为输出到文件和输出到控制台 6 .handlers =

How do I set Terminal scripts to run at start up on Mac OS X Snow Leopard?

我们两清 提交于 2019-12-04 02:09:45
Hello I'm using Mac OS X 10.6.8. How can I set some simple Terminal commands to run on start up as if I was opening up Terminal and putting those commands in myself? I basically need to start a few server daemons on start up. The commands I use in Terminal to manually start them look like sudo ruby myrubyserverscript_control.rb start . I apologize in advance if this is super obvious or already answered on here a million times in some way I don't know enough to recognize. jm666 Here are two different things: you want run a script after the system startup (boot), or when you logging in for run a

.NET Core 中的糟糕命名:Startup 中的 ConfigureServices 与 Configure

天涯浪子 提交于 2019-12-04 02:04:08
一直不喜欢 Startup 中这两个可读性很比较差的命名 ConfigureServices 与 Configure 。 ConfigureServices 用于配置依赖注入以在运行时根据依赖关系创建对象, Configure 用于配置中间件(middleware)以构建请求处理流水线。 今天写代码写累后散步时思考了这两个命名问题,突然想到一个成语 排兵布阵 。 ConfigureServices 是 排兵 , Configure 是 布阵 。如果对应公司运营, ConfigureServices 就是给工作岗位安排人员, Configure 是制定工作流程。 根据 排兵布阵 ,想到的英文命名是 Arrange 与 Organize ,使用这2个命名改造后的 Starup 变成了这样: public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration; } public IConfiguration Configuration { get; } public void ConfigureServices(IServiceCollection services) { Arrange(services); } public static void

Actually read AppSettings in ConfigureServices phase in ASP.NET Core

核能气质少年 提交于 2019-12-03 23:27:15
问题 I need to setup a few dependencies (services) in the ConfigureServices method in an ASP.NET Core 1.0 web application. The issue is that based on the new JSON configuration I need to setup a service or another. I can't seem to actually read the settings in the ConfigureServices phase of the app lifetime: public void ConfigureServices(IServiceCollection services) { var section = Configuration.GetSection("MySettings"); // this does not actually hold the settings services.Configure

【CentOS 7Tomcat配置5】,Tomcat日志#180121

我的未来我决定 提交于 2019-12-03 21:10:01
hellopasswd Tomcat日志 ls /usr/local/tomcat/logs 其中catalina开头的日志为tomcat的综合日志,他记录tomcat服务相关信息,也会记录错误日志 其中catalina.日期.log和catalina.out内容相同,前者会每天生成一个新的日志 host-manager和manager为管理相关的日志,其中host-manager为虚拟主机的管理日志 localhost和localhost_access为虚拟主机相关日志,其中带access字样的日志为访问日志,不带access字样的为默认虚拟主机的错误日志 访问日志默认不会生成,需要server.xml中配置一下 [root@localhost ~]# ls /usr/local/tomcat/logs/ catalina.2018-01-17.log host-manager.2018-01-17.log localhost.2018-01-21.log manager.2018-01-17.log catalina.2018-01-21.log host-manager.2018-01-21.log localhost_access_log.2018-01-17.txt manager.2018-01-21.log catalina.out localhost.2018-01