Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #32265 > unrolled thread

Eclipse RCP application: USB print hang

Started byv_borchert@despammed.com (Volker Borchert)
First post2015-08-06 20:19 +0000
Last post2015-08-08 14:05 +0000
Articles 7 — 4 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Eclipse RCP application: USB print hang v_borchert@despammed.com (Volker Borchert) - 2015-08-06 20:19 +0000
    Re: Eclipse RCP application: USB print hang Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-06 21:35 +0000
      Re: Eclipse RCP application: USB print hang v_borchert@despammed.com (Volker Borchert) - 2015-08-07 04:10 +0000
        Re: Eclipse RCP application: USB print hang Martin Gregorie <martin@address-in-sig.invalid> - 2015-08-07 10:00 +0000
        Re: Eclipse RCP application: USB print hang Jeff Higgins <jeff@invalid.invalid> - 2015-08-07 09:01 -0400
    Workaround found (was: Re: Eclipse RCP application: USB print hang) v_borchert@despammed.com (Volker Borchert) - 2015-08-07 22:30 +0000
      Re: Workaround found (was: Re: Eclipse RCP application: USB print hang) Andreas Leitgeb <avl@auth.logic.tuwien.ac.at> - 2015-08-08 14:05 +0000

#32265 — Eclipse RCP application: USB print hang

Fromv_borchert@despammed.com (Volker Borchert)
Date2015-08-06 20:19 +0000
SubjectEclipse RCP application: USB print hang
Message-ID<mq0fh1$dht$1@Gaia.teknon.de>
Using SWT 3.7.x, PaperClips, JRE 1.8.x, Windows 7 in VirtualBox on Linux,
HP USP laser printer.

Power on printer, wait until in powersave.
Start virtual Windows.
Start RCP application.
Try to let the application print something.
Printing hangs in native StartDocW GDI API function.
Printing works after opening the printer setup/properties dialog,
         even if cancelled immediately.
Printing from e.g. WordPad instead, works.

bugs.eclipse.org yielded nothing.

Any ideas?

-- 

"I'm a doctor, not a mechanic." Dr Leonard McCoy <mccoy@ncc1701.starfleet.fed>
"I'm a mechanic, not a doctor." Volker Borchert  <v_borchert@despammed.com>

[toc] | [next] | [standalone]


#32266

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2015-08-06 21:35 +0000
Message-ID<mq0jvh$ldg$1@dont-email.me>
In reply to#32265
On Thu, 06 Aug 2015 20:19:45 +0000, Volker Borchert wrote:

> Power on printer, wait until in powersave.
> Start virtual Windows.
> Start RCP application.
> Try to let the application print something.
> Printing hangs in native StartDocW GDI API function.
> Printing works after opening the printer setup/properties dialog,
>          even if cancelled immediately.
> Printing from e.g. WordPad instead, works.
>
I don't use virtualbox, so apologies in advance if any of these are 
stupid suggestions, but these are the things I'd look at:

- How does virtualbox connect to the printer, i.e.
  - is it talking direct to the printer via a network interface?
  - if its connecting via the Linux spooler, is it using IPP or
    is it piping the printfile through lpr?

- What happens if you don't wait for the printer to go into powersave? 

- does printing from Wordpad still work if that's the first thing you
  do after starting Windows in virtualbox?

- does the problem occur if you print from a Java 1.8 app running
  directly under Linux?

I use an old LaserJet 5, with a parallel port and an Emulex NETjet card 
listening on port 2501 and connected to a Linux box running Fedora 22 via 
a parallel port. This works without any problems.

However, talking to the LJ5 from this laptop (also running Fedora 22) 
doesn't currently work regardless of whether I try to use the NetJet card 
or to send printfiles via the other host's spooler. In the past both 
methods worked from this laptop, but since upgrading to F22 it hasn't 
worked and I haven't made the time / got annoyed enough to give it some 
attention because SCPing the file to other host and printing from there 
does the job.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#32273

Fromv_borchert@despammed.com (Volker Borchert)
Date2015-08-07 04:10 +0000
Message-ID<mq1b4j$kb8$1@Gaia.teknon.de>
In reply to#32266
Martin Gregorie wrote:

> - How does virtualbox connect to the printer, i.e.
>   - is it talking direct to the printer via a network interface?
>   - if its connecting via the Linux spooler, is it using IPP or
>     is it piping the printfile through lpr?

Might indeed be worth looking into. But then, why does it work
from Wordpad?

> - What happens if you don't wait for the printer to go into powersave? 

Works.

> - does printing from Wordpad still work if that's the first thing you
>   do after starting Windows in virtualbox?

Works.

> - does the problem occur if you print from a Java 1.8 app running
>   directly under Linux?

Would need to write such an app, the one in question uses Windows
specific native libraries, and the problem just surfaced these days...

-- 

"I'm a doctor, not a mechanic." Dr Leonard McCoy <mccoy@ncc1701.starfleet.fed>
"I'm a mechanic, not a doctor." Volker Borchert  <v_borchert@despammed.com>

[toc] | [prev] | [next] | [standalone]


#32274

FromMartin Gregorie <martin@address-in-sig.invalid>
Date2015-08-07 10:00 +0000
Message-ID<mq1vkh$ivp$1@dont-email.me>
In reply to#32273
On Fri, 07 Aug 2015 04:10:59 +0000, Volker Borchert wrote:

