Cannot print on a USB printer with Java PrintService in Windows 2000. Why?

I want to print a simple ASCII file on a USB printer under Win2K and
found 2 problems. Here is the 2nd one.
Even though
PrintServiceLookup.lookupPrintServices(<DocFlavor>, <AttributeSet>)
returns nothing when I specify any AttributeSet, I can still print on the default printer, which I get by
PrintService defServicedefService = PrintServiceLookup.lookupDefaultPrintService();
but only on a parallel printer (HP Laserjet 4 Plus), either directly attached or over the network. When I try the very same code on a locally USB-attached printer, the printer is obviously reacting, but nothing is printed.
In case of a Lexmark 730 (an ink printer), the driver even lies, it has printed 100%,
on a Samsung CLP-510 (a color laser) the ready light flashes twice, that's all.
The file to be printed has 5 lines and a "0C"X at the end in order to force a page eject at the end.
I tried it with JDK 1.4.2 and with Java 6, same problem.
I should mention that I can print that little file out of the editor Textpad without any problem.

Thanks a lot for the quick hint, but it did not help.
I used BasicPrint.java and PrintJobWatcher.java of the samples for testing.
Printing a GIF file works both to a parallel printer and a USB printer.
Then I changed only the DocFlavor from DocFlavor.INPUT_STREAM.GIF to DocFlavor.INPUT_STREAM.AUTOSENSE, and that one works with my parallel printer, but on the USB printer the Ready light flashes twice, that's all.
The ASCII file must have a "0C"X at the end to force a page eject on the parallel printer
Maybe it is a matter of the DocFlavor, but which one?
DocFlavor("application/octet-stream", "java.io.InputStream") works like DocFlavor.INPUT_STREAM.AUTOSENSE.
DocFlavor.INPUT_STREAM.TEXT_PLAIN_HOST and DocFlavor.INPUT_STREAM.TEXT_HTML_US_ASCII cause sun.print.PrintJobFlavorException, and with DocFlavor.INPUT_STREAM.TEXT_PLAIN_US_ASCII just nothing happens on either printer, not even an error message.
I am getting the impression that nobody of the developers ever cared for testing such a simple thing as a plain ASCII file under Windows.
My printers I am using for the tests are
1. an old parallel-attached HP Laserjet 4 Plus and
2. a borrowed USB-attached Samsung CLP-510 color laser

