Apache OpenOffice (AOO) Bugzilla – Issue 71439
com.sun.star.scanner.ScannerManager makes OOo to hang up from a BeanShell script
Last modified: 2017-05-20 11:27:34 UTC
I'm facing some serious problems when trying to use the ScannerManager service from a BeanShell script (inside OOo Draw). Maybe a reproducible deadlock situation. OOo version: stable, 2.0.4 (english version OOo, WinXP Prof SP2 Hun) OOo SDK: stable, 2.0.4 I have a Logitech QuickCam Sphere webcam (driver version 9.5). As I acquire an image from Insert/Picture/Scan/Request, the image is taken and inserted into the drawing. As I try to achieve the same result from a BeanShell script (attached), OOo hangs up upon ScannerManager.startScan(...) call. Details follows: What I want is to replace an image object (having name prefix of "photofield_") in my OOo draw document in script-runtime. The script I wrote is attached, but it does not work. As I open a draw that have an image object named like "photofield_" and try to run the script, I can select the source (xScannerManager.configureScanner(...)). After the selection is made, the startScan(...) call makes OOo to hang up. It can be killed using the task manager, but after restarting OOo (but not the OS), the menu-path (Insert/Picture/Scan/Request) also does not work. Upgrading the Logitech webcam driver to v10 did not solve the problem. The same behavior holds using a Canyon CNCAM21 webcam.
Created attachment 40508 [details] the referenced script that makes OOo to hang up deterministic upon ScannerManager.startScan(...) call
jsc -> ka: cl told me that you are the expert for the scanner API, i assume a threading problem in the context of the beanshell ...
Created attachment 42202 [details] Java program trying to utilize the scanner API
The attached PatronCard.java produces the same effect as the previously submitted BeanShell script: makes OOo to hang up at the startScan call. Additionally, when I try to wait for the scan to finish with the o.wait() call at line 127, IllegalMonitorStateException is thrown. It seems for me that the scanning thread dies (the scanner GUI disappears) and the provided disposing method never gets called. stack trace as follows: java.lang.IllegalMonitorStateException at java.lang.Object.wait(Native Method) at java.lang.Object.wait(Object.java:485) at hu.bute.vzqixx.PatronCard.PatronCard.main(PatronCard.java:127)
ka->jmarton: can you still reproduce this behavior with a current release of OOo? Please reassign to me, if you still can.
worksfor me -< closed
Created attachment 70913 [details] new ScannerTest Java program
jmarton->ka: the problem still persist using OpenOffice.org 3.2.1 (OOO320m19, Build: 9505). I've attached a somewhat polished ScannerTest.java source to this issue which supersedes previous test programs. The scanner (webcam) GUI pops up upon the startScan call, but it disappears and XEventListener.disposing() never gets called, so o.wait() never returns. after killing the ScannerTest process, soffice.bin need also to be killed through process explorer as it seems to hang up.
Reset assigne to the default "issues@openoffice.apache.org".