Mailingliste - Einträge 2006


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [qftestJUI] Command line arguments qfTest - help


  • Subject: Re: [qftestJUI] Command line arguments qfTest - help
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: 20 Oct 2006 10:38:51 +0200

Hello Marko,

thanks for the dump, there we have the source of the problem: Your app
is calling Swing methods from outside the event dispatch thread.
Please see

http://java.sun.com/docs/books/tutorial/uiswing/misc/threads.html

for more information about Swing not being thread-safe, including the
note that even initializing components before bringing up the frame is
no longer deemed safe (in fact, it never was).

In your case, look at the following two threads:

"AWT-EventQueue-1" prio=6 tid=0x02ecfb60 nid=0xd3c waiting for monitor entry [0x03d6e000..0x03d6f9e8]
	at java.awt.Container.getComponent(Unknown Source)
	- waiting to lock <0x09d714b8> (a java.awt.Component$AWTTreeLock)
	at de.qfs.lib.gui.AWTTreeAdapter.getChildNode(AWTTreeAdapter.java:179)

"main" prio=6 tid=0x003a6e60 nid=0x6b8 in Object.wait() [0x0006f000..0x0006fc0c]
	at java.lang.Object.wait(Native Method)
	- waiting on <0x0ab2b998> (a java.awt.EventQueue$1AWTInvocationLock)
	at java.lang.Object.wait(Unknown Source)
	at java.awt.EventQueue.invokeAndWait(Unknown Source)
	- locked <0x0ab2b998> (a java.awt.EventQueue$1AWTInvocationLock)
	at javax.swing.SwingUtilities.invokeAndWait(Unknown Source)
	at de.qfs.lib.gui.SwingUtil.invokeAndWait(SwingUtil.java:182)
	at de.qfs.apps.qftest.client.Tracker.getMenuParent(Tracker.java:528)
	at de.qfs.apps.qftest.client.Tracker.verifyState(Tracker.java:2661)
	at de.qfs.apps.qftest.client.Tracker.componentAdded(Tracker.java:1911)
	at java.awt.AWTEventMulticaster.componentAdded(Unknown Source)
	at java.awt.Container.processContainerEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.Container.addImpl(Unknown Source)
	- locked <0x09d714b8> (a java.awt.Component$AWTTreeLock)
	at java.awt.Container.add(Unknown Source)
	at javax.swing.JMenuBar.add(Unknown Source)
	at com.hp.ov.cadm.wpf.ovstartframe.OVStartFrame.initMenus(OVStartFrame.java:1161)
	at com.hp.ov.cadm.wpf.ovstartframe.OVStartFrame.init(OVStartFrame.java:509)
	at com.hp.ov.cadm.wpf.ovstartframe.OVStartFrame.loadStartFrame(OVStartFrame.java:1804)
	at com.hp.ov.cadm.wpf.ovstartframe.OVStartFrame$ConnectionListener.onConnect(OVStartFrame.java:10899)
	at com.hp.ov.cadm.wpf.ovstartframe.OVStartFrame.loadStartFrame(OVStartFrame.java:1804)
	at com.hp.ov.cadm.wpf.ovstartframe.OVStartFrame$ConnectionListener.onConnect(OVStartFrame.java:10899)
        [...]

As you can see, the main thread holds the AWT tree lock, thus blocking
the event dispatch thread. The natural fix is to modify the onConnect
method to wrap the call of OVStartFrame.loadStartFrame into
SwingUtilities.invokeAndWait

And just in case you're about to complain "But this doesn't happen
without QF-Test..." :-) : The deadlock can happen outside of QF-Test
as well, it's just not likely. It's a bug in your app that QF-Test
uncovered because it exercises the app's event dispatch thread much
more than a user.

Best regards,
    Greg

"Marko Trebovsek" <Marko.Trebovsek@?.com> writes:

