Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Printing problem in Unix

 
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
I have deployed my java application on a Solaris system.A network printer is connected to this Solaris machine.And from within the java application I am firing a print using Java's Print API.
I am printing a GIF document.But the printer outputs junk characters onto the pages.When the same thing is done on an application deployed on a Windows system and print is fired to a printer attached to this Windows system it prints properly.
Can someone advise me on what would be the problem and how to rectify it?

Please note that Xvfb is present on the Solaris system.I also set the System property java.awt.headless as true inside my application.
Inspite of this when I try and print I am getting the following Exception when I try to print a txt file:

java.awt.print.PrinterException: Printer is not accepting job.
2008-07-02 13:15:57.108 [info] at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1231)
2008-07-02 13:15:57.108 [info] at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1197)
2008-07-02 13:15:57.108 [info] at nia.ps.engine.runtime.printer.TextPrinter.doPrint(TextPrinter.java:216)
2008-07-02 13:15:57.108 [info] at nia.ps.engine.runtime.printer.TextPrinter.print(TextPrinter.java:177)
2008-07-02 13:15:57.108 [info] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
2008-07-02 13:15:57.108 [info] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
2008-07-02 13:15:57.108 [info] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
2008-07-02 13:15:57.108 [info] at java.lang.reflect.Method.invoke(Method.java:585)
2008-07-02 13:15:57.108 [info] at nia.ps.engine.runtime.dispatcher.PrintDispatcher.printDocs(PrintDispatcher.java:141)
2008-07-02 13:15:57.108 [info] at nia.ps.engine.runtime.dispatcher.PrintDispatcher.process(PrintDispatcher.java:85)
2008-07-02 13:15:57.108 [info] at nia.ps.engine.runtime.dispatcher.PrintDispatcher.prepareToPrint(PrintDispatcher.java:48)
2008-07-02 13:15:57.108 [info] at nia.ps.engine.runtime.dispatcher.PrintDispatcher.firePrint(PrintDispatcher.java:27)
2008-07-02 13:15:57.108 [info] at nia.ps.engine.PrintEngine.runJob(PrintEngine.java:44)
2008-07-02 13:15:57.108 [info] at nia.ps.engine.PrintEngine.spooler_process(PrintEngine.java:65)

Any help friends?
 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
The exception indicates that you do not have permission to use the printer... What user are you running the program as, and which privileges does the printer require? Can you print documents outside of your java program?
 
Nikhil Sun
Ranch Hand
Posts: 108
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Now I no longer get the exception and the request to print is going smoothly.But as I try to print the text document,the printer prints but the output is junk characters.What is the reason for this?What is the solution so that the output is properly rendered?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Please do not post the same question to multiple forums: CarefullyChooseOneForum

Let's continue the discussion in this duplicate thread.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic