|
From: Justo C. <jca...@cf...> - 2005-02-04 17:23:01
|
Kin,
If you are spawning your threads but then immediately returning control to
your main class and then calling System.exit(...), this could be a reason
why. The code that spawns your threads needs to block until the new threads
are interrupted or complete their work. Only then should you call
System.exit(...). For example....
Thread myThread = new Thread() {
public void run() {
// your code
}
};
myThread.start();
System.exit(...); // ouch !! this would be a problem, since myThread.start()
does not block !!
But I'm only guessing here. Leif is correct, run your program in console
mode and check wrapper.log. If my guess is correct, your program will exit
before your spawned threads can do any useful work.
Thanks - Justo
----- Original Message -----
From: "Leif Mortenson" <le...@ta...>
To: <wra...@li...>
Sent: Friday, February 04, 2005 10:36 AM
Subject: Re: [Wrapper-user] Does Java service wrapper support multithread?
> Kin,
> What is in your wrapper.log file? Most likely your application threw an
> error on startup.
>
> I would strongly suggest running in console mode while you are
> developing. It is much
> easier that way as you can immediately see any errors in the console
> without having to
> check a log file.
>
> Cheers,
> Leif
>
> Kin Chan wrote:
>
> >I have successfully run a small program using java
> >service wrapper, and start/stop serivce successfully.
> >
> >Until I changed my code. My program will create
> >multiple threads in the main program. And when i try
> >to start the service, I got the following
> >
> >---------------------------
> >Could not start the Application service on Local
> >Computer.
> >
> >Error 1067: The process terminated unexpectedly.
> >---------------------------
> >
> >Can anyone shed some light on this?
> >
> >Thanks,
> >
> >
> >
> >
> >
> >__________________________________
> >Do you Yahoo!?
> >All your favorites on one personal page – Try My Yahoo!
> >http://my.yahoo.com
> >
> >
> >-------------------------------------------------------
> >This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
> >Tool for open source databases. Create drag-&-drop reports. Save time
> >by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> >Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> >_______________________________________________
> >Wrapper-user mailing list
> >Wra...@li...
> >https://lists.sourceforge.net/lists/listinfo/wrapper-user
> >
> >
> >
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
> Tool for open source databases. Create drag-&-drop reports. Save time
> by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
> Download a FREE copy at http://www.intelliview.com/go/osdn_nl
> _______________________________________________
> Wrapper-user mailing list
> Wra...@li...
> https://lists.sourceforge.net/lists/listinfo/wrapper-user
|