> Hello Gregor,
> 
> I'm sending you dump.txt file, created as described.
> 
> Now I'm 99% shure that my configuration is wrigth :)
> Again, here is my config in qft:
> Class name: com.hp.ov.cadm.wpf.ovstartframe.OVStartFrame    -> my boss
> told me, that this is main class... :)
> Parameters: 
> Executable:
> - -DStatusCalculationTutorial=repo\locales\1033\serviceEditor.chm
> - -Xmx500m
> - -cp
> - lib\classloader.jar
> - com.hp.startup.Bootstrap -> suppose to be class for some verification
> and loading some files, so it's not main class...
> Class:
> c:\Program Files\Hewlett-Packard\OpenView\service configuration
> client\user_settings.xml
> 
> But even with out parameter user_setting.xml as a class parameter,
> application is started and loaded in command line. So user_setting.xml
> is not required. But even with out it dosen't work in qft.
> 
> Class com.hp.startup.Bootstrap is used for check for some files needed
> for loading the application and by words of my boss (again :)), the
> problem is not with this class, because it would not load as far as it
> does (approximately 50%).
> 
> So there must defenitly be a deadlock. Hope it is solvable.
> Thank you again.
> 
> Best regards, 
> Marko
>  
> 
> -----Original Message-----
> From: Gregor Schmid [mailto:Gregor.Schmid@?.de] 
> Sent: Friday, October 20, 2006 8:55 AM
> To: qftestJUI-list@?.de
> Cc: Marko Trebovsek
> Subject: Re: [qftestJUI] Command line arguments qfTest - help
> 
> 
> Hello Marko,
> 
> that sounds like a deadlock. Most likely some GUI relevant code in
> your application is not executed on the Event Dispatch Thread.
> 
> To find out, please trigger a thread dump using the "Create thread
> dump" menu item below QF-Test's "Clients" menu, then press Ctrl-T to
> the SUT specific terminal, save its contents and send them to us.
> 
> Best regards,
>     Greg
> 
> "Marko Trebovsek" <Marko.Trebovsek@?.com> writes:
> 
> > Thank you Gregor, for quick response
> > 
> > I did as you wrote, but my appl wouldn't start... I mean it starts,
> but
> > is stops loading on e.g 50% and stays there. 
> > 
> > Than I also modified the settings:
> > - class name: com.hp.startup.Bootstrap
> > - parameter table for the class:
> > com.hp.ov.cadm.wpf.ovstartframe.OVStartFrame
> > 	user_settings.xml
> > 
> > No success... as if my appl is waiting for something?
> > 
> > Than again i tried to run appl in command line, and it starts fine.
> > 
> > I am desperate! Is there maybe some other settings I forgot to set?
> > 
> > 
> > Thanks in advance!
> > Best regards,
> > Marko
> > 
> > 
> > 
> > -----Original Message-----
> > From: Gregor Schmid [mailto:Gregor.Schmid@?.de] 
> > Sent: Thursday, October 19, 2006 4:00 PM
> > To: qftestJUI-list@?.de
> > Cc: Marko Trebovsek
> > Subject: Re: [qftestJUI] Command line arguments qfTest - help
> > 
> > 
> > Hello Marko,
> > 
> > to start your application directly with its Java command instead of
> > through a script or batch file, make sure you use a "Start Java SUT"
> > client node and set everything as you described, except:
> > 
> > - set the "Class name" attribute to com.hp.startup.Bootstrap
> > 
> > - remove the user_settings.xml from the Parameters table for the
> >   executable and put it into the Parameters table for the class.
> > 
> > Best regards,
> >     Greg
> > 
> > "Marko Trebovsek" <Marko.Trebovsek@?.com> writes:
> > 
> > >    Helou!
> > > 
> > > 
> > >    I have a problem regarding command line argument:
> > > 
> > >    I'm trying to start the application in QFTestJUI. Normaly the
> > >    application is started in command line with command:
> > > 
> > >    java
> > -DStatusCalculationTutorial=repo\locales\1033\serviceEditor.chm
> > >    -cp lib\classloader.jar com.hp.startup.Bootstrap
> > >    com.hp.ov.cadm.wpf.ovstartframe.OVStartFrame user_settings.xml
> > > 
> > > 
> > >    I have set parameters as follows:
> > > 
> > > 
> > >    Dir: C:/Program Files/Hewlett-Packard/OpenView/service
> > configuration
> > >    client/    in this dir the abowe command is working fine
> > > 
> > >    Class name: com.hp.ov.cadm.wpf.ovstartframe.OVStartFrame
> > > 
> > >    Executable parameters:
> > > 
> > >    -
> > >    -DStatusCalculationTutorial=repo\locales\1033\serviceEditor.chm
> > > 
> > >    -          -cp
> > > 
> > >    -          lib\classloader.jar
> > > 
> > >    -          com.hp.startup.Bootstrap
> > > 
> > >    -          user_settings.xml
> > > 
> > > 
> > >    As I try to run this configuration, exception is thrown in
> > terminal:
> > > 
> > >    Exception during startup processing
> > > 
> > >    java.lang.ClassNotFoundException: user_settings.xml.
> > > 
> > > 
> > >    So if figured it out, that the problem is in user_settings
> > parameter.
> > > 
> > >    What should I do, how should I set this parameter ?
> > > 
> > > 
> > >    Thanks in advance!
> 
> -- 
> Gregor Schmid                                Gregor.Schmid@?.de
> Quality First Software GmbH                     http://www.qfs.de
> Tulpenstr. 41                                Tel: +49 8171 919870
> DE-82538 Geretsried                          Fax: +49 8171 919876
> 
> _______________________________________________
> qftestJUI-list mailing list
> qftestJUI-list@?.de
> http://www.qfs.de/mailman/listinfo/qftestjui-list

-- 
Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                                Tel: +49 8171 919870
DE-82538 Geretsried                          Fax: +49 8171 919876


Videos Downloads Dokumentation Kaufen Gratis Testen