Thursday, July 5, 2012

Swing UI Thread exception

What I am doing is that, when I get the params from user, I am initializing those params using constructuors on my class. and running a thread on my class. When I debug I am getting the below exception. I guess it is not stopping for the entire process to execute. I am new to GWT, can anybody let me know how can I do that.

Code

Thread thread = new Thread(new ExportData(param 1, param 2));
thread.start();

I have run method which will be executed based on the params.


Exception

java.lang.RuntimeException: Error running on Swing UI thread
at com.google.gwt.dev.SwingUI.invokeAndWait(SwingUI.java:401)
at com.google.gwt.dev.SwingUI.initialize(SwingUI.java:245)
at com.google.gwt.dev.DevModeBase.doStartup(DevModeBase.java:889)
at com.google.gwt.dev.DevMode.doStartup(DevMode.java:424)
at com.google.gwt.junit.JUnitShell.doStartup(JUnitShell.java:932)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1058)
at com.google.gwt.junit.JUnitShell.getUnitTestShell(JUnitShell.java:708)
at com.google.gwt.junit.JUnitShell.runTest(JUnitShell.java:653)
at com.google.gwt.junit.client.GWTTestCase.runTest(GWTTestCase.java:441)
at junit.framework.TestCase.runBare(TestCase.java:134)
at junit.framework.TestResult$1.protect(TestResult.java:110)
at junit.framework.TestResult.runProtected(TestResult.java:128)
at junit.framework.TestResult.run(TestResult.java:113)
at junit.framework.TestCase.run(TestCase.java:124)
at com.google.gwt.junit.client.GWTTestCase.run(GWTTestCase.java:296)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at junit.framework.TestSuite.runTest(TestSuite.java:232)
at junit.framework.TestSuite.run(TestSuite.java:227)
at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.lang.reflect.InvocationTargetException
at java.awt.EventQueue.invokeAndWait(EventQueue.java:1055)
at com.google.gwt.dev.SwingUI.invokeAndWait(SwingUI.java:397)
... 25 more
Caused by: java.lang.NullPointerException
at com.google.gwt.dev.SwingUI.loadImageIcon(SwingUI.java:142)
at com.google.gwt.dev.SwingUI.loadImageIcon(SwingUI.java:124)
at com.google.gwt.dev.SwingUI$3.run(SwingUI.java:247)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:646)
at java.awt.EventQueue.access$000(EventQueue.java:84)
at java.awt.EventQueue$1.run(EventQueue.java:607)
at java.awt.EventQueue$1.run(EventQueue.java:605)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:616)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-web-toolkit/-/iKK0NrUI_0IJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment