Hello, i have wrapped my JasperReports based printing Software as a Windows Service some weeks ago. I am using Apache Procrun to invoke the Main Loop. Apache Procrun gives the Option to run in "JRE mode" where Procrun has Access to the running runtime Environment to call Service Methods for Service Controls like "start", "stop" and "restart". We have put our formerly directly started main Loop into a Singleton Object that is called asynchronously from Procrun to signal Events to the running Main Loop. The first experiments went very well. Now, where i am installing the Software on a different Machine, I am experiencing a strange behaviour: Whenever I start the Software as a Service, the JRPrintSerciceExporter.exportReport()-Method throws the following Exception: net.sf.jasperreports.engine.JRException: java.awt.print.PrinterException: Invalid name of PrintService. at net.sf.jasperreports.engine.export.JRPrintServiceExporter.exportReport(JRPrintServiceExporter.java:159) [...] Caused by: java.awt.print.PrinterException: Invalid name of PrintService. at sun.awt.windows.WPrinterJob.setNativePrintService(Native Method) at sun.awt.windows.WPrinterJob.setPrintService(Unknown Source) at net.sf.jasperreports.engine.export.JRPrintServiceExporter.exportReport(JRPrintServiceExporter.java:155) There seem to be problems with the underlying AWT Print System whenever I start my Software as a Service. When I call exactly the same Functions from within Main, there aren't any Exceptions. Once, the Code is wrapped into a separate Thread, the Exception appears. I have tried different -Xms and -Xmx setttings because I have read about memory leak issues in http://bugs.sun.com/view_bug.do?bug_id=6445576, with no success. The Code where the Exception appears is like the following: PrintService[] services = PrintServiceLookup.lookupPrintServices(null, null); JRPrintServiceExporter exporter = new JRPrintServiceExporter(); exporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint); exporter.setParameter(JRPrintServiceExporterParameter.PRINT_SERVICE, services[druckerNr]); exporter.exportReport(); (druckerNr was evaluated before and set correctly. My Log-Output assure, that an existing Printservice was selected.) Does anyone know how to fix this? I definately have to run my Software as a Service. Please make no Suggestions like "try XY to wrap your Software as a Service" or "I Guess it is an Apache Procrun issue" unless you exactly know what the problem is. I expect the Problem to be more general. Are there any known Bugs that deal with AWT printing and Jasperreports? In an other Thread at the Java Forums (http://forums.sun.com/thread.jspa?threadID=5240907) i read that PrinterJob printerJob = PrinterJob.getPrinterJob(); PageFormat page = printerJob.defaultPage(); if (printerJob.printDialog()) { ... } could be helpful. SO I PATCHED JRPrintServiceExporter of JasperReports 3.7.2 at Line 155: try { printerJob.defaultPage(); System.out.println(printService.getName()); printerJob.setPrintService(printService); } catch (PrinterException e) { throw new JRException(e); } It had no effect. The PrintService Name is ok. I am currently using JasperReports 3.7.2. Whatsoever: Whenever the Code is Executed from whithin Main, the Problem doesn't appear. When I wrap the Code into a separate Thread, it doesn't work on SOME machines. On others, it does. For example It works fine on a Windows Server 2008 Machine. On an other Windows Server 2003 Machine, it doesn't work. Both Machines were using JRE 1.6.0_15. I tried JRE 1.6.0_21x64 - same behaviour, no success. Do you have any useful hints? Greetings, Stefan Post Edited by stdi at 2010-08-30 14:23