[PrintService] Printer found but nothing is printed / Invalid Flavor

Hi,
I'm trying to print a plain old UTF-8 String on a printer... Well this appears to me to be something simple, but i can't make it work.
The PrintJob is sent to the printer, i'm told that data transfer to the printer is done... But nothing is printed out from the printer!!
FYI, im working on a Mac... but with other software on my machine i manage to print anything with the printer found by my Java code.
Here is my code:
public void print() {
        LOG.info(incidentFormString.toString());
        DocFlavor docFlavor = DocFlavor.STRING.TEXT_PLAIN;
        PrintRequestAttributeSet printAttributes = new HashPrintRequestAttributeSet();
        printAttributes.add(MediaSizeName.ISO_A4);
        DocAttributeSet attributes = new HashDocAttributeSet();
        attributes.add(MediaSizeName.ISO_A4);
        // get the default printer
        PrintService printService = PrintServiceLookup.lookupDefaultPrintService();
        LOG.info("Printer found: " + printService.getName());
        DocPrintJob job = printService.createPrintJob();
        Doc doc = new SimpleDoc(incidentFormString.toString(),
                docFlavor,
                attributes);
        job.addPrintJobListener(new PrintJobListener() {
            public void printDataTransferCompleted(PrintJobEvent printJobEvent) {
                LOG.info("printDataTransferCompleted");
            public void printJobCompleted(PrintJobEvent printJobEvent) {
                LOG.info("printJobCompleted");
            public void printJobFailed(PrintJobEvent printJobEvent) {
                LOG.info("printJobFailed");
            public void printJobCanceled(PrintJobEvent printJobEvent) {
                LOG.info("printJobCanceled");
            public void printJobNoMoreEvents(PrintJobEvent printJobEvent) {
                LOG.info("printJobNoMoreEvents");
            public void printJobRequiresAttention(PrintJobEvent printJobEvent) {
                LOG.info("printJobRequiresAttention");
        try {
            job.print(doc, printAttributes);
        } catch (PrintException e) {
            LOG.error(e.getMessage());
    }incidentFormString is the string i'm trying to print. I chechked its content, it is a proper String, so there re no problems regarding to this.
Here is what i get in my console on Mac
[AWT-EventQueue-0] INFO com.thalys.opalys.client.utils.IncidentFormPrinter - Printer found: 6-OPERA
[AWT-EventQueue-0] INFO com.thalys.opalys.client.utils.IncidentFormPrinter - printDataTransferCompleted
[AWT-EventQueue-0] INFO com.thalys.opalys.client.utils.IncidentFormPrinter - printDataTransferCompleted
[AWT-EventQueue-0] INFO com.thalys.opalys.client.utils.IncidentFormPrinter - printJobNoMoreEvents
[AWT-EventQueue-0] INFO com.thalys.opalys.client.utils.IncidentFormPrinter - printJobNoMoreEventsWhen i try on a PC, i get:
[AWT-EventQueue-0] INFO com.thalys.opalys.client.utils.IncidentFormTextRenderer - Printer found: \\SRV-PRINT\6-OPERA
[AWT-EventQueue-0] INFO com.thalys.opalys.client.utils.IncidentFormTextRenderer - printJobFailed
[AWT-EventQueue-0] ERROR com.thalys.opalys.client.utils.IncidentFormTextRenderer - invalid flavorThanks a million for your help

Hey. Thanks for the quick answer
Sorry i forgot to mention those details.
My log were not verbose enough, but i simulated it on my Mac (i'm developing on my Mac and production is on a PC... the reason is that my company has not been able to give me a powerful enough PC to develop, so instead im using my Mac).
On my Mac it gives:
invalid flavor
at sun.print.Win32PrintJob.print(Win32PrintJob.java:290)
at Printing.main(Printing.java:40)
I also thought it was a problem of data that my printer can or cannot accept.
I used this code:
        DocFlavor docFlavor = DocFlavor.STRING.TEXT_PLAIN;
        LOG.info("DocFlavor Mime-Type: " + docFlavor.toString());
        PrintRequestAttributeSet printAttributes = new HashPrintRequestAttributeSet();
        printAttributes.add(MediaSizeName.ISO_A4);
        DocAttributeSet attributes = new HashDocAttributeSet();
        attributes.add(MediaSizeName.ISO_A4);
        // get the default printer
        PrintService printService = PrintServiceLookup.lookupDefaultPrintService();
        LOG.info("Printer found: " + printService.getName());
        DocFlavor[] flavors = printService.getSupportedDocFlavors();
        for (DocFlavor flavor : flavors) {
            LOG.info(flavor.toString());
        }And got this log:
As you can see, the doc flavor i choosed is available on the printer (i just did the test on my Mac, but my PC locates the same default printer as you can see on the previous posts)
[AWT-EventQueue-0] INFO IncidentFormTextRenderer - DocFlavor Mime-Type: text/plain; charset="utf-16"; class=" java.lang.String"
[AWT-EventQueue-0] INFO IncidentFormTextRenderer - Printer found: 6-OPERA
[AWT-EventQueue-0] INFO IncidentFormTextRenderer - application/octet-stream; class="[B"
[AWT-EventQueue-0] INFO IncidentFormTextRenderer - application/octet-stream; class="java.io.InputStream"
[AWT-EventQueue-0] INFO IncidentFormTextRenderer - text/plain; charset="utf-16"; class="[C"
[AWT-EventQueue-0] INFO IncidentFormTextRenderer - text/plain; charset="utf-16"; class="java.lang.String"
[AWT-EventQueue-0] INFO IncidentFormTextRenderer - text/plain; charset="utf-16"; class="java.io.Reader"
[AWT-EventQueue-0] INFO IncidentFormTextRenderer - text/rtf; class="[B"
[AWT-EventQueue-0] INFO IncidentFormTextRenderer - text/rtf; class="java.io.InputStream"
[AWT-EventQueue-0] INFO IncidentFormTextRenderer - text/rtf; class="java.net.URL"
[AWT-EventQueue-0] INFO IncidentFormTextRenderer - printDataTransferCompleted
[AWT-EventQueue-0] INFO IncidentFormTextRenderer - printDataTransferCompleted
[AWT-EventQueue-0] INFO IncidentFormTextRenderer - printJobNoMoreEvents
[AWT-EventQueue-0] INFO IncidentFormTextRenderer - printJobNoMoreEventsEdited by: nicdo77 on Dec 5, 2007 11:39 AM
Edited by: nicdo77 on Dec 5, 2007 11:40 AM

Similar Messages

  • Printer engaged but nothing is printed out

    Dear Applites,
    I have an HP printer hooked up to my desktop apple- OSX. I have no problem printing something off the internet but for some reason I can't print anything I've word processed. i.e. Appleworks. The printer goes through the motions as if printing something, but alas, out pops a blank sheet of paper.
    Any help most graciously accepted,
    Michael

    Try downloading the latest print driversif you've never had this working.mrtotes

  • Iphone show connection to printer, but nothing is printing

    iphone show connection to my printer, but nothing is printing.

    One thing you might try is to download the (free) Epson iPrint app from the App Store.  See if that app sees your printer, and, if so, try the "Maintenance" button in the lower left, including its "firmware update" (which is under "Printer Settings").  Make sure the iPrint shows the ink levels.

  • Clicked on Show or Hide HP Smart Web Printing button but nothing happened.

    I Clicked on Show or Hide HP Smart Web Printing button but nothing happened. I tried uninstalling and reinstalling... and i am already in a 32 bit browser on an 84 bit operating machine with adobe flash player. Please send me some advice for problem shooting... Thank you all!

    Hey HP ...  Does anyone from HP monitor these posts and provide answers, as one might expect?  Is anyone listening?  Is anyone there?  Does anyone CARE?

  • Windows 8.1 PC, using reader, when searching a folder containing approx 100 doc's. If i search for a word, no results are returned. only the doc names can be found but nothing from within the doc. This is a new problem and was not the case before.

    Windows 8.1 PC, using reader, when searching a folder containing approx 100 doc's. If i search for a word, no results are returned. only the doc names can be found but nothing from within the doc.
    This is a new problem and was not the case before.

    Works perfectly fine for me with the latest Reader version (11.0.09).
    You write that it worked "before"; before what?  An update?  Update from what version to what version?

  • Standard text displayed correctly in print preview but not in print

    Hi,
    I have a script in which a standard text has to be printed in the output.
    The standard text contains some german characters.
    These characters are displayed correctly in print preview but not in print.
    The text is maintained in 3 languages DE,EN and Russian.
    The same text is being printed in some standard report. But that is displayed correctly both in print and print preview.
    Please suggest something.
    Regards,
    Richa Aggarwal

    Hi Richa,
    Check this document from SAP: [help doc|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/f0652a95-5f0b-2a10-5aba-c085f8bbe6d6?QuickLink=index&overridelayout=true]
    It indicates that you have to be sure to select "Unicode" fonts for your SAPScript form to ensure the proper printing of "Unicode" characters.  If a character does not display then that means it does not exist in the font that you are using.
    Regards,
    Ryan Crosby

  • Samba cups and windows 8: printer spools but will not print.

    Hello,
    I have samba and cups setup. I have been trying to connect to my windows printer. Here is my setup
    Arch linux linux-3.12.1-3
    samba-4.1.2-1
    cups-1.7.0-2
    Windows 8.1
    no firewalls
    Samba config
    [global]
    security = user
    #passdb backend = tdbsam
    #username map = /etc/samba/smbusers
    workgroup = Bobshouse
    encrypt passwords = yes
    wins support = yes
    log level = 1
    max log size = 1000
    read only = no
    #disable netbios = yes
    printing = cups
    printcap = cups
    [homes]
    browsable = no
    map archive = yes
    [Shared]
    browsable = yes
    read only = yes
    path = /home/bob/Share
    for cups some things I have tried are
    lpd://hostname/printer
    smb://username:password@hostname/printer_name
    I can see the printer with smbclient
    So the printer spools, but will not print. the paper does not move I just hear the printer. Also when I watch the print queues in windows and linux. Cups shows that it sent the document, but when I watch the windows queue it shows the document, but the size of the document stays at 32 kb out of 1.8 mb and says printing. I hope this makes sense. I am just trying to keep things very simple at this point. I just want to understand what the problem is and build on it.

    Please provide the following relevant information so someone can help including:
    Printer Model - done
    Complete and Detailed Problem Description -
    Operating System of computer (including service pack revision) - done
    Connection Method - USB, Hardwired LAN, Wireless? -
    Make and model of router and modem? -
    Error messages - on printer screen and/or computer, any blinking light patterns?
    If wireless, when the problem occurs, what is status of Blue Wireless light on printer, on, off or blinking? –
    Power off printer and router. Power on router and wait 3 mins, power on printer. Does it connect to the router now? Do you have a valid IP address?

  • I am having trouble printing I have a connection to my printer wirelessly but does not print out the correct page I want.When I do print I get a bunch of pages more than is needed and also get a code and symbols please help I am jammed at work

    I am having trouble printing I have a connection to my printer wirelessly but does not print out the correct page I want.When I do print I get a bunch of pages more than is needed and also get a code and symbols please help I am jammed at work

    This can be the result of selecting the wrong driver. An older, unsupported laser printer will sometimes work with the generic Postscript driver.

  • F4280 attempts print job but nothing on paper after

    As the title somewhat states, if I try to print using my F4280, the printer will attempt to print but without success.  I can hear the ink cartridges get "into position" so to speak, but then the paper will just feed through the printer without actually printing.  The ink cartridges are full and correctly installed.  About a month ago, it was doing approximately the same thing, except instead of just feeding the paper through, I could hear the printer as if it was actually printing but still no ink on the paper.  I'm not sure if I have explained it well enough, as I don't know exactly how to word it, but I hope someone understands what I'm asking and is able to help.  Thanks in advance for any attempts to help!!

    After I replied that the attempts didnt work, I attempted cleaning and aligning printheads again. This time it worked like a charm. Many thanks for your assistance, you have my neverending heartfelt appreciation.  

  • I have items listed as "pending" in my print queue online but nothing is printing.

    i have sent multiple items to print and whilst they are sitting in my print queue marked as "pending" nothing is printing. the printer is on and having run a wireless report all seems fine. what am i missing??

    Hi daws78,
    If a print job is in the pending status, it could mean there's an issue with the printer itself (paper jam, low ink levels, etc.).  Double check to make sure there are no alerts like these on the printer.  If not, then you can try resetting the printer's connection with these steps:
    1.  Unplug your router.
    2.  Unplug the printer (without turning it off first).
    3.  After about 60 seconds, plug in the router and once it's ready, plug in the printer.
    Let me know if the print jobs are still pending after you've done this.
    If I have solved your issue, please feel free to provide kudos and make sure you mark this thread as solution provided!
    Although I work for HP, my posts and replies are my own opinion and not those of HP.

  • Printer connected, printer works, but won't print from Mac

    I'm helping someone with a printer problem, and I have a mystery on my hands.
    The printer is connected (directly), shows up in the printer list, can print a test page, but won't print any document from this computer (it's fine from my laptop).
    It's a Mid-2011 Mini, 2.3Ghz, running 10.7.5. The printer is an Epson WF-2540.
    This is a USB printer, connected directly to their Mac.
    In "Settings", when you select Print/FAX and print a "Test Page" - Success! This is a process that invokes the Epson Driver directly [and bypasses the MAC print queuing mechanism]
    When "Printing" from within any application (firefox, TextEdit, winders...)   The job starts to queue, but errors before engaging the printer.
    R & R the Epson Drivers,  Clear the Printer "stuff" on the Mac, Reinstall drivers from the Epson website, Mac wants to update the "newest" Epson Drivers (kinda' funny when I think about it...).
    Still errors.
    I attached directly to a USB port on my MacBook Pro.  Download drivers, etc..  Works like a champ!
    We have deleted the printer from System Prefs, rebooted, and added it back.
    We have even gone into Terminal and...
    sudo bash
    cd /etc/cups/ppd
    ls
    found EPSON_WF_2540_Series.ppd
    cp * /var/tmp/
    ls /var/tmp/*.ppd
    rm /etc/cups/ppd/*
    Still doesn't work.
    Anybody have any suggestions?

    Hi, it's not clear... did you Rest the Printing system on the Mac?
    10.5/10.6/10.7/10.8 instructions...
    In System Preferences>Fax & Print, Right click or Control+click on the Printers list Sidebar, choose Reset Printing System.
    if you hold option and click the "-" tab it resets the printing system.
    http://www.macosxhints.com/article.php?story=20031215144430486
    Safe Boot from the HD, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions.
    Any devices that previously appeared in your Printer List and Fax List will need to be added again after resetting the printing system.
    Resetting the printing system in Mac OS X 10.5.x+++
        1.    To use the Reset Printing System feature in Mac OS X 10.5.x, follow these steps:
        2.    Choose System Preferences from the Apple menu.
        3.    Choose Print & Fax from the View menu.
        4.    Control-click on list of printers on the left side of the window, then choose "Reset printing system" from the contextual menu. If you don't see a list of printers, Control-click on the text "Click + to add a printer or fax" and select "Reset printing system..." 
   
  As an alternative, if you currently have one or more printers listed, you can Option-click the "-" (Remove printer) button.
    http://support.apple.com/kb/ht1341
    Reboot.

  • Test print works but can't print from programs

    I have installed an Officejet 6500A. Install went as expected and drivers were loaded ok. I can print a test  page and the maintenance utilites will print fine but it will not print from any of the Windows programs. I am connected via USB. Any ideas would be appreciated.
    Thanks.

    So if I understand you correctly, the switch works with everything on the wired network (including the MacBook Pro). You can't see the wired network when connecting wirelessly on the MacBook Pro.
    So you must have the switch attached to the airport extreme ethernet port. All of your other computers are attached to the switch.
    Try to use the UNIX command ping in terminal.
    Example :
    Start terminal
    ping 10.xxx.xxx.xxx
    where 10.xxx.xxx.xxx is the ip of a computer on your network
    This will tell you if the computer on the network is visible.

  • Firefox 5 with Fedora 15 prints text, but will not print images from web pages.

    I have a Pentium 3 laptop running Fedora 15 and using Firefox 5.0. Firefox will print the text from a website, but will not print the images. It just leaves the spaces blank where the images should be. Print preview shows the same results. I have a AMD desktop and a Pentium 4 laptop running the same software, except that the desktop is running the 64-bit version of Fedora 15 and the second laptop is running the 32-bit version. The desktop prints the text and images without very many problems, but both laptops will print the text, but ''not'' the images.
    As a test, I downgraded Firefox from version 5.0 to 4.0.1 on the Pentium 4 laptop and encountered the same problem. So, since I do not print much from either laptop, I had not before seen this problem. The desktop has never seen it.
    I figure it may be an about:config problem, but I do not know what the parameter may be that is causing the problem.

    See this: <br />
    http://kb.mozillazine.org/Problems_printing_web_pages

  • In Smartform able to see the logo in print preview but logo not printing.

    Hi All,
            In Smart form there is a logo which i am able to see through Print Preview but when trying to print that form the logo is not printing. What might be the reason for this problem, please suggest a solution for this problem.
    Regards,
    Siva.

    Hi,
         I am able to see the logo for all other smart forms i have developed using the same printer. But the problem is only with this Form. If the printer settings are not correct  i should not be able to get the output for any form using that printer.
    Regards,
    Siva.

  • CUPS Network printer adds, but won't print...

    My USB printer works fine, but my network printer is a much cheaper black and white laserjet that I normally print to.  The problem is, I can add the printer just fine; the drivers and everything add just fine.  When I go to actually print, I get the error message...
    "Unable to locate printer '(enter printer name here)'".
    The GNOME diagnostic tool recommends to go to System>Administration>Printing and enable it in the Policies tab, but every time I try that it almost immediately disables.  The printer is a Brother HL-2170w, connected through our wireless network.  This printer has worked with other distributions before, is there some user setting I'm missing?
    Thanks!

    Have you given your printer a static IP or dhcp reservation address?
    I'm not really sure but isn't it just that your Arch setup doesn't have a way of resolving the printers hostname. The printer is using NetBIOS for broadcasting its name. I think you need a service on your arch setup that can resolve NetBIOS names or otherwise just use the printers IP.
    http://bbs.archlinux.org/viewtopic.php?id=52592
    You could set your system up to use avahi and then instead of the putting the printers ip you could use the resolved name. For example on my computer  once the avahi daemon is running
    [craig@eee ~]$ avahi-resolve-host-name -a 192.168.1.150
    192.168.1.150 BRN001BA903A786.local
    then just use the BRN001BA903A786.local as the address
    lpd://BRN001BA903A786.local/BINARY_P1
    Last edited by carseneau (2010-03-03 21:50:44)

Maybe you are looking for

  • How do I add a second Airport Express for Airtunes only?

    I already have one Airport Express hooked up to my G5 for wireless internet. Works just fine. How, in simple english, do I add a second Airport Express to my downstairs stereo fot playing my iTunes music through. I have looked through the help sectio

  • Iphone wifi no longer works with one type of router...

    Hello all, I have been looking at other posts but have not found any resolution. My iphone 3g has always worked on my home wifi but stopped two weeks ago or so. It works fine on other peoples routers and my imac and powerbook pick up the wifi fine. I

  • What is a "Write_undoFree.metro" file?

    It appeared a few days ago.  I exported a layer from ArcMap, opened it in Illustrator CS6 and when it's saved in the new format I noticed additional files with the .metro extension. Write.metro Write_undoFree.metro Any ideas?

  • Document Print Preview

    When I use, say, FBL1N or FBL3N I get the usual display of line items. I double click on any line will go to Document line item I then click on Document overview and get the Display Document : Overview. If I then select Print preview I get the Docume

  • Lightroom 6 slideshow scrambling photos - how to fix?

    This photo is a collage of images just to show what I'm talking about. I've created a slideshow in LR6, and it looks awesome in Preview mode. However, when I go to Play mode or when I export/save it and watch it in any other player, anywhere from 3-1