chrisg      2003/02/09 19:07:13

  Modified:    src/org/apache/fop/image Tag: fop-0_20_2-maintain
                        FopImageFactory.java
  Log:
  Fixed error when JAI is not available
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.25.2.10 +6 -3      xml-fop/src/org/apache/fop/image/Attic/FopImageFactory.java
  
  Index: FopImageFactory.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/image/Attic/FopImageFactory.java,v
  retrieving revision 1.25.2.9
  retrieving revision 1.25.2.10
  diff -u -r1.25.2.9 -r1.25.2.10
  --- FopImageFactory.java      10 Dec 2002 15:58:03 -0000      1.25.2.9
  +++ FopImageFactory.java      10 Feb 2003 03:07:12 -0000      1.25.2.10
  @@ -11,6 +11,7 @@
   import org.apache.fop.image.analyser.ImageReaderFactory;
   import org.apache.fop.image.analyser.ImageReader;
   import org.apache.fop.configuration.Configuration;
  +import org.apache.fop.messaging.MessageHandler;
   
   // Java
   import java.io.IOException;
  @@ -169,7 +170,7 @@
               try {
                   imgClassName = "org.apache.fop.image.TiffImage";
                   Class.forName(imgClassName);
  -            } catch (Exception ex) {
  +            } catch (Throwable t) {
                   imgClassName = getGenericImageClassName();
               }
           } else if ("image/svg+xml".equals(imgMimeType)) {
  @@ -233,9 +234,11 @@
   
           if (m_genericImageClassName == null) {
               try {
  +                //this will throw a NoClassDefFoundError if JAI is not installed
                   Class.forName("org.apache.fop.image.JAIImage");
                   m_genericImageClassName = "org.apache.fop.image.JAIImage";
  -            } catch (Exception ex) {
  +            } catch (Throwable t) {
  +                MessageHandler.logln("Failed to load JAI, using Jimi instead");
                   /* on any exception assume Jai is not present and use Jimi instead 
*/
                   m_genericImageClassName = "org.apache.fop.image.JimiImage";
               }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to