Hitachi Vantara Pentaho Community Forums
Results 1 to 5 of 5

Thread: report process stops with an error

  1. #1
    Join Date
    Jun 2004
    Posts
    11

    Default report process stops with an error

    Hi,

    I get some errors during the report generation process.
    I want to print the report without using the report preview.

    However, in my eclipse invironment I get these "warnings" but nevertheless jfreereport prints the report correctly.
    But if I run my programm as a standalone java application
    then jfreereport seems to stop the reporting process
    and the last warnings you can see are:
    Code:
    WARN:  Unable to initialize the module misc-bsf
    org.jfree.base.modules.ModuleInitializeException: Unable to load the Rhino scripting framework class. This class is required to execute the RhinoExpressions.
    	at org.jfree.report.ext.modules.rhino.RhinoModule.initialize(RhinoModule.java:80)
    	at org.jfree.base.modules.PackageState.initialize(PackageState.java:176)
    	at org.jfree.base.modules.PackageManager.initializeModules(PackageManager.java:235)
    	at org.jfree.report.JFreeReportBoot.performBoot(JFreeReportBoot.java:321)
    	at org.jfree.base.AbstractBoot.start(AbstractBoot.java:182)
    	at fuji.ecd.lieferschein.report.LieferReport.initPrint(LieferReport.java:73)
    	at fuji.ecd.lieferschein.report.LieferReport.<init>&#40;LieferReport.java&#58;66&#41;
    	at fuji.ecd.lieferschein.AppController.machDas&#40;AppController.java&#58;244&#41;
    	at fuji.ecd.lieferschein.AppController.actionPerformed&#40;AppController.java&#58;111&#41;
    	at javax.swing.AbstractButton.fireActionPerformed&#40;AbstractButton.java&#58;1786&#41;
    	at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed&#40;AbstractButton.java&#58;1839&#41;
    	at javax.swing.DefaultButtonModel.fireActionPerformed&#40;DefaultButtonModel.java&#58;420&#41;
    	at javax.swing.DefaultButtonModel.setPressed&#40;DefaultButtonModel.java&#58;258&#41;
    	at javax.swing.plaf.basic.BasicButtonListener.mouseReleased&#40;BasicButtonListener.java&#58;245&#41;
    	at java.awt.Component.processMouseEvent&#40;Component.java&#58;5100&#41;
    	at java.awt.Component.processEvent&#40;Component.java&#58;4897&#41;
    	at java.awt.Container.processEvent&#40;Container.java&#58;1569&#41;
    	at java.awt.Component.dispatchEventImpl&#40;Component.java&#58;3615&#41;
    	at java.awt.Container.dispatchEventImpl&#40;Container.java&#58;1627&#41;
    	at java.awt.Component.dispatchEvent&#40;Component.java&#58;3477&#41;
    	at java.awt.LightweightDispatcher.retargetMouseEvent&#40;Container.java&#58;3483&#41;
    	at java.awt.LightweightDispatcher.processMouseEvent&#40;Container.java&#58;3198&#41;
    	at java.awt.LightweightDispatcher.dispatchEvent&#40;Container.java&#58;3128&#41;
    	at java.awt.Container.dispatchEventImpl&#40;Container.java&#58;1613&#41;
    	at java.awt.Window.dispatchEventImpl&#40;Window.java&#58;1606&#41;
    	at java.awt.Component.dispatchEvent&#40;Component.java&#58;3477&#41;
    	at java.awt.EventQueue.dispatchEvent&#40;EventQueue.java&#58;480&#41;
    	at java.awt.EventDispatchThread.pumpOneEventForHierarchy&#40;EventDispatchThread.java&#58;201&#41;
    	at java.awt.EventDispatchThread.pumpEventsForHierarchy&#40;EventDispatchThread.java&#58;151&#41;
    	at java.awt.EventDispatchThread.pumpEvents&#40;EventDispatchThread.java&#58;145&#41;
    	at java.awt.EventDispatchThread.pumpEvents&#40;EventDispatchThread.java&#58;137&#41;
    	at java.awt.EventDispatchThread.run&#40;EventDispatchThread.java&#58;100&#41;
    WARN&#58;  Unable to load module classes for svgimage&#58;com/kitfox/svg/SVGException
    My Code for "direct" printing is:
    Code:
                ...
                PrintService service = null;
            	final ReportPane reportPane = new ReportPane&#40; report&#41;; 
                PrintRequestAttributeSet aset = new HashPrintRequestAttributeSet&#40;&#41;; 
                aset.add&#40; MediaSizeName.ISO_A4&#41;; 
                aset.add&#40; new Copies&#40;1&#41;&#41;;
    
                service = PrintServiceLookup.lookupDefaultPrintService&#40;&#41;;
                System.out.println&#40; "Drucker&#58; " + service.getName&#40;&#41;&#41;;
    
                SimpleDoc doc = new SimpleDoc&#40;reportPane, DocFlavor.SERVICE_FORMATTED.PAGEABLE, null&#41;;
                DocPrintJob job = service.createPrintJob&#40;&#41;;
                // Print it
                job.print&#40;doc, aset&#41;;
    I would be very glad if someone could help me.

    Thanks!
    Alexus

  2. #2
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Hi,

    what do you mean with 'stops the reporting process'? Does it start to print and then stops mid-process or does it never reach the point for printing?

    Your code is ok, and the warnings above have their origin in the report modules system: The two modules that complain here require additional libraries to work. You only have to worry about them, if you wanted to include either SVG images or BeanScriptingFramework expressions in your report.

    Btw.: It seems you have JFreeReport-Ext included in your classpath. That means, that you have access to the JFreeReport-Ext java14-print module, which contains utility methods for this kind of printing.

    Have a look at the class
    Code:
    org.jfree.report.ext.modules.java14print.Java14PrintUtil
    which provides the methods
    Code:
    public static boolean print &#40;final JFreeReport report&#41;
    which brings up the standard JDK14-print dialog and
    Code:
    public static void printDirectly &#40;final JFreeReport report,                                                                                                                                                     
                                        PrintService printService&#41;
    which prints without any user interaction.

    If you want to print on JDK 1.2, similiar methods are included in the class
    Code:
    org.jfree.report.modules.gui.print.PrintUtil
    .

    Regards,
    Thomas

  3. #3
    Join Date
    Jun 2004
    Posts
    11

    Default

    Thanks a lot for your answer !

    I meant that the reporting process does never reach the point for printing
    if I run my programm as a standalone java application.

    Yes, you are right. I have JFreeReport-Ext included in my classpath in order to use the java 1.4 printing possibility...
    Thanks for your advice - I'll have a look at those methods.

    How can I get rid of those warnings?

    The only image I use in the report is a .jpg logo:
    Code:
    <imageref x="67%" y="0" width="33%" height="0" src="../resources/logo.jpg" alignment="right" name="Logo" dynamic="true" scale="true" keepAspectRatio="true"/>
    And I'm using the following expressions:
    Is here something wrong?
    Code:
    		<expression name="pageXofY" class="org.jfree.report.function.TextFormatExpression">
    			<properties>
    				<property name="pattern">Seite &#123;0&#125; von &#123;1&#125;</property>
    				<property name="field&#91;0&#93;">PageNumber</property>
    				<property name="field&#91;1&#93;">PageTotal</property>
    			</properties>
    		</expression>
    
    		<expression name="myComment" class="org.jfree.report.modules.misc.beanshell.BSHExpression">
    			<properties>
    				<property name="expression">
    					import org.jfree.report.util.Log;
    					
    					Object getValue&#40;&#41; &#123;
    						if &#40;dataRow == null&#41; &#123;
    							return null;
    						&#125;
    
    						String myBem = &#40;String&#41; dataRow.get &#40;"ArtBem"&#41;;
    						if &#40; myBem == null || myBem.equals &#40;""&#41; &#41; &#123;
    							return null;
    						&#125;
    						else &#123;
    							//return "Bemerkung&#58; " + myBem;
    							return "&#40;" + myBem + "&#41;";
    						&#125;
    					&#125;
    				</property>
    			</properties>
    		</expression>
    Thanks a lot.
    Alexus

  4. #4
    Join Date
    Mar 2003
    Posts
    8,085

    Default

    Hi,

    ok, that warning was overly verbose. I reduced that in the CVS version to a more sane warning. But still: This exception is caught and does not cause any harm (other than making that one module unavailable).

    You can get rid of them by no longer using the full-featured jfreereport-ext-jar but by using only the modules you are interested in: jfreereport-ext-module-java14print-0.8.7-2.jar. This file contains all the code needed for JDK 1.4 printing.

    If your programm does not reach the point where the line 'Drucker: ' .. is printed, you certainly have an error in your printer configuration on the system where the programm runs.

    On Windows, if there is no printer installed, the system is known to go into a deadlock or very long waiting mode (I never had the patience to find it out) on some versions of the JDK.

    On Linux, you get the same, if your BSD-Printing or CUPS configuration is not correct. The funny effects range from deadlocks (as the JDK is waiting on the output of the '/usr/bin/lpc' command) to timeouts (as CUPS or the BSD-print spooler might try to communicate with an non-existing host) to simply no printer available.

    In such cases I tend to fill the code with debug statements as easy way to find out which line causes the lockup. Tell me which line the programm hangs and I should be able to tell you what the reason is ...

    Regards,
    Thomas

  5. #5
    Join Date
    Jun 2004
    Posts
    11

    Default

    Hi Taqua,

    Thank you very much for your help !!!
    I had a stupid bug in my printer configuration part
    It's working fine now.

    Regards,
    Alexus

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Privacy Policy | Legal Notices | Safe Harbor Privacy Policy

Copyright © 2005 - 2019 Hitachi Vantara Corporation. All Rights Reserved.