Similar Messages

  • Cannot print on a USB printer with Java PrintService in Windows 2000

    I want to print a simple ASCII file on a USB printer under Win2K and
    found 2 problems. Here is the 2nd one.
    Even though
    PrintServiceLookup.lookupPrintServices(<DocFlavor>, <AttributeSet>)
    returns nothing when I specify any AttributeSet, I can still print on the default printer, which I get by
    PrintService defServicedefService = PrintServiceLookup.lookupDefaultPrintService();
    but only on a parallel printer (HP Laserjet 4 Plus), either directly attached or over the network. When I try the very same code on a locally USB-attached printer, the printer is obviously reacting, but nothing is printed.
    In case of a Lexmark 730 (an ink printer), the driver even lies, it has printed 100%,
    on a Samsung CLP-510 (a color laser) the ready light flashes twice, that's all.
    The file to be printed has 5 lines and a "0C"X at the end in order to force a page eject at the end.
    I tried it with JDK 1.4.2 and with Java 6, same problem.
    I should mention that I can print that little file out of the editor Textpad without any problem.
    Edited by: eSchobbert on Jan 24, 2008 11:34 AM
    By mistake I entered the same message another time after modifying the Subject instead of replacing the message. Sorry for that. If I knew how to delete it, I would. So please just ignore this one

    Thanks a lot for the quick hint, but it did not help.
    I used BasicPrint.java and PrintJobWatcher.java of the samples for testing.
    Printing a GIF file works both to a parallel printer and a USB printer.
    Then I changed only the DocFlavor from DocFlavor.INPUT_STREAM.GIF to DocFlavor.INPUT_STREAM.AUTOSENSE, and that one works with my parallel printer, but on the USB printer the Ready light flashes twice, that's all.
    The ASCII file must have a "0C"X at the end to force a page eject on the parallel printer
    Maybe it is a matter of the DocFlavor, but which one?
    DocFlavor("application/octet-stream", "java.io.InputStream") works like DocFlavor.INPUT_STREAM.AUTOSENSE.
    DocFlavor.INPUT_STREAM.TEXT_PLAIN_HOST and DocFlavor.INPUT_STREAM.TEXT_HTML_US_ASCII cause sun.print.PrintJobFlavorException, and with DocFlavor.INPUT_STREAM.TEXT_PLAIN_US_ASCII just nothing happens on either printer, not even an error message.
    I am getting the impression that nobody of the developers ever cared for testing such a simple thing as a plain ASCII file under Windows.
    My printers I am using for the tests are
    1. an old parallel-attached HP Laserjet 4 Plus and
    2. a borrowed USB-attached Samsung CLP-510 color laser

  • HT1515 can i hook up a ethernet printer and a usb printer to the same airport express

    I want to hook up an ethernet printer and a usb printer to an airport express? Is this possible and how should I set up the airport express?

    I have an Airport Extreme, 5th generation, that is hooked to the internet and is the source of my home network. I am replacing an old AXs 801.11g with an 801.11n unit. The need to run a printer on the USB port is because it is an old HP 7400 all in one with a wireless g card. I want to set the network up for all wireless N and 5 Ghz for hopefully faster network speed. It is my understanding that if the network is set that way, the wireless g printer will not be recognized on the network. Since I currently am running a ethernet only Xerox Laser on the ethernet port, I would need to hook the HP using USB inorder to keep it on the network for scanning and such. Thanks to you and your information, I think I have the bases covered. If there is a best way to set up the AXs, or if I am missing something more, I thank you in advance and look forward to your assistance.
    Thanks

  • About: control USB device with Java

    Any body know how to control USB device with Java?
    Does JDK provide a package for USB?
    Is there any web site concerning USB programming?
    Thank you! ^_^

    Look at www.prosyst.com. There is an usb bundle (linux
    and windows pltforms).I looked on this site and cannot find the bundle you are talking about. Do you know more specifically where to find out about controlling USB devices with Java?

  • I get the following error message when I connect a usb ethernet adapter to my new MacBook Pro: Unsupported - You cannot use an Apple USB Modem with this computer. I live were we only have dial-up and the Apple Store said this is what I need.

    I get the following error message when I connect a usb ethernet adapter to my new MacBook Pro: Unsupported - You cannot use an Apple USB Modem with this computer. I live where we only have dial-up and the Apple Store said this is what I need. In addition, when I connect the phone to the connecter it falls out, it will not click in.

    Why are you using a usb ethernet adaptor? Just plug the modem into the usb port.

  • Problem with OS X.5 Leopard and printing through Airport USB printer

    I have just upgraded to Leopard from Tiger and now I can't print. Previously, all 3 of my computers could print to my Samsung printer that is connected to the USB port of the Airport Extreme base station. They could see the Samsung printer through Bonjour and it worked great. Now my computers running Leopard can't see the printer on the wireless network. I've downloaded the latest driver from Samsung and that didn't help. When I connect the printer directly to my Mac tower it prints fine. However I don't want to have the tower on all the time, sharing the printer through the network. It seems to be an issue with Leopard + Bonjour + Airport base station.
    Details:
    I have a G5 Tower connected via ethernet to the Airport router.
    I also have an intel Mac Mini and a G4 Powerbook 1.67 connected to the Airport through wireless.
    The Samsung laser printer is connected to the USB port on the Airport base station.

    I too have been bit by the Leopard/wireless printing bug....
    Originally, we had two older iMacs running Tiger; both printing to a Lexmark X502n wirelessly via an Airport Express. The set up worked flawlessly for approx. 15 months. A couple of weeks ago, I upgraded to a new (beautiful!) 24" iMac running Leopard. I can print one document, and then like the other posters, the printer shows it's printing, but the printer goes to pause and says it can not connect with host. The Express is on green light, and all the settings are there in the Airport Utility. If I go through the process to "discover" in the Airport Utility, I can then print another page.
    But - once the new iMac goes into "printer pause" and needs to be reset, the other older iMac can no longer print. If I reset everything on the new iMac, the other iMac can print as usual - until I print from the new iMac. Lexmark still has no drivers available for this model and Leopard. Past postings on various boards projected they would be available by mid-2008. Obviously, that has not happened. I have contacted Lexmark and they tell me they don't know when drivers will be available. I spent most the day yesterday on the phone with 3 different people at Apple Care. No help other than to say I need the new drivers.
    I'd move the laser printer over by my computer and connect via USB, but it is also our fax machine and on a dedicated line. Since we only have the one jack for the second phone line, moving the printer is not an option.
    Any help appreciated! I'm ready to go out and buy new cartridges for my old trusty HP inkjet....
    The new iMac is connected to a D-Link WBR-2310.
    The airport express is connected to the Lexmark X502n via USB.
    The wireless network is not secured.

  • Connecting a serial printer and a USB printer to my G4

    I have aquired two Epson Stylus USB printers one of which I have connected to my Windows machine replacing a Star LS24-200 dot matrix serial printer. The other, a C86, is now connected to my G4 replacing a defunct C84.
    The Star is in perfect working order (vintage 1992!) and I have several new ink tapes for it. As I have a serial PCI card in my G4, to which is connected an external HD and a Lacie CD-ROM drive, can I also connect the Star printer as a second printer in order to save on black inkjet cartridges?
    The external CD-ROM drive and external HD were originally connected to my now redundant 7500/100 Mac. They are still useful though if I have to disconnect them there will not be a problem.
    Any suggestions please?
    Dual 450 MHz G4   Mac OS X (10.4.7)  

    "As I have a serial PCI card in my G4, to which is connected an external HD and a Lacie CD-ROM drive, can I also connect the Star printer as a second printer in order to save on black inkjet cartridges?"
    If previously used with your 7500, these external peripherals are undoubtedly SCSI devices, so your G4 must have a SCSI (not "serial") PCI card, such as the Adaptec 2906 with a DB-25 port. Unless that 1992-vintage printer is equipped for connection via SCSI and has Mac drivers that are compatible with the current OS on the G4, you won't be able to connect/use it. Before the ease of USB connectivity, a typical PC printer cable was described as a "Centronics-36 to DB-25" and was intended for connection to the PC's DB-25 parallel port. Although similar in appearance to the DB-25 SCSI port found on many Macs and SCSI peripherals, the two buses are not compatible. Damage to the peripheral and/or host device can occur, if a PC printer is connected to a Mac's SCSI port.
    Your only option for using the printer with a Mac would be a USB-to-parallel adapter with included drivers for the printer, such as the now-discontinued "PowerPrint" product. If you check eBay, you may be able to find one.

  • Sharing a printer attached to an iMac with a laptop running windows 7

    Hi, I have a an HP LaserJet P1005 running off my Mac - this is connected via USB. I have a laptop running Windows 7. I have printer sharing active on the Mac. The Mac can see the laptop but not connect to it. The laptop can not see the Mac. I simply want to be able to print to the LaserJet printer from the laptop but can't seem to be able to create the link. If anyone has a suggestion I would be extremely grateful. Thnx. Adam

    Hello Adam,
    If you download and install Bonjour for Windows, this will assist the Win7 laptop with locating the shared LJ on the Mac.
    Pahu

  • Printing via Network USB print server suddenly not working any more

    I have always been able to print with my USB
    printers connected through a small, pocket-sized Keyspan USB Print server, Model US-4A, very easily and seamlessly, - until the very latest update to Snow Leopard.
    This server is connected to my router and the rest of my in-home Mac network by means of an ethernet port, and it has four USB device ports, 1 each for my various printers and a flatbed scanner. It worked well under OS 10.6 until just now.
    Now, all of a sudden, though the server hardware can still easily "see" and connect to
    the printers, when I actually hit 'PRINT', then the Mac OS
    print dialogues are showing some of the printers as "offline." They show up as 'unavailable' in the dialogue where you choose which printer to print to and the print dialogue boxes show the print jobs cused but then report - 'printer offline'
    When I bypass the print server - and connect the same
    printers directly to the Mac's USB ports, they print fine.
    It suits my setup to be able to continue printing via the print server, however, and I am wondering what sort of new issue could now begin fooling the MAC OS into thinking printers are not connected when it has had no trouble with the same print server and exactly the same physical connections previously ?
    I've already tried 'deleting' and uninstalling the printers and then reinstalling, and this attempted fix does not work.
    Any suggestions here ? Is this a known issue with 10.6.3 ?
    What has happened to suddenly bring this about ? Any ideas ?

    It appears that 10.6.4 has essentially broken the US-4A usb server. Keyspan's (now Tripp-Lite) response is that the latest driver is for 10.5.x and Snow-Leopard is still not supported. (1 year after 10.6.0 was released to the public). In fact, their response is that they do not even know if they will continue to produce the US-4A. Note that the U2S-2A (2 port USB 2.0) server does not support 10.6 either. Shame on Tripp-Lite for continuing to advertise, and sell a product that does not work with the current version of OS X.

  • Is Printer HP Laserjet 1018 compatible with Airport Express and windows

    I am using HP Laserjet 1018 which is connected directly to the PC.
    As it is a USB printer but not a wifi one, can I connect it to Airport Express and will it be recognised ?
    Thank you for your answers.

    Hello TigerParis75,
    Thanks for using Apple Support Communities.
    For more information on this, take a look at:
    AirPort Utility 6.x: Use a USB printer on your Wi-Fi network
    http://support.apple.com/kb/PH5114
    Just make sure you have all the updated version of the drivers.
    Best of luck,
    Mario

  • Problem with Java scrolling text window on Mac OS

    The Java scrolling text window created by AWT "TextArea" scrolls in the normal way from the top on Windows, whereas it scrolls from the bottom on the Mac OS. That is, the text file is first displayed from the bottom on Mac, so that the user has to scroll to the top of the file each time a new page is opened, which is a very nuisance. Have you run into this problem and do you know how to over-ride the Mac OS default? Many thanks.

    TextAreas suck in general, this has been discussed many time in the forum. As a duct-tape fix, you might play around with setCaretPosition() after inserting your new text. Good luck

  • Java environment on Windows 2000

    I've been trying to get Java to run properly on Windows 2000 service pack 4 and I've been having problems. I used to have window ME and it worked fine. The j2sdk1.4.2 and j2sdk1.4.1 files won't install properly.
    I get this message from InstallShield Wizard:
    Assertion failed: offset < fFileSize, file
    ../../..src/share/native/sun/awt/font/fontmanager/fontobjects/fontObject.cpp,line 418
    abnormal program termination
    When I got j2sdk1.4.2_01 to install I couldn't use javac.exe properly. I set the path in my environment values and it appears in the command line if I type path but Textpad 4.6 says that it can't find javac.exe in my windows/system32 folder.
    If anyone knows how to resolve this problem I'd greatly appreciate it if you could tell me.
    Thanks.

    You cannot compile the java servlets with J2SE only.
    You need to download and install the "J2EE" in order to compile the Servlets.

  • How to start a java application as windows 2000 service?

    Hi all,
    I'm trying to start / stop a java application as a windows 2000 service. But nothing appens (I can see the screen that rapidly display the java help prompt and then disappear)
    I've a working directory i.e C:\MyDir and it contains instsrv.exe, srvany.exe and my application jar MyApp.jar
    I'm using instsrv.exe to register a java application as a service ( C:\MyDir\instsrv MyApp C:\MyDir\srvany.exe )
    I've added a key in registry by running regedit
    The key is under the tree HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MyApp
    the key value is Parameters
    in the key I've added a string value "Application" with the value "C:\j2sdk1.4.2_01\bin\java.exe"
    and a string value "AppParameters" with the value "-classpath C:\MyDir\MyApp.jar main" where main is the name of the main class application.
    This seems to run correctly with Windows NT 4.0
    But doesn't work with Windows 2000.
    Can anyone help me?? pls.
    Thanks.
    Max

    I'm replying to myself .... ;-) ahah
    All we need for this purpose is JavaService, at link
    http://www.alexandriasc.com/software/JavaService/index.html

  • Another BUG in Java VM for Windows 2000!?

    // Having one class, bug:
    public class bug{
         static int i = 0;
         public static void main(String[] args){
              test();
         public static void test(){
              System.out.println("Nr: " + ++i);
              test();
              return;
    Here we have a recursive call in method test.
    On Windows 2000 this program runs about 4-5000 calls to test - end then aborts with no error message!
    It seems to the program ends normaly.
    On Unix the same program runs many thousands calls - end then crash because of stack overflow (gives stack overflow message).
    */

    On Windows 2000 this program runs about 4-5000 calls to
    test - end then aborts with no error message!
    It seems to the program ends normaly.It would seem to end normally for me.
    From a different thread.
    I've just startet with java (from C and C++) and
    stumbled over serious errors right away - so I'm not
    impressed so far...Hmmmmm...perhaps a different perspective? If I had just started with the language I would presume that perhaps my inexperience with the language might cause me to misunderstand obvious results.
    Of course being more experienced I would code your example as follows. And that would tell me what the problem was.
      public class NoBug
        static int i = 0;
        public static void main(String[] args)
          try
            test();
          catch(Throwable e)
             System.out.println("Throwable: " + e);
        public static void test()
          System.out.println("Nr: " + ++i);
          test();
          return;

  • Shared variable engine with pro-face touchscreen windows 2000 professional

    hello,
    who has some experience with the shared variable engine from LabView 8.5 and a touchpanel from Pro-Face?
    We try to deploy shared variables from the touchpanel but it doesn't work. Additionally the windows service ni shared variable engine dosn't start and we can't start it manually .
    The touchpanel is a PS3701A from Pro-Face with Windows professional 2000 for embedded, Pro-Face told us that we have the full service of Windows 2000 professional on a regular PC.
    Many thanks in advance
    derN

    Hi Andrew,
    Thanks for the feedback!  Your feedback will help us to improve LabVIEW for our customers.  This bug has been reported to R&D (#45493) and they are currently investigating this issue.  For now, the best workaround appears to be using a different OS, as this seems to only occur in Windows 2000.  Thanks for the feedback!

Maybe you are looking for

  • Including HTML pages

    Hi there. I'm new to Flash but I've been working on a website that came from a Flash template. Half of the pages are in Flash, the other half are HTML (done in Dreamweaver). Is there some way I can call out to the HTML pages and include them into the

  • Password Protecting Books and Topics in WebHelp

    I am working on a manual which has 12 separate projects merged into one. Some of the projects should only be viewed by certain associates. Is there a way to require a password to view certain projects in a merged project?

  • DVD writer dvd600s for Mac: looking for a driver

    The dvd600s DVD writer says it can be used with Mac, but I'm not finding any associated driver, either on the HP Website or on the web generally. Help!

  • Unable to access Photo Stream from email invite

    I have been invited to a photo stream by a friend via an email to my Gmail account. When I click the 'Join this photo stream' link it takes me to a page telling me that I need OSX 10.8.2, iPhoto 9.4, be logged in to iCloud and press the 'Join this ph

  • Linking files won't search out hard drive.

    Info: Mac Pro CS5.5 I have a project with R3D Files, my HD was getting full so I bought a larger one, made a duplicate of the R3D media. Now when I try to link up the media to the new drive, Premiere wont serach the hard drive and autolink ANYTHING.