|
From: Stuijt, J. <JS...@gt...> - 2004-11-25 07:31:57
|
Christophe,
1) you should print the stacktrace (e.printStackTrace()) in your code,
because now, if there is an exception I think the JVM just exits silently,
and this could be happening 5 times in a row.
2) You are using integration method 3 (see website of the java service
wrapper), and for this method to work, your start(args) method must return.
At the moment, it stays in its while-loop forever..
Maybe you need yet another thread that watches over your mailing thread:
public Integer start(String[] args) {
try{
Mailing mailing = new Mailing();
mailing.setDaemon(true);
mailing.start();
MailingWatcher watcher = new MailingWatcher(mailing);
Watcher.start();
}
catch(Exception e){
System.exit(1);
}
return null;
}
/**
* Inner class for watching the Mailing thread.
*/
class MailingWatcher extends Thread
{
private Mailing mailing;
public MailingWatcher(Mailing mailing)
{
this.mailing = mailing;
}
public void run()
{
while (mailing.isAlive()){
System.out.println("Thread encore vivant !");
Thread.sleep(6000);
}
}
}
Johan
Met vriendelijke groet,
Johan Stuijt
Application Engineer
MES Expert Center
Doorkiesnummer: 075 612 79 34
GTI Industrie Noordwest bv
Industrial Automation
Houthavenkade 44 1506 PD Zaandam
Postbus 1377 1500 AJ Zaandam
tel.: 075 612 76 00 fax: 075 612 30 60
www.gti-group.com/ia
-----Oorspronkelijk bericht-----
Van: Christophe Leroux [mailto:ler...@ho...]
Verzonden: woensdag 24 november 2004 13:55
Aan: wra...@li...
Onderwerp: [Wrapper-user] Please help me ... service was launched, but
failed to start.
Dear all,
First of all, I would like to say that sourceforge is a very huge knowledge
source for me. I like your work and hope your success will continue growing.
Ohterwise, I'm really disapointed about the way to execute my app as a
service with the wrapper.
Here is the content of my wrapper.conf :
Starting the SendLogByMail service...
--> Wrapper Started as Service
Using system timer.
server listening on port 32000.
Launching a JVM...
command: "C:\J2EE\SDK1.4\jdk\bin\java.exe" -Djava.library.path="classes/lib"
-classpath "classes/" -Dwrapper.key="Rfv8sZ_PcoRLht4W" -Dwrapper.port=32000
-Dwrapper.debug="TRUE" -Dwrapper.use_system_time="TRUE"
-Dwrapper.version="3.1.2" -Dwrapper.native_library="wrapper"
-Dwrapper.service="TRUE" -Dwrapper.cpu.timeout="10" -Dwrapper.jvmid=1
com.cleroux.Main
JVM started (PID=3392)
WrapperManager class initialized by thread: main Using classloader:
sun.misc.Launcher$AppClassLoader@e80a59
Wrapper Manager: JVM #1
Wrapper Manager: Registering shutdown hook
Wrapper Manager: Using wrapper
Loaded native library: wrapper.dll
Calling native initialization method.
Initializing WrapperManager native library.
Java Executable: C:\J2EE\SDK1.4\jdk\bin\java.exe
Windows version: 5.1.2600
Java Version : 1.4.2_04-b04 Java HotSpot(TM) Client VM
Java VM Vendor : Sun Microsystems Inc.
Wrapper (Version 3.1.2) http://wrapper.tanukisoftware.org
WrapperManager.start(com.cleroux.Main@14b7453, args[]) called by thread:
main
Open socket to wrapper...
Opened Socket
Send a packet KEY : Rfv8sZ_PcoRLht4W
handleSocket(Socket[addr=/127.0.0.1,port=32000,localport=2313])
accepted a socket from 127.0.0.1 on port 2313
read a packet KEY : Rfv8sZ_PcoRLht4W
Got key from JVM: Rfv8sZ_PcoRLht4W
send a packet LOW_LOG_LEVEL : 1
send a packet PING_TIMEOUT : 30
Start Application.
send a packet START : start
Received a packet LOW_LOG_LEVEL : 1
Wrapper Manager: LowLogLevel from Wrapper is 1
Received a packet PING_TIMEOUT : 30
Wrapper Manager: PingTimeout from Wrapper is 30000
Received a packet START : start
calling listener.start()
Waiting to start...
Waiting to start...
Waiting to start...
Waiting to start...
Waiting to start...
Startup failed: Timed out waiting for signal from JVM.
As you can see, the wrapper try 5 times to launch the service
unsuccessfully.
I really ask my self why it does not !
If any one had an idea, I would be really happy !
Here is an extract of my main class :
public class Main implements WrapperListener{
public Integer start(String[] arg0) {
boolean flag=true;
try{
Mailing mailing = new Mailing();
mailing.setDaemon(true);
mailing.start();
while (mailing.isAlive()){
System.out.println("Thread encore vivant
!");
Thread.sleep(6000);
}
}
catch(Exception e){
System.exit(1);
}
return null;
}
public static void main(String[] args) {
WrapperManager.start(new Main(), args);
}
}
Thanks for your help !
Bye,
Christophe (please excuse me for the quality of my english !)
-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://productguide.itmanagersjournal.com/
_______________________________________________
Wrapper-user mailing list
Wra...@li...
https://lists.sourceforge.net/lists/listinfo/wrapper-user
================================================
De informatie opgenomen in dit bericht kan vertrouwelijk zijn en
is uitsluitend bestemd voor de geadresseerde. Indien u dit bericht
onterecht ontvangt, wordt u verzocht de inhoud niet te gebruiken en
de afzender direct te informeren door het bericht te retourneren.
================================================
The information contained in this message may be confidential
and is intended to be exclusively for the addressee. Should you
receive this message unintentionally, please do not use the contents
herein and notify the sender immediately by return e-mail.
================================================
|