Pool of worker threads

Hi guys,
Just wondering if you guys know of any class I can use as a pool of threads.
Normal operations applied, I can create it myself, but if there is something already I can use it is a plus.
Many Thanks,
MeTitus

Herko_ter_Horst wrote:
Take a look at the java.util.concurrent package.Indeed. http://java.sun.com/docs/books/tutorial/essential/concurrency/executors.html

Similar Messages

  • Using SSRS local mode, receive invalid token error when trying to export the report when running in worker thread

    We're using ASP.net with .Net 4, developing with Visual Studio 2012.  We use SSRS 2012sp1 with local reports, so exporting the report ourselves instead of using a reportviewer control (and not using the SQL Reporting service).  The reports are
    executing fine when we export the report in the main thread, but if we spawn a worker thread and run a report there we receive the following error when calling Render():
    Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Failed to load expression host assembly. Details: Invalid token for impersonation - it cannot be duplicated.
    We only receive this when running a report that uses expressions on a separate thread.  I've tried running the application pool under all the default built-in accounts (NetworkService, etc), and under admin user accounts to no avail.
    This didn't occur with the previous version of our application which used .net 3.5.

    As mentioned, we are not using the Reportviewer control, we are rendering locally.  Not certain if that would make a difference.
    Also, I had tried using all the built-in accounts.  Just for kicks I changed it to LocalSystem again, then reset IIS (see image below).  I then tried to export the report in a worker thread and received the same error.
    Here is the text from the exception:
    Microsoft.Reporting.WebForms.LocalProcessingException: An error occurred during local report processing. ---> Microsoft.ReportingServices.ReportProcessing.ReportProcessingException: Failed to load expression host assembly. Details: Invalid token for impersonation - it cannot be duplicated.
    at Microsoft.ReportingServices.RdlExpressions.ReportRuntime.ProcessLoadingExprHostException(ObjectType assemblyHolderObjectType, Exception e, ProcessingErrorCode errorCode)
    at Microsoft.ReportingServices.RdlExpressions.ReportRuntime.LoadCompiledCode(IExpressionHostAssemblyHolder expressionHostAssemblyHolder, Boolean includeParameters, Boolean parametersOnly, ObjectModelImpl reportObjectModel, ReportRuntimeSetup runtimeSetup)
    at Microsoft.ReportingServices.OnDemandProcessing.Merge.Init(Boolean includeParameters, Boolean parametersOnly)
    at Microsoft.ReportingServices.OnDemandProcessing.Merge.Init(ParameterInfoCollection parameters)
    at Microsoft.ReportingServices.ReportProcessing.Execution.ProcessReportOdp.CreateReportInstance(OnDemandProcessingContext odpContext, OnDemandMetadata odpMetadata, ReportSnapshot reportSnapshot, Merge& odpMerge)
    at Microsoft.ReportingServices.ReportProcessing.Execution.ProcessReportOdp.Execute(OnDemandProcessingContext& odpContext)
    at Microsoft.ReportingServices.ReportProcessing.Execution.RenderReportOdpInitial.ProcessReport(ProcessingErrorContext errorContext, ExecutionLogContext executionLogContext, UserProfileState& userProfileState)
    at Microsoft.ReportingServices.ReportProcessing.Execution.RenderReport.Execute(IRenderingExtension newRenderer)
    at Microsoft.ReportingServices.ReportProcessing.ReportProcessing.RenderReport(IRenderingExtension newRenderer, DateTime executionTimeStamp, ProcessingContext pc, RenderingContext rc, IChunkFactory yukonCompiledDefinition)
    at Microsoft.Reporting.LocalService.CreateSnapshotAndRender(ReportProcessing repProc, IRenderingExtension renderer, ProcessingContext pc, RenderingContext rc, SubreportCallbackHandler subreportHandler, ParameterInfoCollection parameters, DatasourceCredentialsCollection credentials)
    at Microsoft.Reporting.LocalService.Render(String format, String deviceInfo, String paginationMode, Boolean allowInternalRenderers, IEnumerable dataSources, CreateAndRegisterStream createStreamCallback)
    at Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings)
    --- End of inner exception stack trace ---
    at Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, CreateAndRegisterStream createStreamCallback, Warning[]& warnings)
    at Microsoft.Reporting.WebForms.LocalReport.InternalRender(String format, Boolean allowInternalRenderers, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
    at Microsoft.Reporting.WebForms.LocalReport.Render(String format, String deviceInfo, PageCountMode pageCountMode, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
    at Microsoft.Reporting.WebForms.Report.Render(String format, String deviceInfo, String& mimeType, String& encoding, String& fileNameExtension, String[]& streams, Warning[]& warnings)
    at IxSS.Infolinx.Report.MicrosoftInfolinxReport.ExportReport(String strFileFullyQualifiedPath, String strExportType, String strFilterDesc, Dictionary`2 extraParams, String area)
    at IxSS.Infolinx.Report.MicrosoftInfolinxReport.ExportReport(String strFileFullyQualifiedPath, String strExportType, String strFilterDesc, Dictionary`2 extraParams)

  • SSL connections blocking worker threads on DS 5.2 patch 4

    Hi,
    Is it normal for an idle SSL connection to consume a worker thread within the directory server?
    We have recently enabled SSL on a number of our directory servers (5.2 patch 4) and have run into problems with the server hanging. We have a number of application servers, each opening a pool of connections to the servers via JNDI. It seems that once 30 SSL connections have been established to a give LDAP server, the server will hang. By hang I mean the server is accepting TCP connections, but not responding to LDAP requests.
    The server can deal with a lot more than 30 non-ssl connections. I'm guessing that SSL connections need to maintain state, which is what is tying up the worker threads.
    Is this normal, and is it docuemented anywhere? Currently I'm looking at terminating the SSL connections on a load balancer in front of the LDAP servers, or perhaps on an LDAP proxy. Any other suggestions as to how this is typically dealt with?
    thanks,
    R

    Thank you Gautam.
    On further testing yesterday, we discovered that the problem is just as you have described. Our application servers are opening an initial pool of five connections, but typically only using one of those connections. The one connection the server uses to make an LDAP request behaves 'normally', not tying up a thread on the LDAP server. The other four sit there blocking a thread each, until eventually we hit the nsslapd-threadnumber.
    Based on that discovery, we're having the application changed so that its initial LDAP connection pool size is one, which appears to address the problem. That way connections are only established and added to the pool as they are required, resulting in well behaved connections to the LDAP server.
    Thanks for the quick reply... The Sunsolve note is helpful, as is the info about the nsslapd-ioblocktimeout parameter.
    kind regards,
    R

  • DPS v6-7 worker threads maxNormalPriorityPeak?

    In the Deployment Guide, in discussing DPS worker threads and backend connections it states on page 54 "Also, the value of the maxNormalPriorityPeak attribute should remain low". What is comnsidered a low number? Or would the amount be specific to the scope or set up of the DPS. Thanks.

    This number represents the backlog of operations to be processed waiting in a work queue for a worker thread to be available.
    If the worker thread number is set correctly, the work queue should hold a small nb of ops.
    Peaks may occur at startup time (DPS receives a bunch of traffic while the connection pools are not initialized yet) or with transient high traffic. This parameter is directly related to flow control and memory consumption, so a 3digit number looks OK

  • Worker Threads: Created by model or by controller?

    Sometimes models needs to access blocking devices, like network cards, databases, files, and so on. This should be done by worker threads or services. But who is in charge of that? The controller or the model itself? I tend to say it is the model, as only the model knows about the fact that it accesses a blocking object. On the other hand, it is said that a model should be a POJO, so it would be the controller's job.
    Is there a best practice or general design rule?

    It's impossible to make a general recommendations, but I'd say in many cases the answer to this question is really that the worker threads are created by neither a model or controller.  Threads often need to be associated with processes and tasks which is independent of models and controllers.  Instead you can use dependency injection to inject references into controllers to a common object instances which control isolated threading logic and implementation and encapsulate it to server a given responsibility (such as blocking server communication), with the entity providing this functionality also providing event driven callbacks to the models and controllers, so that they can get notified of changes for tasks spawned based upon their requests.  For example, if you look at the Java JEE model, entity classes and controllers in that model usually never explicitly create or reference threads (that portion of JEE really a pretty general programming mechanism and is also applicable to client code in JavaFX).
    MVC isn't a panacea solution to everything.  In fact it tends to be overly quoted and widely misunderstood and what it actually is is open to different interpretation by different readers.  There is a great discussion of MVC by Martin Fowler.  Everybody claims to do MVC, and they are all doing it, they are just doing it in a different way, which is fine, but it means that it is not a very good reference in trying to communicate solutions to issues such as architecting a multi-threaded application.
    What I would recommend instead of analyzing your entire application from an MVC viewpoint, is to use CRC modeling on it (class/responsibilities/collaborations), you can google it to see how it works if you don't already know.  That way you are thinking about how to architect and build a solution to your application domain issues rather than trying to shoehorn solutions into a certain framework.  Sure MVC is a great thing and is appropriate for many things, just make sure you really want to think from that viewpoint for a particular piece of the solution you are building.
    With threading, you generally want to write as little concurrent code as possible.  You also want this code compartmentalized, so you only need to study the concurrent code in one place (hopefully a single class or at most a single package).  You also don't want the knowledge and use of the threads to leak.  For example, ensure that almost all the code you write is only accessing a single thread so that you don't have to worry about concurrency related bugs and reasoning about concurrency in most of your code.  This is the way the JavaFX system works.  It has multiple threads internally for application processing and rendering, but from a user point of view, all the user application code just runs on a single JavaFX application thread.  This makes the user code less error prone and easier to reason about and also simplifies the library API and usage greatly.
    So let's say you have a server communication API which makes use of a multithreaded client pool of server connections such as apache HTTP components.  Create a single class, e.g. Communicator with methods ResponseMessage send(Location destination, RequestMessage requestMessage) and void sendAsync(Location destination, RequestMessage requestMessage, Callback<ResponseMessage,Void> callback).  The async version, can make use of Platform.runLater, to ensure your callback is invoked on the JavaFX application thread - then your calling JavaFX application code never needs to worry about the internal threading implementation of the communicator, it just reacts to an event driven callback (the same way something like the snapshot API works).  If you need more fine grained feedback and control over the async task from your application, than rather than having a simple callback, you can return a Worker/Task which can be monitored for progress within your JavaFX application, see for instance the LoadWorker in WebEngine.  If your communication implementation is actually reasonably involved and can't be implemented in a single class, that is OK, just make Communicator a facade and use multiple classes in the internal communicator package implementation, but don't use any of that implementation outside of the communicator package.  You can use a dependency injection framework such as afterburner to inject a reference to a communicator into your FXML controllers.

  • How to find Number of working threads using java executor framework

    I'm creating a java thread pool using java 1.5 executor framework.
    private ExecutorService executorService = Executors.newFixedThreadPool(threadPoolSize);
    public <T> Future<T> submit(Callable<T> task) {
              return executorService.submit(task);
    }Now I want to get the number of working thread at runtime. Is there any java api available to do this using java 1.5 executor framework?
    Thanks,
    Arpan

    If the ExecutorService you are working on is a ThreadPoolExecutor then you can use ThreadPoolExecutor#getActiveCount() to get the count of threads actually running tasks. There is no such method on the ExecutorService interface though.

  • Using worker threads in a Servlet

    Hello friends.
    I am hoping for a sanity check on a design decision I am considering. I have a Servlet that implements a web service that generates an XML document on demand. Depending on the request, the servlet will assemble the XML document from a number of external web services. I guess its somewhat like a mashup.
    I am seeing some significant performance issues doing the external web service requests synchronously. So I am considering using some kind of ThreadPool collect all my data from the web services. Once all the data is available, I will assemble my XML document and return the Response from the Servlet.
    I would appreciate any comments or feedback on this approach. Specifically:
    - Are there any concerns in using a ThreadPool of some kind within a Servlet? I know the Servlet container is multi-threaded, so I guess the ThreadPool would be shared across all threads. Or I suppose I could have a thread local instance of a thread pool. Thoughts?
    - I am using Tomcat 6 as my Servlet container. Any issues with this approach on that container?
    - I have done a lot of multi-threaded programming in the past, but have not used anything from the java.util.concurrency package yet. Are there any classes in this package that might help with my approach? Any other resources worth checking out?
    Thank you all for your help.
    Jeff

    Thanks sjasja.
    I definitely think I should use a ThreadPool. For me its not about how many threads can be created then destroyed in 1 second, its how many simultaneous threads can run at once. I am using Tomcat servlet container, with the default configuration of 200 maxThreads. If my application gets a heavy load and each of those threads creates 50 worker threads, I am going to reach an OutOfMemoryException for sure.
    My only concern is that if all 200 Tomcat threads really are being used, will most of the worker threads jobs spend too much time waiting in the ThreadPool queue? I guess that will have to just take some testing to find the optimal number of threadpool threads.
    Thanks for your additional thoughts.
    Jeff

  • Calling a delegate on the UI thread from a work thread inside a child class.

    Hi All,
    I've run into a snag developing a WPF multithreaded app where I need to call a method on the UI thread from my work thread, where the work thread is running a different class.
    Currently I am trying to use a delegate and an event in the 2nd class to call a method in the 1st class on the UI thread. This so far is not working as because the 2nd class is running in its own thread, it causes a runtime error when attempting to call
    the event.
    I've seen lots of solutions referring to using the dispatcher to solve this by invoking the code, however my work thread is running a different class than my UI thread, so it seems the dispatcher is not available?
    Below is as simplified an example as I can make of what I am trying to achieve. Currently the below code results in a "The calling thread cannot access this object because a different thread owns it." exception at runtime.
    The XAML side of this just produces a button connected to startThread2_Click() and a label which is then intended to be updated by the 2nd thread calling the updateLabelThreaded() function in the first thread when the button is clicked.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Threading.Tasks;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;
    using System.Windows.Threading;
    using System.Threading;
    namespace multithreadtest
    public delegate void runInParent();
    public partial class MainWindow : Window
    public MainWindow()
    InitializeComponent();
    threadUpdateLabel.Content = "Thread 1";
    private void startThread2_Click(object sender, RoutedEventArgs e)
    thread2Class _Thread2 = new thread2Class();
    _Thread2.runInParentEvent += new runInParent(updateLabelThreaded);
    Thread thread = new Thread(new ThreadStart(_Thread2.threadedTestFunction));
    thread.Start();
    public void updateLabelThreaded()
    threadUpdateLabel.Content = "Thread 2 called me!";
    public class thread2Class
    public event runInParent runInParentEvent;
    public void threadedTestFunction()
    if (runInParentEvent != null)
    runInParentEvent();
    I'm unfortunately not very experienced with c# so I may well be going the complete wrong way about what I'm trying to do. In the larger application I am writing, fundamentally I just need to be able to call a codeblock in the UI thread when I'm in a different
    class on another thread (I am updating many different items on the UI thread when the work thread has performed certain steps, so ideally I want to keep as much UI code as possible out of the work thread. The work threads logic is also rather complicated as
    I am working with both a webAPI and a MySQL server, so keeping it all in its own class would be ideal)
    If a more thorough explanation of what I am trying to achieve would help please let me know.
    Any help with either solving the above problem, or suggestions for alternative ways I could get the class in the UI thread to do something when prompted by the 2nd class in the 2nd thread would be appreciated.
    Thanks :)

    If I follow the explanation, I think you can use MVVM Light messenger.
    You can install it using NuGet.
    Search on mvvm light libraries only.
    You right click solution in solution explorer and choose manage nugget...
    So long as you're not accessing ui stuff on these other threads.
    using GalaSoft.MvvmLight.Messaging;
    namespace wpf_Tester
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    public MainWindow()
    InitializeComponent();
    Messenger.Default.Register<String>(this, (action) => ReceiveString(action));
    private void ReceiveString(string msg)
    MessageBox.Show(msg);
    Dispatcher.BeginInvoke((Action)delegate()
    tb.Text = msg;
    private void Button_Click(object sender, RoutedEventArgs e)
    Task.Factory.StartNew(() => {
    Messenger.Default.Send<String>("Hello World");
    What the above does is start up a new thread - that startnew does that.
    It sends of message of type string which the main window has subscribed to....it gets that and puts up a message box.
    The message is sent from the window to the window in that but this will work across any classes in a solution.
    Note that the receive acts on whichever thread the message is sent from.
    I would usually be altering properties of a viewmodel with such code which have no thread affinity.
    If you're then going to directly access properties of ui elements then you need to use Dispatcher.BeginInvoke to get back to the UI thread.
    I do that with an anonymous action in that bit of code but you can call a method or whatever instead if your logic is more complicated or you need it to be re-usable.
    http://social.technet.microsoft.com/wiki/contents/articles/26070.aspx
    Hope that helps.
    Technet articles: Uneventful MVVM;
    All my Technet Articles

  • What is the max. count of internal worker-threads in B1iSN 88?

    Hi Experts,
    We have an installation of B1iSN 88 with an ECC 6.0 and 54 SAP Business One installation. The Hardware is 8 Core multi-threads processor. 32GB Memory. Now we have a problem with the queuing of Events. What we have found is that the configuration of the internal worker-threads is set to -1(please see below for the settings). We change the settings to xcl.threads=20 and it improves the queuing. My question is what is the max. count of internal worker-threads per core? so that we can know how many worker will set and if we need to upgrade the CPU to 16 Core..
    # The max. count of internal worker-threads afforded for the internal Scheduler (defaults to 1)
    # The value of 0 means that there is no limit (what in general should not be set up).
    # A negative value means the count of threads per available processor
    xcl.threads=-1
    Regards,
    Wilson

    You're very welcome.
    Yes, they are very nice machines. 
    What a jump in performance when I swapped out the Pentium 4 620 mine had, for the PD 945, and tossed in 4 GB of memory.
    That box will also run the Radeon HD 6570 with no problem too, which is what I put in mine.
    The downside of that model is that there are no settings for ahci or raid.
    I own or have owned every CMT since the d510 with the exception of the dc7900.
    My main PC is now the 8200 Elite CMT which I installed W8.1 on.
    It has an i7-2600 processor and 32 GB of memory, 1 TB SATA III hard drive.
    I threw in a Radeon HD 6670 in that one.
    Best Regards,
    Paul

  • Creator Freeze Often -- SWING Worker thread also

    I'm developping an app with creator. And I have many freezes in several minutes long as some people mentioned before.
    I'm running win XP on an opeteron 244(1.8G) x2 , with 2G memory. I've updated creator to the latest updates, but it doesn't seem to be better.
    The things I found is that when I edit Session Bean , Creator takes especially long time to come up.
    At that time, SWING worker thread of Creator IDE also stopping, No update of display , I only look window frame.
    You know the SWING has a Single thread model ,so if some logic uses SWING worker's thread long time, all displying process will be stopped.
    Below is the stacktrace just after a few seconds when Creator freeze by editing Session Bean.
    I use the stacktrace tool at http://tmitevski.users.mcs2.netarray.com/trace.do
    Full thread dump Java HotSpot(TM) Client VM (1.5.0_04-b05 mixed mode):
    "StackTrace Remote Thread" prio=5 tid=0x48b10418 nid=0x368 waiting on condition [0x00000000..0x4e85fbac]
    "Inactive RequestProcessor thread [Was:TimedWeakReference/org.netbeans.modules.projectapi.TimedWeakReference]" daemon prio=2 tid=0x48cc9e78 nid=0x634 in Object.wait() [0x4e89f000..0x4e89fbe8]
         at java.lang.Object.wait(Native Method)
         at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:692)
         - locked <0x1eeb8620> (a java.lang.Object)
    "Inactive RequestProcessor thread [Was:Default RequestProcessor/org.netbeans.modules.editor.NbEditorUI$2]" daemon prio=2 tid=0x48d00d18 nid=0x814 in Object.wait() [0x4e79f000..0x4e79fce8]
         at java.lang.Object.wait(Native Method)
         at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:692)
         - locked <0x1eeb8690> (a java.lang.Object)
    "Inactive RequestProcessor thread [Was:Java Children Provider/org.netbeans.modules.java.ui.nodes.elements.SourceChildren$4]" daemon prio=2 tid=0x48ce0d98 nid=0xd8c in Object.wait() [0x4e65f000..0x4e65fae8]
         at java.lang.Object.wait(Native Method)
         at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:692)
         - locked <0x1edbfe00> (a java.lang.Object)
    "Inactive RequestProcessor thread [Was:Suggestions Broker/org.netbeans.modules.tasklist.suggestions.SuggestionsBroker$2]" daemon prio=2 tid=0x473e1c80 nid=0x9fc in Object.wait() [0x4b84f000..0x4b84fbe8]
         at java.lang.Object.wait(Native Method)
         at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:692)
         - locked <0x1ed09d38> (a java.lang.Object)
    "Timer-48" prio=7 tid=0x492d4748 nid=0x930 in Object.wait() [0x4e43f000..0x4e43fa68]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at java.util.TimerThread.mainLoop(Timer.java:483)
         - locked <0x1eb90290> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "Timer-46" prio=7 tid=0x4831ede8 nid=0xff0 in Object.wait() [0x4e71f000..0x4e71fae8]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at java.util.TimerThread.mainLoop(Timer.java:483)
         - locked <0x1ea9f428> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "Timer-44" prio=7 tid=0x48b26ab0 nid=0xc50 in Object.wait() [0x4e81f000..0x4e81fb68]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at java.util.TimerThread.mainLoop(Timer.java:483)
         - locked <0x1dc0d688> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "Timer-42" prio=7 tid=0x50f3bb68 nid=0x8f0 in Object.wait() [0x4e7df000..0x4e7dfa68]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at java.util.TimerThread.mainLoop(Timer.java:483)
         - locked <0x1db078b8> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "Timer-40" prio=7 tid=0x48bbde20 nid=0xf0c in Object.wait() [0x4e75f000..0x4e75f9e8]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at java.util.TimerThread.mainLoop(Timer.java:483)
         - locked <0x1d85d2b8> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "Timer-38" prio=7 tid=0x50e67840 nid=0x8a4 in Object.wait() [0x4e6df000..0x4e6dfae8]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at java.util.TimerThread.mainLoop(Timer.java:483)
         - locked <0x1d7bc160> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "Timer-36" prio=7 tid=0x48ba3f50 nid=0xf58 in Object.wait() [0x4e5df000..0x4e5dfd68]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at java.util.TimerThread.mainLoop(Timer.java:483)
         - locked <0x1d7bc1d8> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "Timer-34" prio=7 tid=0x48abb270 nid=0xee8 in Object.wait() [0x4e53f000..0x4e53fb68]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at java.util.TimerThread.mainLoop(Timer.java:483)
         - locked <0x1d339d68> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "Timer-32" prio=7 tid=0x47a6e050 nid=0xe98 in Object.wait() [0x4e69f000..0x4e69fa68]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at java.util.TimerThread.mainLoop(Timer.java:483)
         - locked <0x1b93e2e8> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "Timer-30" prio=7 tid=0x4925bd38 nid=0x9a8 in Object.wait() [0x4e4bf000..0x4e4bfa68]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at java.util.TimerThread.mainLoop(Timer.java:483)
         - locked <0x1b3022f0> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "Timer-28" prio=7 tid=0x4930aae8 nid=0x620 in Object.wait() [0x4b70f000..0x4b70fae8]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at java.util.TimerThread.mainLoop(Timer.java:483)
         - locked <0x1af19770> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "Timer-26" prio=7 tid=0x485620c8 nid=0x120 in Object.wait() [0x4e59f000..0x4e59fb68]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at java.util.TimerThread.mainLoop(Timer.java:483)
         - locked <0x1978f0f8> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "Timer-24" prio=7 tid=0x46d7e9e8 nid=0xaf8 in Object.wait() [0x4e61f000..0x4e61fbe8]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at java.util.TimerThread.mainLoop(Timer.java:483)
         - locked <0x196f19e8> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "VCS Command Tasks Starter Loop" daemon prio=2 tid=0x48aeed00 nid=0x96c in Object.wait() [0x4e4ff000..0x4e4ffbe8]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x18841770> (a org.netbeans.modules.vcscore.commands.CommandProcessor)
         at java.lang.Object.wait(Object.java:474)
         at org.netbeans.modules.vcscore.commands.CommandProcessor.executorStarterLoop(CommandProcessor.java:757)
         - locked <0x18841770> (a org.netbeans.modules.vcscore.commands.CommandProcessor)
         at org.netbeans.modules.vcscore.commands.CommandProcessor.access$700(CommandProcessor.java:65)
         at org.netbeans.modules.vcscore.commands.CommandProcessor$5.run(CommandProcessor.java:776)
         at java.lang.Thread.run(Thread.java:595)
    "Timer-16" prio=7 tid=0x46fa81a8 nid=0x69c in Object.wait() [0x4e3ff000..0x4e3ffd68]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at java.util.TimerThread.mainLoop(Timer.java:483)
         - locked <0x151bf408> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "Timer-12" prio=7 tid=0x479eacf0 nid=0x2ec in Object.wait() [0x4b4df000..0x4b4dfce8]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at java.util.TimerThread.mainLoop(Timer.java:483)
         - locked <0x1499b4e8> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "URLdisplayer" prio=7 tid=0x4865de20 nid=0xe2c in Object.wait() [0x4727f000..0x4727fd68]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x12a02bb0> (a org.netbeans.modules.extbrowser.NbDdeBrowserImpl$URLDisplayer)
         at java.lang.Object.wait(Object.java:474)
         at org.netbeans.modules.extbrowser.NbDdeBrowserImpl$URLDisplayer.getNextTask(NbDdeBrowserImpl.java:223)
         - locked <0x12a02bb0> (a org.netbeans.modules.extbrowser.NbDdeBrowserImpl$URLDisplayer)
         at org.netbeans.modules.extbrowser.NbDdeBrowserImpl$URLDisplayer.run(NbDdeBrowserImpl.java:235)
         at java.lang.Thread.run(Thread.java:595)
    "Text-Layout" prio=2 tid=0x475967e8 nid=0xa68 in Object.wait() [0x4b68f000..0x4b68fae8]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x129e8cd0> (a org.netbeans.editor.view.spi.ViewLayoutQueue)
         at java.lang.Object.wait(Object.java:474)
         at org.netbeans.editor.view.spi.ViewLayoutQueue.waitForTask(ViewLayoutQueue.java:128)
         - locked <0x129e8cd0> (a org.netbeans.editor.view.spi.ViewLayoutQueue)
         at org.netbeans.editor.view.spi.ViewLayoutQueue$LayoutThread.run(ViewLayoutQueue.java:182)
    "MDR event dispatcher" daemon prio=2 tid=0x47b8b450 nid=0x9c8 in Object.wait() [0x4b88f000..0x4b88fa68]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at org.netbeans.mdr.util.EventNotifier$EventsDelivery.run(EventNotifier.java:257)
         - locked <0x087d1b10> (a java.util.LinkedList)
         at java.lang.Thread.run(Thread.java:595)
    "DestroyJavaVM" prio=5 tid=0x00038890 nid=0x4e4 waiting on condition [0x00000000..0x0007fae8]
    "TimerQueue" daemon prio=5 tid=0x46da6908 nid=0x768 in Object.wait() [0x4716f000..0x4716fb68]
         at java.lang.Object.wait(Native Method)
         at javax.swing.TimerQueue.run(TimerQueue.java:233)
         - locked <0x07b22b68> (a javax.swing.TimerQueue)
         at java.lang.Thread.run(Thread.java:595)
    "AWT-EventQueue-1" prio=7 tid=0x46ea8478 nid=0x990 runnable [0x4820e000..0x4820fbe8]
         at java.net.Inet4AddressImpl.getHostByAddr(Native Method)
         at java.net.InetAddress$1.getHostByAddr(InetAddress.java:842)
         at java.net.InetAddress.getHostFromNameService(InetAddress.java:532)
         at java.net.InetAddress.getHostName(InetAddress.java:475)
         at java.net.InetAddress.getHostName(InetAddress.java:447)
         at java.net.InetSocketAddress.getHostName(InetSocketAddress.java:210)
         at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:341)
         at java.net.Socket.connect(Socket.java:507)
         at java.net.Socket.connect(Socket.java:457)
         at java.net.Socket.<init>(Socket.java:365)
         at java.net.Socket.<init>(Socket.java:207)
         at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:142)
         at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:280)
         at com.mysql.jdbc.Connection.createNewIO(Connection.java:1774)
         at com.mysql.jdbc.Connection.<init>(Connection.java:437)
         at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:268)
         at com.sun.rave.sql.DesignTimeDataSource.getConnection(DesignTimeDataSource.java:238)
         at com.sun.rave.sql.DesignTimeDataSource.getConnection(DesignTimeDataSource.java:214)
         at com.sun.sql.rowset.JdbcRowSetXImpl.connect(JdbcRowSetXImpl.java:410)
         at com.sun.sql.rowset.JdbcRowSetXImpl.prepare(JdbcRowSetXImpl.java:532)
         at com.sun.sql.rowset.JdbcRowSetXImpl.execute(JdbcRowSetXImpl.java:349)
         at caico.jsf.svc.itemSvc.<init>(itemSvc.java:81)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
         at java.lang.Class.newInstance0(Class.java:350)
         at java.lang.Class.newInstance(Class.java:303)
         at com.sun.rave.insync.beans.BeansUnit.instantiateBean(BeansUnit.java:884)
         at com.sun.rave.insync.live.LiveUnit.ressurectDesignBean(LiveUnit.java:339)
         at com.sun.rave.insync.live.LiveUnit.resurrect(LiveUnit.java:406)
         at com.sun.rave.insync.live.LiveUnit.sync(LiveUnit.java:294)
         at com.sun.rave.insync.live.LiveUnitWrapper.sync(LiveUnitWrapper.java:115)
         at com.sun.rave.insync.models.FacesModel.syncImpl(FacesModel.java:899)
         at com.sun.rave.insync.Model.sync(Model.java:207)
         at com.sun.rave.insync.Model.sync(Model.java:173)
         at com.sun.rave.insync.ModelSet$WindowManagerPropertyRegistry.processNodes(ModelSet.java:107)
         at com.sun.rave.insync.ModelSet$WindowManagerPropertyRegistry.propertyChange(ModelSet.java:125)
         at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:333)
         at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:270)
         at org.netbeans.core.windows.RegistryImpl.doFirePropertyChange(RegistryImpl.java:249)
         at org.netbeans.core.windows.RegistryImpl.tryFireChanges(RegistryImpl.java:222)
         at org.netbeans.core.windows.RegistryImpl.selectedNodesChanged(RegistryImpl.java:186)
         at org.netbeans.core.windows.RegistryImpl.topComponentActivated(RegistryImpl.java:138)
         at org.netbeans.core.windows.WindowManagerImpl.notifyRegistryTopComponentActivated(WindowManagerImpl.java:893)
         at org.netbeans.core.windows.Central.setActiveMode(Central.java:182)
         at org.netbeans.core.windows.Central.userActivatedMode(Central.java:1451)
         at org.netbeans.core.windows.view.DefaultView.userActivatedModeView(DefaultView.java:591)
         at org.netbeans.core.windows.view.ui.TabbedHandler$ActivationManager.handleActivation(TabbedHandler.java:477)
         at org.netbeans.core.windows.view.ui.TabbedHandler$ActivationManager.eventDispatched(TabbedHandler.java:425)
         at java.awt.Toolkit$SelectiveAWTEventListener.eventDispatched(Toolkit.java:2206)
         at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2100)
         at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2099)
         at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2099)
         at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2099)
         at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2099)
         at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2099)
         at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2099)
         at java.awt.Toolkit$ToolkitEventMulticaster.eventDispatched(Toolkit.java:2099)
         at java.awt.Toolkit.notifyAWTEventListeners(Toolkit.java:2058)
         at java.awt.Component.dispatchEventImpl(Component.java:3867)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3889)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1774)
         at java.awt.Component.dispatchEvent(Component.java:3803)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    "Creator Error Handler Listener" prio=5 tid=0x4665f3d8 nid=0xf70 runnable [0x481cf000..0x481cfce8]
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
         - locked <0x0793baf0> (a java.net.SocksSocketImpl)
         at java.net.ServerSocket.implAccept(ServerSocket.java:450)
         at java.net.ServerSocket.accept(ServerSocket.java:421)
         at com.sun.rave.errorhandler.DebugServerThread.run(DebugServerThread.java:81)
    "Java2D Disposer" daemon prio=10 tid=0x467d6760 nid=0xa08 in Object.wait() [0x46c8f000..0x46c8fce8]
         at java.lang.Object.wait(Native Method)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
         - locked <0x07451380> (a java.lang.ref.ReferenceQueue$Lock)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
         at sun.java2d.Disposer.run(Disposer.java:107)
         at java.lang.Thread.run(Thread.java:595)
    "Active Reference Queue Daemon" daemon prio=2 tid=0x467bb638 nid=0xb70 in Object.wait() [0x46c4f000..0x46c4fd68]
         at java.lang.Object.wait(Native Method)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
         - locked <0x07451408> (a java.lang.ref.ReferenceQueue$Lock)
         at org.openide.util.Utilities$ActiveQueue.run(Utilities.java:2465)
         at java.lang.Thread.run(Thread.java:595)
    "Timer-0" daemon prio=5 tid=0x4678f2f0 nid=0xaf0 in Object.wait() [0x46c0f000..0x46c0f9e8]
         at java.lang.Object.wait(Native Method)
         at java.util.TimerThread.mainLoop(Timer.java:509)
         - locked <0x07451498> (a java.util.TaskQueue)
         at java.util.TimerThread.run(Timer.java:462)
    "AWT-Windows" daemon prio=7 tid=0x467a54a0 nid=0x790 runnable [0x46a6f000..0x46a6fa68]
         at sun.awt.windows.WToolkit.eventLoop(Native Method)
         at sun.awt.windows.WToolkit.run(WToolkit.java:269)
         at java.lang.Thread.run(Thread.java:595)
    "AWT-Shutdown" prio=5 tid=0x467a5008 nid=0xafc in Object.wait() [0x46a2f000..0x46a2fae8]
         at java.lang.Object.wait(Native Method)
         - waiting on <0x07451568> (a java.lang.Object)
         at java.lang.Object.wait(Object.java:474)
         at sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
         - locked <0x07451568> (a java.lang.Object)
         at java.lang.Thread.run(Thread.java:595)
    "CLI Requests Server" daemon prio=5 tid=0x4676b380 nid=0xa64 runnable [0x4693f000..0x4693fbe8]
         at java.net.PlainSocketImpl.socketAccept(Native Method)
         at java.net.PlainSocketImpl.accept(PlainSocketImpl.java:384)
         - locked <0x07451720> (a java.net.SocksSocketImpl)
         at java.net.ServerSocket.implAccept(ServerSocket.java:450)
         at java.net.ServerSocket.accept(ServerSocket.java:421)
         at org.netbeans.CLIHandler$Server.run(CLIHandler.java:758)
    "Low Memory Detector" daemon prio=5 tid=0x00ab83b8 nid=0xee0 runnable [0x00000000..0x00000000]
    "CompilerThread0" daemon prio=10 tid=0x00ab7020 nid=0x9c4 waiting on condition [0x00000000..0x465cfa4c]
    "Signal Dispatcher" daemon prio=10 tid=0x00ab6470 nid=0x31c runnable [0x00000000..0x00000000]
    "Finalizer" daemon prio=9 tid=0x00aa95e0 nid=0x85c in Object.wait() [0x4654f000..0x4654fa68]
         at java.lang.Object.wait(Native Method)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:116)
         - locked <0x074519c0> (a java.lang.ref.ReferenceQueue$Lock)
         at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:132)
         at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
    "Reference Handler" daemon prio=10 tid=0x00aa8150 nid=0xf1c in Object.wait() [0x4650f000..0x4650fae8]
         at java.lang.Object.wait(Native Method)
         at java.lang.Object.wait(Object.java:474)
         at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
         - locked <0x07451590> (a java.lang.ref.Reference$Lock)
    "VM Thread" prio=10 tid=0x00aa5780 nid=0x808 runnable
    "VM Periodic Task Thread" prio=10 tid=0x00ab9858 nid=0x1b0 waiting on condition

    Use a SwingUtilities.invokeLater(...) to invoke the main GUI. This will allow the button to repaint itself before the main GUI is invoked.

  • Calling getAppletContext() from a working thread.

    Hi guys,
    I'm new to Java so all apologies if I'm asking a stupied question.
    I have a simple applet that creates a working thread and I'm tring to call getAppletContext() from that thread.
    Obviously my working thread has no instance of the Applet class so it fails.
    I've try to create an instance of Applet, but I'm getting an error saying that the applet is not initialised.
    This is my code:
    class MyThread extends Thread
        String ThreadName;
        public MyThread(String threadName)
            ThreadName = threadName;
        @Override public void run()
            // ??? How to make the following line work ???
            getAppletContext().showDocument(new URL("javascript:alert(\"Calling from myThread\")"));
    public class MyApplet extends Applet {
         public void init()
            // The following line works!
            getAppletContext().showDocument(new URL("javascript:alert(\"Calling from MyApplet)"));
            Thread WorkingThread = new MyThread("Thread1");                                                                
            WorkingThread.start();
    }{code}
    Please help,
    Many thanks!
    Salvador                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Got it.
    I needed to pass the keyword this to the thread constructor and then use that....
    Many thanks!

  • IOP00710309: (INTERNAL) Worker thread Thread[p: default-threadpool; w: Idle,5,ORB ThreadGroup 0] caught throwable com.sun.corba.se.impl.orbutil.threadpool

    Hi ,
    I am seeing this issue while starting my managed server.
    com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread run
    FINE: "IOP00710309: (INTERNAL) Worker thread Thread[p: default-threadpool; w: Idle,5,ORB ThreadGroup 0] caught throwable com.sun.corba.se.impl.orbutil.threadpool.TimeoutException when requesting work from work queue default-workqueue."
    org.omg.CORBA.INTERNAL:   vmcid: SUN  minor code: 309  completed: No
            at com.sun.corba.se.impl.logging.ORBUtilSystemException.workerThreadThrowableFromRequestWork(ORBUtilSystemException.java:6330)
            at com.sun.corba.se.impl.logging.ORBUtilSystemException.workerThreadThrowableFromRequestWork(ORBUtilSystemException.java:6355)
            at com.sun.corba.se.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:494
    I have searched the net for this but didnt find any resolution. Please help.
    Regards,
    Rishi

    This became bug 6560301. And Sun pointed out that it was my bad in not handling spurious wakeups. Java 6 makes spurious wakeups more likely. (My experience is from "never" to "sometimes".)
    More info at:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6560301

  • Processing requests in a separate worker thread created inside a servlet.

    Scenario:
    We have an action that needs to be initiated by a servlet, but will take some time to accomplish and so the servlet should just hand it off to a separate thread for actual processing, and the servlet should just respond immediately with a redirect to a JSP page that outputs a simple message saying the action has been initiated and current date and time.
    Task:
    So, create a servlet that accepts a parameter in the request (both POST and GET requests should be supported) and set up a separate worker thread (set one up in the init() method of the servlet) that it will hand off requests to. The servlet will call into the worker thread passing it the parameter value which will be put on the worker thread's queue.
    The worker thread should stay asleep until it receives requests. Any requests will wake up the worker thread which will then process it's queue. The action would be a long running process, but for this test, it will just be to log a message to System.out including the parameter value and the current timestamp.
    Please ensure that concurrency issues are handled correctly.

    I'll get right on that.
    Give me your professor's email address and I'll even send it directly to him. You won't have to lift a finger.
    Krum

  • Worker thread not quite working

    I had the standard 'waiting for a database' gray box problem. So I put my db calls into a worker thread. It was impractical to use the WorkerThread class that Sun distributes, so I wrote my own (see below). This solved the problem in most but not all cases.
    In some situations, the user is looking at one window that overlaps another. When a button on the top window is pushed, the top window is dispose()'d of, and the worker thread is started. In this situation, the gray box problems rears its ugly head, despite the use of the worker thread.
    Could that dispose() be causing the problem? Do I need to repaint the remaing window before calling the worker? If so, what command should I use? repaint()? setVisible(true)?
    Any thoughts or suggestions would be appreciated.
    Barnet Wagman
    My worker thread code:
    public class BossClass {  // The worker thread is an inner class of this one
            // The following fields get used by the worker thread;
            // could this be a problem? I don't think so.
        private transient byte outcome;
        private transient Object resultObject;
        private transient URL url;
        private transient Thread mainThread;
        private transient boolean allDone;
            // Sends a command to a server and gets a returned object
        public synchronized void send(URL url) throws IOException {
            // ^ I've tried this with and without the synchronized - no difference
         this.url = url;
         mainThread = Thread.currentThread();
         allDone = false;
         new SendThread();
         while( !allDone ) {
             try { Thread.sleep(mnemonaface.Constants.SEND_OP_SLEEP_TIME); }
                        // I've tried the sleep time = 100, 500, 1000 milliseconds
             catch( InterruptedException ix ) {}
        class SendThread implements Runnable, Serializable {
         SendThread() {
             (new Thread(SendThread.this)).start();
         public void run() {
                URLConnection uc = url.openConnection();   
                // Various things get done with the url connection
                allDone = true;
    }

    Instead of your method and inner class try this :
    public void sendURL(URL url) {
         this.url = url;
         Runnable sender = new Runnable() {
              public void run() {
                   URLConnection uc = url.openConnection();
         SwingUtilities.invokeLater(sender);
    }I hope this helps,
    Denis

  • NullPointerException in BasicTableUI - Table updated in Swing worker thread

    I am getting following exception while updating a table :-
    java.lang.NullPointerException
    at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1141)
    at javax.swing.plaf.basic.BasicTableUI.paintCell(BasicTableUI.java:1051)
    at javax.swing.plaf.basic.BasicTableUI.paint(BasicTableUI.java:974)
    at javax.swing.plaf.ComponentUI.update(ComponentUI.java:142)
    at javax.swing.JComponent.paintComponent(JComponent.java:541)
    at javax.swing.JComponent.paint(JComponent.java:808)
    at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4771)
    at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4724)
    at javax.swing.JComponent._paintImmediately(JComponent.java:4668)
    at javax.swing.JComponent.paintImmediately(JComponent.java:4477)
    at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:410)
    at javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run (SystemEventQueueUtilities.java:117)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:178)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:448)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy (EventDispatchThread.java:197)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy
    (EventDispatchThread.java:150)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:144)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:136)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:99)
    Since swing is not thread safe the table is updated in a swing worker thread. This should ensure that all gui updates are scheduled in the main event dispatching thread. Following is that code :-
    SwingWorker sw = new SwingWorker() {
    public Object construct()
    try{
    _myTable.updateUI();
    return null;
    }catch(Exception e){
    return null;
    public void finished(){
    sw.start();
    Inspite of doing these i am getting these exceptions.

    try using javax.swing.SwingUtilities.invokeLater(Runnable doRun)

Maybe you are looking for

  • Next button not working properly?

    Hi, I'm new to the user groups, and only an occasional user of Captivate.  I'm building an e-learning course, and I have inserted next buttons on each page to let the user control navigation.  However, the slides still auto play without clicking next

  • SAP ECC 6.0 and BW 3.1

    Hi, We are going to an upgrade from SAP 4.6C to ECC 6.0, and we are going to leave the BW in 3.1. There is any problem? Does the BW needs also an upgrade? Can you help me on this mather. Kind regards, Nuno Silva

  • Setting up campaign planning in DS Planning Board

    Hi We currently have SAP EC6 and am looking at how campaign planning might be of benefit. WE do not have APO so arer looking at the basic functionality. Does naybody know wherer I could get a configuration manual that would step through how to set it

  • Exception in oran9.dll and oranl9.dll

    Hi all, i am using windows 2000 server with oracle 9i r2 and using occi for connecting to oracle, sometimes it is working but sometimes i am getting exception from oran9.dll or oranl9.dll.                env = Environment::createEnvironment (Environm

  • VB Script won't run

    I'm having an issue with an application that uses a VBscript to install and hope someone can help me. It will work fine regardless where I put if you double click it, it will also work fine from a batch file if you double click the batch. It will not