|
From: sharedata <jx...@ya...> - 2006-09-12 09:17:30
|
I am using windows XP. I'ld like to start rmiregistry in background and not in a command window on the task bar. How can I do it? __________________________________________________ 赶快注册雅虎超大容量免费邮箱? http://cn.mail.yahoo.com |
|
From: David D. <hap...@hu...> - 2006-09-12 13:48:40
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content=3D"text/html;charset=3DGB2312" http-equiv=3D"Content-Type=
">
<title></title>
</head>
<body bgcolor=3D"#ffffff" text=3D"#000000">
Sharedata,<br>
<br>
Instead of explicitly starting a registry service, I u=
se the
following bit of code (it's generally available in tutorials) for m=
y
services.<br>
<br>
It works out pretty well because the first service to =
start will
automatically create its own registry. Following services will use =
the
same registry if they use the same port number.<br>
<br>
<br>
public void exportService() throws RemoteException {<b=
r>
System.out.println("Exporting =
Service...");<br>
//reProps is a local Propert=
ies object that holds my
configuration settings.<br>
//I use this so that I can c=
ontrol my server applications in
a *nix like manager (edit the configuration with a text editor, then<br>
//restart the service.<br>
//Use the given port setting=
"port=3D" or 1099 by default.<br>
int port =3D Integer.parseInt(=
reProps.getProperty("port","1099"));<br>
System.out.println("\tUsing po=
rt "+port);<br>
Registry r;<br>
try {<br>
//First, attemp=
t to get an existing registry.<br>
System=
.out.println("\tAttempting to use existing service
Registry.");<br>
r =3D =
LocateRegistry.getRegistry(port);<br>
System=
.out.println("\tRegistry found; exporting service.");<br>
r.rebi=
nd(getName(), this);<br>
} catch (RemoteException ex) {=
<br>
//If we got her=
e, couldn't get a local registry (usually
because it doesn't exist yet.<br>
System=
.out.println("\tNo existing Registry; creating local
Registry.");<br>
r =3D =
LocateRegistry.createRegistry(port);<br>
System=
.out.println("\tRegistry created; exporting
service.");<br>
r.rebi=
nd(getName(), this);<br>
}<br>
System.out.println("Service ex=
ported as "+getName()+" on port
"+port);<br>
}<br>
<br>
I've had good success with this code under JSWrapper, and it works well
as cross-platform, too.<br>
<br>
Let me know if this helps.<br>
David Days<br>
<br>
sharedata wrote:
<blockquote
cite=3D"mid...@we..."
type=3D"cite">
<div>I am using windows XP. I'ld like to start rmiregistry in
background and not in a command window on the task bar. How can I do it?<=
/div>
<p> __________________________________________________<br>
=B8=CF=BF=EC=D7=A2=B2=E1=D1=C5=BB=A2=B3=AC=B4=F3=C8=DD=C1=BF=C3=E2=B7=D1=D3=
=CA=CF=E4?<br>
<a class=3D"moz-txt-link-freetext" href=3D"http://cn.mail.yahoo.com">http=
://cn.mail.yahoo.com</a>
</p>
<pre wrap=3D"">
<hr size=3D"4" width=3D"90%">
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job ea=
sier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronim=
o
<a class=3D"moz-txt-link-freetext" href=3D"http://sel.as-us.falkag.net/se=
l?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D121642">http://sel.as-us.falk=
ag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D121642</=
a></pre>
<pre wrap=3D"">
<hr size=3D"4" width=3D"90%">
_______________________________________________
Wrapper-user mailing list
<a class=3D"moz-txt-link-abbreviated" href=3D"mailto:Wrapper-user@lists.s=
ourceforge.net">Wra...@li...</a>
<a class=3D"moz-txt-link-freetext" href=3D"https://lists.sourceforge.net/=
lists/listinfo/wrapper-user">https://lists.sourceforge.net/lists/listinfo=
/wrapper-user</a>
</pre>
</blockquote>
</body>
</html>
|
|
From: Martin G. <mar...@mi...> - 2007-02-21 07:50:48
|
Good morning, I am using Java Service Wrapper under Linux and I am facing following problem: When I kill the JVM process (not wrapper, but JVM) with signal "kill -9", wrapper logs: ERROR | wrapper | 2007/02/21 08:36:48 | JVM exited unexpectedly. STATUS | wrapper | 2007/02/21 08:36:53 | Launching a JVM... and restarts the JVM which is what I want. When I kill the JVM process (not wrapper, but JVM) with just "kill", wrapper logs: STATUS | wrapper | 2007/02/21 08:32:25 | <-- Wrapper Stopped and stops without restarting JVM. Is there any way how to configure wrapper (or to change application ?) to achieve, that wrapper restarts JVM no matter what signal JVM received ? I played with wrapper.ignore_signal property, but it seems to work on wrapper, not on the spawned JVM and therefore it did not help me. Thanks. With best regards Martin Gazak MicroStep-MIS -- RNDr. Martin Gazak, MicroStep-MIS Cavojskeho 1, 841 04 Bratislava, Slovakia Tel: ++421 2 602 00 128, 111 Fax: ++421 2 602 00 180 e-mail: mar...@mi... www: http://www.microstep-mis.com |
|
From: Leif M. <le...@ta...> - 2007-02-22 01:38:59
|
Martin, I just retested this and it is working correctly for me. Most likely, this is a misunderstanding about when it is used. The wrapper's sh script by default will only use the ignore signals setting when it is being run as a daemon process. Ie when "start" is used, not "console". The thinking here is that daemon processes are the ones that you really want to be protecting from stray signals. "console" mode is mainly used for development as the wrapper would be killed when the shell was closed by default anyway. Let me know your use case as it may require some changes. If you want to ignore signals in console mode as well, you still need to set the IGNORE_SIGNALS flag in the sh script to put the sh script into that mode, but in your wrapper.conf file, add the following property: wrapper.ignore_signals=TRUE When IGNORE_SIGNALS is set, the sh script also causes the wrapper to create an anchor file. It then uses that to tell the wrapper to shut down. When IGNORE_SIGNALS is not set, the sh script attempts to shut down the wrapper by sending a TERM signal. Cheers, Leif Martin Gazak wrote: > Good morning, > I am using Java Service Wrapper under Linux and I am facing following > problem: > When I kill the JVM process (not wrapper, but JVM) with signal "kill > -9", wrapper logs: > > ERROR | wrapper | 2007/02/21 08:36:48 | JVM exited unexpectedly. > STATUS | wrapper | 2007/02/21 08:36:53 | Launching a JVM... > > and restarts the JVM which is what I want. > > When I kill the JVM process (not wrapper, but JVM) with just "kill", > wrapper logs: > > STATUS | wrapper | 2007/02/21 08:32:25 | <-- Wrapper Stopped > > and stops without restarting JVM. > Is there any way how to configure wrapper (or to change application ?) > to achieve, that wrapper restarts JVM no matter what signal JVM received ? > > I played with wrapper.ignore_signal property, but it seems to work on > wrapper, not on the spawned JVM and therefore it did not help me. > > Thanks. > > With best regards > > Martin Gazak > MicroStep-MIS > |
|
From: Martin G. <ma...@mi...> - 2007-02-22 13:34:05
|
---------- Original Message ----------- From: Leif Mortenson <le...@ta...> To: wra...@li... Sent: Thu, 22 Feb 2007 10:39:07 +0900 Subject: Re: [Wrapper-user] How to disable wrapper stopping, when killing JVM ? > Martin, > I just retested this and it is working correctly for me. Most likely, > this is a misunderstanding about when it is used. The wrapper's > sh script by default will only use the ignore signals setting when it > is being run as a daemon process. Ie when "start" is used, not > "console". > Let me know your use case as it may require some changes. Leif, thanks for the answer. I am sorry for not being precise - we start the wrapper version 3.1.2 (and therefore our application) as Linux (SuSE 10.0) service by "start" parameter, not "console", therefore my problems are related to daemon mode. The start script includes the line IGNORE_SIGNALS=true Our wrapper.conf also includes line wrapper.ignore_signals=true We want to run wrapper as service and we want the JVM to be restarted by wrapper no matter what signal is sent to JVM process (in this post I am not speaking about signals sent to wrapper process, but signals sent to spawned java process). Anyway "kill -9 " (SIGKILL) sent to JVM results even now in desired behaviour (wrapper detects unexpected termination of JVM and restarts it), however "kill " (SIGTERM?) sent to JVM is recognized by wrapper as a signal to be stopped. This stopping is what I need to change, the JVM should be restarted. > > If you want to ignore signals in console mode as well, you still need > to set the IGNORE_SIGNALS flag in the sh script to put the sh script > into that mode, but in your wrapper.conf file, add the following > property: > wrapper.ignore_signals=TRUE We speak about daeomon mode. We use also console mode, however only for debugging. Best regards Martin |
|
From: Leif M. <le...@ta...> - 2007-02-22 14:12:01
|
Martin, The version number was important. If you encounter problems with an old version in the future, please check the release notes. http://wrapper.tanukisoftware.org/doc/english/release-notes.html There was a bug fixed in 3.2.2 where the TERM signal handler was being disabled when a CHLD signal was received. This would happen when the JVM was restarted for any reason. There was also this particular bug fixed in 3.2.0 where the TERM signals were not being trapped at all by the JVM process. If you upgrade to 3.2.3, things should work correctly for you. The Wrapper will restart a JVM killed by KILL -9. There is no way to trap that and prevent the JVM from being killed. It will however, completely ignore TERM signals so your JVM will never be restarted. Cheers, Leif Martin Gazak wrote: > ---------- Original Message ----------- > From: Leif Mortenson <le...@ta...> > To: wra...@li... > Sent: Thu, 22 Feb 2007 10:39:07 +0900 > Subject: Re: [Wrapper-user] How to disable wrapper stopping, when killing > JVM ? > > >> Martin, >> I just retested this and it is working correctly for me. Most likely, >> this is a misunderstanding about when it is used. The wrapper's >> sh script by default will only use the ignore signals setting when it >> is being run as a daemon process. Ie when "start" is used, not >> "console". >> Let me know your use case as it may require some changes. >> > > Leif, > thanks for the answer. I am sorry for not being precise - we start the > wrapper version 3.1.2 (and therefore our application) as Linux (SuSE 10.0) > service by "start" parameter, not "console", therefore my problems are > related to daemon mode. > The start script includes the line > IGNORE_SIGNALS=true > > Our wrapper.conf also includes line > wrapper.ignore_signals=true > > We want to run wrapper as service and we want the JVM to be restarted by > wrapper no matter what signal is sent to JVM process (in this post I am not > speaking about signals sent to wrapper process, but signals sent to spawned > java process). > Anyway "kill -9 " (SIGKILL) sent to JVM results even now in desired > behaviour (wrapper detects unexpected termination of JVM and restarts it), > however "kill " (SIGTERM?) sent to JVM is recognized by wrapper as a signal > to be stopped. This stopping is what I need to change, the JVM should be > restarted. > > >> If you want to ignore signals in console mode as well, you still need >> to set the IGNORE_SIGNALS flag in the sh script to put the sh script >> into that mode, but in your wrapper.conf file, add the following >> property: >> wrapper.ignore_signals=TRUE >> > > We speak about daeomon mode. We use also console mode, however only for > debugging. > > Best regards > Martin > |