You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geronimo.apache.org by Christopher Blythe <cj...@gmail.com> on 2007/08/22 16:27:23 UTC

DayTrader streamer and web services clients terminate unexpectedly

All...

I'm still working with the DayTrader streamer client and have run into
another issue I cannot explain. Both the streamer and ws app client create
Swing-based GUIs. I am in no way a Swing expert; however, all of the docs
that I have read indicate that the GUI thread should remain up and running
(along with the JVM) after main completes. Here is an example...

public class JFrameExample {
    public static void main(String[] args) {
        JFrame f = new JFrame("This is a test");
        ...
        f.addWindowListener(new ExitListener());
        f.setVisible(true);
    }
}

>From what I have seen all Swing apps use some variation of this, as do the
DayTrader streamer and ws app clients.

Unfortunately, when I try to run these clients in under Geronimo 2.0.1, the
apps terminate when the main thread completes. I have added a Thread.sleep()
to the main just to verify that the GUI remains up while the main thread is
still active.

Does anyone have any thoughts as to why the JVM is terminating with main
while the GUI threads are still active and have not been closed? I've tried
a SUN and IBM JVM and both result in early termination. The only thing I can
think of is that something in the Geronimo client or the manner in which
Geronimo packages the client that is changing the behavior.

Thanks...

Chris


-- 
"I say never be complete, I say stop being perfect, I say let... lets
evolve, let the chips fall where they may." - Tyler Durden

Re: DayTrader streamer and web services clients terminate unexpectedly

Posted by David Jencks <da...@yahoo.com>.
On Aug 22, 2007, at 10:31 AM, Christopher Blythe wrote:

> GERONIMO-3436 opened...
>
> In the mean time... I could easily gate the exit of Main using a  
> while loop conditional based on JFrame.isVisible(). I'm tempted to  
> add this to the client code in order to get it working. However, we  
> wouldn't be able to catch this issue in the future, if I do...
>
> Any strong opinions here?

Could you check what happens if you remove the override of  
initializeKernel from EmbeddedClientCommandLine?  I have only a fuzzy  
recollection of my even more fuzzy understanding of how this works  
but think that installing the shutdown hook was what kept the client  
running until it was actually stopped.

thanks
david jencks
>
> On 8/22/07, David Jencks <da...@yahoo.com> wrote:
>
> On Aug 22, 2007, at 7:27 AM, Christopher Blythe wrote:
>
> > All...
> >
> > I'm still working with the DayTrader streamer client and have run
> > into another issue I cannot explain. Both the streamer and ws app
> > client create Swing-based GUIs. I am in no way a Swing expert;
> > however, all of the docs that I have read indicate that the GUI
> > thread should remain up and running (along with the JVM) after main
> > completes. Here is an example...
> >
> > public class JFrameExample {
> >     public static void main(String[] args) {
> >         JFrame f = new JFrame("This is a test");
> >         ...
> >         f.addWindowListener(new ExitListener());
> >         f.setVisible(true);
> >     }
> > }
> >
> > From what I have seen all Swing apps use some variation of this, as
> > do the DayTrader streamer and ws app clients.
> >
> > Unfortunately, when I try to run these clients in under Geronimo
> > 2.0.1, the apps terminate when the main thread completes. I have
> > added a Thread.sleep() to the main just to verify that the GUI
> > remains up while the main thread is still active.
> >
> > Does anyone have any thoughts as to why the JVM is terminating with
> > main while the GUI threads are still active and have not been
> > closed? I've tried a SUN and IBM JVM and both result in early
> > termination. The only thing I can think of is that something in the
> > Geronimo client or the manner in which Geronimo packages the client
> > that is changing the behavior.
>
> I remember fixing this once....
>
> My guess is that it got broken again when gianny added the bootstrap
> repository.  A JIRA would be good I think.   I suspect if you look
> around at the various command line classes you can see the code that
> shuts down the client from a shutdown hook and see why it isn't
> getting used.
>
> I'll try to find some time to take a look at this if you don't beat
> me to it.
>
> thanks
> david jencks
>
>
> >
> > Thanks...
> >
> > Chris
> >
> >
> > --
> > "I say never be complete, I say stop being perfect, I say let...
> > lets evolve, let the chips fall where they may." - Tyler Durden
>
>
>
>
> -- 
> "I say never be complete, I say stop being perfect, I say let...  
> lets evolve, let the chips fall where they may." - Tyler Durden


Re: DayTrader streamer and web services clients terminate unexpectedly