> Martin Gregorie wrote:
> 
>> - How does virtualbox connect to the printer, i.e.
>>   - is it talking direct to the printer via a network interface?
>>   - if its connecting via the Linux spooler, is it using IPP or
>>     is it piping the printfile through lpr?
> 
> Might indeed be worth looking into. But then, why does it work from
> Wordpad?
>
Ok, just checking: I take it that printing from Wordpad does wake the 
printer from powersave.

If that's the case it follows that Wordpad and the JVM must either:
1) use different virtualbox APIs for printing
2) use the same API but with some different parameter settings

> Would need to write such an app, the one in question uses Windows
> specific native libraries, and the problem just surfaced these days...
>
Looks like that might be unnecessary. I was suggesting ways to find 
differences in the path connecting an application running in virtualbox 
to the printer and to get some idea of where the differences are located. 

If Java can't wake the printer from powersave but Wordpad can, that tends 
to show there are at least two ways for an application to connect to a 
printer within virtualbox[1]. At this point I'd have a scout round 
https://www.virtualbox.org/ and, if I couldn't find anything there, ask 
the devs if they've run into this and/or can suggest a way of debugging 
printer start-up.

[1] that wouldn't surprise me: historically printer handling has been 
something of an afterthought under MS operating systems.


-- 
martin@   | Martin Gregorie
gregorie. | Essex, UK
org       |

[toc] | [prev] | [next] | [standalone]


#32275

FromJeff Higgins <jeff@invalid.invalid>
Date2015-08-07 09:01 -0400
Message-ID<mq2a3o$trr$1@dont-email.me>
In reply to#32273
On 08/07/2015 12:10 AM, Volker Borchert wrote:
> Martin Gregorie wrote:
>
>> - How does virtualbox connect to the printer, i.e.
>>    - is it talking direct to the printer via a network interface?
>>    - if its connecting via the Linux spooler, is it using IPP or
>>      is it piping the printfile through lpr?
>
> Might indeed be worth looking into. But then, why does it work
> from Wordpad?
>
>> - What happens if you don't wait for the printer to go into powersave?
>
> Works.
>
>> - does printing from Wordpad still work if that's the first thing you
>>    do after starting Windows in virtualbox?
>
> Works.
>
>> - does the problem occur if you print from a Java 1.8 app running
>>    directly under Linux?
>
> Would need to write such an app, the one in question uses Windows
> specific native libraries, and the problem just surfaced these days...
>

 From Paperclips project, Snippet7.java

<https://eclipse.org/nebula/widgets/paperclips/paperclips.php>

<https://github.com/eclipse/nebula/blob/master/widgets/paperclips/org.eclipse.nebula.paperclips.snippets/src/org/eclipse/nebula/paperclips/snippets/Snippet7.java>

[toc] | [prev] | [next] | [standalone]


#32277 — Workaround found (was: Re: Eclipse RCP application: USB print hang)

Fromv_borchert@despammed.com (Volker Borchert)
Date2015-08-07 22:30 +0000
SubjectWorkaround found (was: Re: Eclipse RCP application: USB print hang)
Message-ID<mq3bhq$7eq$1@Gaia.teknon.de>
In reply to#32265
In comp.lang.java.programmer, Volker Borchert wrote:
> 
> Using SWT 3.7.x, PaperClips, JRE 1.8.x, Windows 7 in VirtualBox on Linux,
> HP USP laser printer.
> 
> Power on printer, wait until in powersave.
> Start virtual Windows.
> Start RCP application.
> Try to let the application print something.
> Printing hangs in native StartDocW GDI API function.
> Printing works after opening the printer setup/properties dialog,
>          even if cancelled immediately.
> Printing from e.g. WordPad instead, works.

Colleague accidentally hit the "Properties" button in the printer
selection dialog, and even though he cancelled that immediately,
printing then worked.

So I added half a line of code that eventually calls GetDeviceCaps,
and this seems sufficient to kick the printer sufficiently awake.

I don't think this is a solution, but as a workaround, it'll do.

-- 

"I'm a doctor, not a mechanic." Dr Leonard McCoy <mccoy@ncc1701.starfleet.fed>
"I'm a mechanic, not a doctor." Volker Borchert  <v_borchert@despammed.com>

[toc] | [prev] | [next] | [standalone]


#32283 — Re: Workaround found (was: Re: Eclipse RCP application: USB print hang)

FromAndreas Leitgeb <avl@auth.logic.tuwien.ac.at>
Date2015-08-08 14:05 +0000
SubjectRe: Workaround found (was: Re: Eclipse RCP application: USB print hang)
Message-ID<slrnmsc38k.uoi.avl@login.logic.tuwien.ac.at>
In reply to#32277
Volker Borchert <v_borchert@despammed.com> wrote:
> In comp.lang.java.programmer, Volker Borchert wrote:
>> Printing hangs in native StartDocW GDI API function.
>> Printing works after opening the printer setup/properties dialog,
>>          even if cancelled immediately.
>> Printing from e.g. WordPad instead, works.
> So I added half a line of code that eventually calls GetDeviceCaps,
> and this seems sufficient to kick the printer sufficiently awake.

Just out of curiosity... do any leds or other displays on the printer
reflect this "waking up" when opening (and cancelling) the properties?

Another test: from within Windows open the properties dialog, cancel
it, then wait until printer goes back to sleep, then print.  If it
hangs again, then the printer just needs it, otherwise, if it then
wakes up and prints just fine, then some driver is broken.

> I don't think this is a solution, but as a workaround, it'll do.

Depending on result of above test, it might be just the right
workaround for either a bug in the printer or in the driver.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web