startup

How do I force an application-scoped bean to instantiate at application startup?

北城余情 提交于 2019-11-26 09:18:04
问题 I can\'t seem to find a way to force an application-scoped managed bean to be instantiated/initialized when the web app is started. It seems that application-scoped beans get lazy-instantiated the first time the bean is accessed, not when the web app is started up. For my web app this happens when the first user opens a page in the web app for the first time. The reason I want to avoid this is because a number of time-consuming database operations happen during the initialization of my

Error starting Tomcat from NetBeans - '127.0.0.1*' is not recognized as an internal or external command

Deadly 提交于 2019-11-26 08:44:52
问题 Both Google and Stackoverflow have shown me people with similar issues however this error is slightly different in that the IP address is suffixed with an asterisk: NetBeans 8.0.1 is giving me the following error when trying to start Tomcat. \'127.0.0.1*\' is not recognized as an internal or external command, operable program or batch file. I\'ve got both Tomcat 7.0.56 and Tomcat 8.0.14 installed, they both start OK from the command line (one at a time). I have them added to NetBeans\' list

Run Batch File On Start-up

空扰寡人 提交于 2019-11-26 07:23:27
问题 Is there a way to start multiple programs in a batch file on system start-up? In addition to that, in that batch file, I would like to be able to say: Once I execute a program, wait until that program completely loads, and execute the next listed program. Any help would be appreciated. 回答1: I had the same issue in Win7 regarding running a script (.bat) at startup (When the computer boots vs when someone logs in) that would modify the network parameters using netsh. What ended up working for

Run Java application at Windows startup

不打扰是莪最后的温柔 提交于 2019-11-26 05:56:28
问题 I have a JAR file containing a Java application. How can I make it start with Windows, without needing user interaction? 回答1: Create a .bat file and put this inside: javaw -Xmx200m -jar C:\Path\to\jarfile\TheJar.jar Then put the .bat file into the windows startup folder. One more thing: There's a difference between using java and javaw . While java is better when you are debugging an application, the application prints text or something like that, javaw is better when you don't need that. Why

How to run a program automatically as admin on Windows 7 at startup?

风格不统一 提交于 2019-11-26 05:55:28
问题 I created my own parental control app to monitor my kids activity. The app\'s only GUI is a task bar icon. The program is installed as admin. I\'d like this program to be started up automatically as admin user on Windows startup, so that standard users cannot kill it from task manager. I can create a registry key at: HKLM\\Software\\Microsoft\\Windows\\CurrentVersion\\Run to make it run automatically when Windows starts up. The problem is that the program is started as the logged in (standard

How to call a method after bean initialization is complete?

旧巷老猫 提交于 2019-11-26 04:34:53
问题 I have a use case where I need to call a (non-static) method in the bean only-once at the ApplicationContext load up. Is it ok, if I use MethodInvokingFactoryBean for this? Or we have a some better solution? As a side note, I use ConfigContextLoaderListener to load the Application Context in web application. And want, that if bean \'A\' is instantiated just call methodA() once. How can this be done nicely? 回答1: You can use something like: <beans> <bean id="myBean" class="..." init-method=

How can I run a Perl script as a system daemon in linux?

可紊 提交于 2019-11-26 04:07:14
问题 What\'s a simple way to get a Perl script to run as a daemon in linux? Currently, this is on CentOS. I\'d want it to start up with the system and shutdown with the system, so some /etc/rc.d/init.d integration would also be nice, but I could always add a custom line to /etc/rc.d/rc.local . 回答1: The easiest way is to use Proc::Daemon. #!/usr/bin/perl use strict; use warnings; use Proc::Daemon; Proc::Daemon::Init; my $continue = 1; $SIG{TERM} = sub { $continue = 0 }; while ($continue) { #do

How to run a C# application at Windows startup?

[亡魂溺海] 提交于 2019-11-26 03:07:07
问题 I made an application that launches during startup, with the next code below. The process runs on the process manager tool after the restart, but I can\'t see the application on the screen. When I open the same .exe file from the startup registry value the program runs perfect. // The path to the key where Windows looks for startup applications RegistryKey rkApp = Registry.CurrentUser.OpenSubKey(\"SOFTWARE\\\\Microsoft\\\\Windows\\\\CurrentVersion\\\\Run\", true); // Add the value in the

How do I start my app on startup?

与世无争的帅哥 提交于 2019-11-25 22:00:13
问题 I tried using the sample code in this link but it seems outdated and it did not work. So what changes do I have to make and to what files to have my app start automatically when Android finishes booting up? 回答1: First, you need the permission in your AndroidManifest.xml : <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> Also, in your AndroidManifest.xml , define your service and listen for the BOOT_COMPLETED action: <service android:name=".MyService" android:label=

企业网络中利用FTP协议来实现文件的上传和下载

蹲街弑〆低调 提交于 2019-11-25 21:49:26
FTP技术的概念 文件传输协议,FTP是用来传送文件的协议。使用FTP实现远程文件传输的同时,还可以保证数据传输的可靠性和高效性 FTP协议的作用:可以在服务器上面下载文件 或者在本地上传文件到服务器里面 FTP的控制层面和数据层面 客户端(client)和服务器(server):简称为C/S模式 控制平面和转发平面(数据平面) 控制平面:主要保证服务器和客户端之间通信,使用的是TCP的21号端口 客户端----->>>>>服务器进行连接 TCP 源端口 随机 目标端口 21 转发平面:可以称作为数据平面,主要保证服务器和客户端之间传输数据 主动模式和被动模式 主动模式(服务器主动访问客户端,可以比喻成你们做头等舱) TCP 20号端口 服务器---->>>客户端进行连接 被动模式(客户端主动服务器,可以比喻成你们做经济舱) TCP 随机端口 客户端---->>>服务器进行连接 FTP的工作模式 主动模式 TCP三次握手的建立 控制连接(输入账户名和密码):客户端---服务器发起连接 Sport:随机 Dport:21端口 会有客户端---服务器发送一个port消息 该消息里面会携带a.b.c.d.e.f(其中a.b.c.d就是客户端IP地址 客户端端口号就是256乘以e+f) TCP三次握手的建立 数据平面(执行我们上传和下载的动作):服务器---客户端发起连接 Sport