Sign UpSign Up   Sign InSign In Welcome Guest,
Live Chat Live Chat

java.lang.ExceptionInInitializerError from PresentationEx under Documentum

Last post 09-01-2010, 12:26 PM by surenius. 3 replies.
Sort Posts: Previous Next
  •  08-31-2010, 5:30 PM 256466

    java.lang.ExceptionInInitializerError from PresentationEx under Documentum Java

    Hello,

    I'm using Aspose Java components to extract built-in dates from Office and PDF documents when they're uploaded into Documentum. Everything works fine except PowerPoint2007 documents. The following fragment causes the problem:
           
            byte[] content = ...;
            ....
            ByteArrayInputStream stream = new ByteArrayInputStream(content);
            com.aspose.slides.pptx.PresentationEx ppt = new com.aspose.slides.pptx.PresentationEx(stream);
            com.aspose.slides.pptx.DocumentPropertiesEx builtIn = ppt.getDocumentProperties();
            Date date =  builtIn.getCreatedTime();

            ....

    When being executed under Documentum, it results in the following error:

    java.lang.ExceptionInInitializerError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at com.aspose.slides.pptx.PresentationEx.<clinit>(SourceFile:1743)
        at com.iv.asposeutil.AsposePropertyParser.getPowerPoint2007Properties(AsposePropertyParser.java:544)
        at com.iv.asposeutil.AsposePropertyParser.getPowerPointProperties(AsposePropertyParser.java:415)

    Caused by: java.lang.NullPointerException
        at com.aspose.slides.obfuscated.sl.do(SourceFile:39)
        at com.aspose.slides.obfuscated.lj.<init>(SourceFile:128)
        at com.aspose.slides.obfuscated.lj.<init>(SourceFile:116)
        at com.aspose.slides.obfuscated.hs.<init>(SourceFile:258)
        at com.aspose.slides.obfuscated.hs.<init>(SourceFile:218)
        at com.aspose.slides.obfuscated.zr.for(SourceFile:943)
        at com.aspose.slides.obfuscated.kw.<clinit>(SourceFile:121)
        ... 24 more
    java.lang.NullPointerException
        at com.aspose.slides.obfuscated.sl.do(SourceFile:39)
        at com.aspose.slides.obfuscated.lj.<init>(SourceFile:128)
        at com.aspose.slides.obfuscated.lj.<init>(SourceFile:116)
        at com.aspose.slides.obfuscated.hs.<init>(SourceFile:258)
        at com.aspose.slides.obfuscated.hs.<init>(SourceFile:218)
        at com.aspose.slides.obfuscated.zr.for(SourceFile:943)
        at com.aspose.slides.obfuscated.kw.<clinit>(SourceFile:121)
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at com.aspose.slides.pptx.PresentationEx.<clinit>(SourceFile:1743)
    ...

    Important notes:
    • The same code works perfectly well being executed in a console Java App.
    • Other document formats are supported by similar code and all of them work well in Documentum.
    • I'm using aspose.slides_2.3.0_20100710.jar with aspose-metafiles-1.6.1-20100110.jar, and fresh versions of jai_codec.jar and jai_core.jar.
    • when testing in the console Java App, I used exactly the same set of JAR files as used in Documentum.
    • The byte array in all cases contained valid document.
    Documentum stores the JARs in its repository (database), so it, perhaps, uses custom ClassLoader to make the JARs available for the code. My guess is that there is a conflict between PresentationEx logic and the Documentum's class loader, since PresentationEx uses three external jars. Other Aspose components (like words.Document) do not refer external libs and, therefore, work fine.

    Can you please help me with the problem? At least, please confirm or disprove my guess about the ClassLoader.

    Thanks!

     
  •  09-01-2010, 10:22 AM 256602 in reply to 256466

    Re: java.lang.ExceptionInInitializerError from PresentationEx under Documentum

    Hi Suren,

    Thanks for your interest in Aspose.Slides.

    I have tried to understand the issue specified by you. We are trying to investigate the possible cause of issue. We appreciate your patience and will respond you ASAP we have some information available.

    Thanks and Regards,


    Mudassir Fayyaz
    Support Developer
    Aspose Sialkot Team
    Contact Us
    Aspose - The .NET and Java Component Publisher

    Keep in touch! We're on Twitter and Facebook
     
  •  09-01-2010, 12:26 PM 256630 in reply to 256602

    Re: java.lang.ExceptionInInitializerError from PresentationEx under Documentum

    This was Classloader problem and I figured out how to fix this. The Aspose code must be wrapper into this:

                    ClassLoader tccl = Thread.currentThread().getContextClassLoader();
                   
                    try
                    {
                        ClassLoader cl = AsposePropertyParser.class.getClassLoader();
                        Thread.currentThread().setContextClassLoader(cl);

                        [Aspose calls go here]

                    }
                    finally
                    {
                        Thread.currentThread().setContextClassLoader(tccl);
                    }


    Anyway, thanks for the prompt response!
     
  •  09-01-2010, 12:26 PM 256631 in reply to 256602

    Re: java.lang.ExceptionInInitializerError from PresentationEx under Documentum

    This was Classloader problem and I figured out how to fix this. The Aspose code must be wrapper into this:

                    ClassLoader tccl = Thread.currentThread().getContextClassLoader();
                   
                    try
                    {
                        ClassLoader cl = AsposePropertyParser.class.getClassLoader();
                        Thread.currentThread().setContextClassLoader(cl);

                        [Aspose calls go here]

                    }
                    finally
                    {
                        Thread.currentThread().setContextClassLoader(tccl);
                    }


    Anyway, thanks for the prompt response!
     
View as RSS news feed in XML