Major problem- please help!

Hello,

We recently updated Aspose Slides for Java from version 14.9 to 15.6 because a important issue was solved in 15.6. But now we have a bigger problem, so we’re back to 14.9.

The problem is as follows: on serveral slides, version 15.6 “hangs”. We have tried 15.8 and this version crashes on these slides. We also tested everything with different JDK versions, the latest 1.7 and the latest 1.8 release. All have the same result. Version 14.9 works fine with these slides.

Here is a bit from the command line from testing with version 15.8:
/usr/bin/java -cp /home/httpd/javalibs/aspose.slides-15.8.0.jar:/home/httpd/javalibs/json-simple.jar:/home/httpd/javalibs/ MergePPTX result.pptx listfile
Exception in thread “main” java.lang.ExceptionInInitializerError
at com.aspose.slides.p6a2feef8.p9f36407e.k.do(Unknown Source)
at com.aspose.slides.p6a2feef8.p9f36407e.k.do(Unknown Source)
at com.aspose.slides.p6a2feef8.p9f36407e.h.do(Unknown Source)
at com.aspose.slides.vr.do(Unknown Source)
at com.aspose.slides.vi.(Unknown Source)
at com.aspose.slides.vi.do(Unknown Source)
at com.aspose.slides.bmr.int(Unknown Source)
at com.aspose.slides.bmr.static(Unknown Source)
at com.aspose.slides.blu.do(Unknown Source)
at com.aspose.slides.blu.do(Unknown Source)
at com.aspose.slides.blu.do(Unknown Source)
at com.aspose.slides.blu.(Unknown Source)
at com.aspose.slides.TextFrame.do(Unknown Source)
at com.aspose.slides.TextFrame.do(Unknown Source)
at com.aspose.slides.TextFrame.goto(Unknown Source)
at com.aspose.slides.bk.do(Unknown Source)
at com.aspose.slides.yh.do(Unknown Source)
at com.aspose.slides.yh.do(Unknown Source)
at com.aspose.slides.cz.do(Unknown Source)
at com.aspose.slides.aid.if(Unknown Source)
at com.aspose.slides.ave.do(Unknown Source)
at com.aspose.slides.ats.do(Unknown Source)
at com.aspose.slides.SlideCollection.addClone(Unknown Source)
at com.aspose.slides.SlideCollection.addClone(Unknown Source)
at com.aspose.slides.SlideCollection.addClone(Unknown Source)
at MergePPTX.main(MergePPTX.java:111)
Caused by: java.lang.NullPointerException
at com.aspose.slides.ms.pbdb106a0.p6a2feef8.p.do(Unknown Source)
at com.aspose.slides.ms.pbdb106a0.p6a2feef8.o.do(Unknown Source)
at com.aspose.slides.ms.pbdb106a0.p6a2feef8.o.do(Unknown Source)
at com.aspose.slides.ms.pbdb106a0.p6a2feef8.p.for(Unknown Source)
at com.aspose.slides.ms.pbdb106a0.p6a2feef8.p.(Unknown Source)
… 26 more

The firt argument, “result.pptx”, is the name of the resulting PPTX file, which should be created but is not because of the null pointer exception. The second argument, “listfile”, is a text file that contains a list of PPTX files that must be merged into one PPTX file. In this case, this file contains one line with the name of the original PPTX file “slide.pptx” (See attachment).

The code of MergePPTX.java is as follows:
import java.io.BufferedReader;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;

import org.json.simple.JSONArray;
import org.json.simple.JSONObject;

import com.aspose.slides.ISlide;
import com.aspose.slides.ISlideCollection;
import com.aspose.slides.License;
import com.aspose.slides.Presentation;
import com.aspose.slides.SaveFormat;


