jsvc

Access resources from another jar file

梦想与她 提交于 2020-05-10 07:37:36
问题 I have a simple structure: A data jar file which contains a batch of data, and a service jar file, which runs a service using the data. To make the data easy to replace, I have them separate, and service.jar's classpath contains the directory which data.jar is in. Within service.jar, I use getResource to load the data files. This works if the data files are directly within the folder, but fails when they are inside data.jar; This fails: all + globalclasspath | + data.jar | + mine.properties +

Access resources from another jar file

时光总嘲笑我的痴心妄想 提交于 2020-05-10 07:36:06
问题 I have a simple structure: A data jar file which contains a batch of data, and a service jar file, which runs a service using the data. To make the data easy to replace, I have them separate, and service.jar's classpath contains the directory which data.jar is in. Within service.jar, I use getResource to load the data files. This works if the data files are directly within the folder, but fails when they are inside data.jar; This fails: all + globalclasspath | + data.jar | + mine.properties +

How to start tomcat with jsvc?

故事扮演 提交于 2019-12-31 01:24:06
问题 I'm trying to start tomcat with jsvc but it gives me this strange error JSVC re-exec requires execution with an absolute or relative path using jsvc -debug -cp ./bin/bootstrap.jar:bin/tomcat-juli.jar \ -outfile ./logs/catalina.out -errfile ./logs/catalina.err \ org.apache.catalina.startup.Bootstrap 回答1: Just ran into this error myself. In my case, using the absolute path to jsvc --- /usr/bin/jsvc on my machine --- fixed it. 回答2: I run Tomcat by double-click startup.sh file on $CATALINA_HOME

How to convert a java program to daemon with jsvc?

房东的猫 提交于 2019-12-28 01:43:13
问题 I wrote a program and now I am expected to convert it to a daemon. Since I am a noob and dont know anything about it, can you please tell me how can I do it or can you please give me basic tutorials or readings about it ? I really want to learn how I can do it ? Thank you all 回答1: Java class: package example; import java.util.Date; import java.util.Timer; import java.util.TimerTask; import org.apache.commons.daemon.*; class EchoTask extends TimerTask { @Override public void run() { System.out

NPE when calling new JPanel() in headless (RepaintManager.currentManager)

删除回忆录丶 提交于 2019-12-13 05:43:07
问题 I'm running a headless linux box with openjdk-8-jdk-armhf and when I run my application, the line METRICS = new JPanel().getFontMetrics(FONT); Throws a NullPointerException reaching back to RepaintManager.currentManager(RepaintManager.java:262) , which looks like this: public static RepaintManager currentManager(Component c) { // Note: DisplayChangedRunnable passes in null as the component, so if // component is ever used to determine the current // RepaintManager, DisplayChangedRunnable will

running tomcat6 with jsvc

只愿长相守 提交于 2019-12-11 13:57:26
问题 I'm trying to run tomcat6 with jsvc in order to get user privileges at start. I'm trying to run using the code in the tomcat documentation: http://tomcat.apache.org/tomcat-6.0-doc/setup.html cd $CATALINA_HOME ./bin/jsvc -cp ./bin/bootstrap.jar \ -outfile ./logs/catalina.out -errfile ./logs/catalina.err \ org.apache.catalina.startup.Bootstrap And these are the errors I get: Unable to redirect to ./logs/catalina.out Unable to redirect to ./logs/catalina.err Cannot open PID file /var/run/jsvc

jsvc将tomcat配置成服务

别等时光非礼了梦想. 提交于 2019-12-10 08:14:00
1、在/usr/share/tomcat8/bin中有commons-daemon-native.tar.gz 压缩包 2、解压commons-daemon-native.tar.gz #tar -zxvf commons-daemon-native.tar.gz 3、解压完成,出现commons-daemon-1.0.15-native-src文件夹(目录) 4、执行configure 文件 cd commons-daemon-1.0.15-native-src/unix ./configure 5、编译 [root@localhost ~]# make 6、 编译完成后出现jsvc文件夹,复制jsvc到/usr/share/tomcat8/bin目录下面 [root@localhost ~]# cp jsvc ../../ 7、在/etc/init.d/目录下编写tomcat8启动服务配置文件。 [root@localhost ~]#cd /etc/init.d/ [root@localhost ~]# vi tomcat8 #!/bin/bash #startup script for tomcat on linux # chkconfig: 2345 10 90 # description: tomcat sever .... #filename tomcat.sh

Catch RuntimeExceptions in Java application and send them via email

假装没事ソ 提交于 2019-12-06 09:23:27
问题 I'm starting my app on Linux server with a command like this /usr/local/bin/jsvc \ -home /usr/local/jdk1.8.0_111 \ -cp /opt/myapp/myapp.jar:/opt/myapp/lib/* \ -user myappuser \ -outfile /opt/myapp/out.log \ -errfile /opt/myapp/error.log \ -pidfile /opt/myapp/myapp.pid \ com.example.MyApp I'm using log4j for logging in my app and it has own configuration described in log4j.properties which is located inside myapp.jar . I want to be able to catch any exception which happens in the app and to

Is it possible to enable port in JSVC for remote debugging?

耗尽温柔 提交于 2019-12-06 04:05:53
问题 I am running a jsvc application which is working absolutely fine but now I need to enable one port on my application so that I can do remote debugging. I am performing above task using java. Is there any way to achieve above task ? I have checked all JSVC option http://commons.apache.org/proper/commons-daemon/jsvc.html but didn't find anything. Here is the code of adding jsvc parameter : private List getJSVCArgs(){ List jsvcArgs = new ArrayList(); jsvcArgs.add(jsvcDir+"/jsvc"); jsvcArgs.add("

Is it possible to enable port in JSVC for remote debugging?

我的未来我决定 提交于 2019-12-04 09:54:48
I am running a jsvc application which is working absolutely fine but now I need to enable one port on my application so that I can do remote debugging. I am performing above task using java. Is there any way to achieve above task ? I have checked all JSVC option http://commons.apache.org/proper/commons-daemon/jsvc.html but didn't find anything. Here is the code of adding jsvc parameter : private List getJSVCArgs(){ List jsvcArgs = new ArrayList(); jsvcArgs.add(jsvcDir+"/jsvc"); jsvcArgs.add("-pidfile"); jsvcArgs.add("pidfile.pid"); jsvcArgs.add("-outfile"); jsvcArgs.add("outfile.txt");