File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Stuck between TimerTasks and ObjectOutputStream...(i think) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Stuck between TimerTasks and ObjectOutputStream...(i think)" Watch "Stuck between TimerTasks and ObjectOutputStream...(i think)" New topic
Author

Stuck between TimerTasks and ObjectOutputStream...(i think)

Prashant Sehgal
Ranch Hand

Joined: Jun 20, 2003
Posts: 56
Hi,

I've been banging my head against this for almost two days and am now out of ideas and stamina! There's much more code than I'm putting here and much more weird behaviour I'm seeing - but I dont think anyone has the patience to read that, much less mine to write it!! But here's the summary:

I have an signed applet that talks to a servlet. On the click of a button in the applet, the servlet calls a bunch of utility classes that do file i/o of the disk, connect to db, called stored procedures etc.

Now what I want to achieve is that all these utility classes be able to some log progress back to a text area on the applet. I use a singleton Logger that buffers all log messages coming from anywhere in the app. I designed skeletons around it and it worked. The real thing, however, doesn't.

I user a timer in the applet and the servlet classes. The applet timer wakes up, and appends to the text area whatever's there to read off of the ObjectInputStrem. The servlet timer wakes up and checks if there's anything new in the Loffer buffer and if so, throws it to the Applet.

The problem is that the initial messages from the utililty classes arrive fine, but the later message never make it past the servlet.

Here's the code:

The Applet


The Servlet



The Servlet's TimerTask
 
jQuery in Action, 2nd edition
 
subject: Stuck between TimerTasks and ObjectOutputStream...(i think)