public class MergePPTX {

@SuppressWarnings(“unchecked”)
public static void main(String[] args) {
// Presume everything is allright
JSONArray errors = new JSONArray();
JSONObject result = new JSONObject();
result.put(“result”, “OK”);
result.put(“errors”, errors);

FileInputStream fstream;
try {
ClassLoader loader = SplitPresentation.class.getClassLoader();
File f = new File((loader.getResource(“MergePPTX.class”).getFile()));
//Create a stream object containing the license file
fstream = new FileInputStream(f.getParent() + “/Aspose.Slides.lic”);
//Instantiate the License class
License license = new License();
//Set the license through the stream object
license.setLicense(fstream);
fstream.close();
}
catch(Exception ex) {
// Ignore this: we’ve a license for 1 develop and 1 production server
// So we don’t use the license on all machines!

//Printing the exception, if it occurs
// errors.add(ex.toString());
// result.put(“result”, “ERROR”);
// result.put(“errors”, errors);
// System.out.println(result);
// System.exit(0);
}

// Check if we have a pptx filename
if (args.length < 2) {
errors.add(“Please give a PPTX filename and a LIST filename”);
result.put(“result”, “ERROR”);
result.put(“errors”, errors);
System.out.println(result);
System.exit(0);
}
String mergedpptxname = args[0];
String pptxlistname = args[1];

// Open and read the list
File listfile = new File(pptxlistname);
if (!listfile.exists()) {
errors.add("No list file found with the name " + pptxlistname);
result.put(“result”, “ERROR”);
result.put(“errors”, errors);
System.out.println(result);
System.exit(0);
}

ArrayList listpptx = new ArrayList();
try {
BufferedReader br = new BufferedReader(new FileReader(listfile));
String line;

do {
try {
line = br.readLine();
if (line != null) {
listpptx.add(line);
}
} catch (IOException e) {
line = null;
}
} while (line != null);

try {
br.close();
} catch (IOException e) {
}
} catch (FileNotFoundException e) {
}

Presentation destPres = new Presentation();
ISlideCollection destSlides = destPres.getSlides();
destSlides.removeAt(0);
boolean isSizeSet = false;

for (String srcPPTXName : listpptx) {
File testfile = new File(srcPPTXName);
if (testfile.exists()) {
Presentation srcPres = new Presentation(srcPPTXName);
if (isSizeSet == false) {
isSizeSet = true;
destPres.getSlideSize().setSize(srcPres.getSlideSize().getSize());
}
ISlide slide = srcPres.getSlides().get_Item(0);
destSlides.addClone(slide);
srcPres.dispose();
}
}

destPres.getMasters().removeUnused(true);
destPres.save(mergedpptxname, SaveFormat.Pptx);
destPres.dispose();
}

}

Can you please help us?

Kind regards,
Michelle

Company: Sendrata B.V.

Hi Michelle,


Thank you for your interest in Aspose.Slides.

I have observed your comments and worked with the code and presentation file shared by you but I am unable to reproduce the issue on my end. I have tested it in Windows 8.1, Aspose.Sides for Java 15.8.0 and JDK 1.8. Please share the environment details with us so that I may investigate it further to help you out.

Best Regards,

Hello,

Thank you for your response!

I’ve tested this on 3 linux systems:

  1. The production server, which is the most important
    CentOS release 6.7 (Final)
    java version "1.6.0_36"
    OpenJDK Runtime Environment (IcedTea6 1.13.8) (rhel-1.13.8.1.el6_7-x86_64)
    OpenJDK 64-Bit Server VM (build 23.25-b01, mixed mode)
    This is the JDK

  2. The test and release server
    CentOS release 6.7 (Final)
    java version "1.7.0_85"
    OpenJDK Runtime Environment (rhel-2.6.1.3.el6_7-x86_64 u85-b01)
    OpenJDK 64-Bit Server VM (build 24.85-b03, mixed mode)

  3. A development system
    Ubuntu 14.04.3 LTS
    java version "1.8.0_60"
    Java™ SE Runtime Environment (build 1.8.0_60-b27)
    Java HotSpot™ 64-Bit Server VM (build 25.60-b23, mixed mode)
Kind regards,
Michelle

Hi Michelle,

I have observed your requirements and worked with the presentation file shared by you. I have been able to reproduce the issue. A ticket with ID SLIDESJAVA-35056 has been logged in our issue tracking system to further investigate and resolve the issue.This thread has been linked with the issue so that you may be automatically notified once the issue will be resolved.

We are sorry for your inconvenience,

The issues you have found earlier (filed as SLIDESJAVA-35056) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.