Posted by Christopher Blythe <cj...@gmail.com>.
GERONIMO-3436 opened...

In the mean time... I could easily gate the exit of Main using a while loop
conditional based on JFrame.isVisible(). I'm tempted to add this to the
client code in order to get it working. However, we wouldn't be able to
catch this issue in the future, if I do...

Any strong opinions here?

On 8/22/07, David Jencks <da...@yahoo.com> wrote:
>
>
> On Aug 22, 2007, at 7:27 AM, Christopher Blythe wrote:
>
> > All...
> >
> > I'm still working with the DayTrader streamer client and have run
> > into another issue I cannot explain. Both the streamer and ws app
> > client create Swing-based GUIs. I am in no way a Swing expert;
> > however, all of the docs that I have read indicate that the GUI
> > thread should remain up and running (along with the JVM) after main
> > completes. Here is an example...
> >
> > public class JFrameExample {
> >     public static void main(String[] args) {
> >         JFrame f = new JFrame("This is a test");
> >         ...
> >         f.addWindowListener(new ExitListener());
> >         f.setVisible(true);
> >     }
> > }
> >
> > From what I have seen all Swing apps use some variation of this, as
> > do the DayTrader streamer and ws app clients.
> >
> > Unfortunately, when I try to run these clients in under Geronimo
> > 2.0.1, the apps terminate when the main thread completes. I have
> > added a Thread.sleep() to the main just to verify that the GUI
> > remains up while the main thread is still active.
> >
> > Does anyone have any thoughts as to why the JVM is terminating with
> > main while the GUI threads are still active and have not been
> > closed? I've tried a SUN and IBM JVM and both result in early
> > termination. The only thing I can think of is that something in the
> > Geronimo client or the manner in which Geronimo packages the client
> > that is changing the behavior.
>
> I remember fixing this once....
>
> My guess is that it got broken again when gianny added the bootstrap
> repository.  A JIRA would be good I think.   I suspect if you look
> around at the various command line classes you can see the code that
> shuts down the client from a shutdown hook and see why it isn't
> getting used.
>
> I'll try to find some time to take a look at this if you don't beat
> me to it.
>
> thanks
> david jencks
>
>
> >
> > Thanks...
> >
> > Chris
> >
> >
> > --
> > "I say never be complete, I say stop being perfect, I say let...
> > lets evolve, let the chips fall where they may." - Tyler Durden
>
>


-- 
"I say never be complete, I say stop being perfect, I say let... lets
evolve, let the chips fall where they may." - Tyler Durden

Re: DayTrader streamer and web services clients terminate unexpectedly

Posted by David Jencks <da...@yahoo.com>.
On Aug 22, 2007, at 7:27 AM, Christopher Blythe wrote:

> All...
>
> I'm still working with the DayTrader streamer client and have run  
> into another issue I cannot explain. Both the streamer and ws app  
> client create Swing-based GUIs. I am in no way a Swing expert;  
> however, all of the docs that I have read indicate that the GUI  
> thread should remain up and running (along with the JVM) after main  
> completes. Here is an example...
>
> public class JFrameExample {
>     public static void main(String[] args) {
>         JFrame f = new JFrame("This is a test");
>         ...
>         f.addWindowListener(new ExitListener());
>         f.setVisible(true);
>     }
> }
>
> From what I have seen all Swing apps use some variation of this, as  
> do the DayTrader streamer and ws app clients.
>
> Unfortunately, when I try to run these clients in under Geronimo  
> 2.0.1, the apps terminate when the main thread completes. I have  
> added a Thread.sleep() to the main just to verify that the GUI  
> remains up while the main thread is still active.
>
> Does anyone have any thoughts as to why the JVM is terminating with  
> main while the GUI threads are still active and have not been  
> closed? I've tried a SUN and IBM JVM and both result in early  
> termination. The only thing I can think of is that something in the  
> Geronimo client or the manner in which Geronimo packages the client  
> that is changing the behavior.

I remember fixing this once....

My guess is that it got broken again when gianny added the bootstrap  
repository.  A JIRA would be good I think.   I suspect if you look  
around at the various command line classes you can see the code that  
shuts down the client from a shutdown hook and see why it isn't  
getting used.

I'll try to find some time to take a look at this if you don't beat  
me to it.

thanks
david jencks


>
> Thanks...
>
> Chris
>
>
> -- 
> "I say never be complete, I say stop being perfect, I say let...  
> lets evolve, let the chips fall where they may." - Tyler Durden