"Source directory must exist" exception on new Presentation()

Could you tell me under what circumstances I will get this exception when creating a Presentation object?

class com.aspose.slides.ms.pbdb106a0.i: Source directory must exist

com.aspose.slides.pa2137a2a.qx.do(Unknown Source)

com.aspose.slides.Presentation.do(Unknown Source)

com.aspose.slides.Presentation.do(Unknown Source)

com.aspose.slides.Presentation.(Unknown Source)

com.aspose.slides.Presentation.(Unknown Source)


I am using Slides 15.5.1-jdk18. The line of code is:

Presentation presentation = new Presentation(this.inputPathname);

The pathname looks like this:

/export/home/ben/test-data/app-test/files-test/9999/store/c555/ad65/c555ad65df9a5a90d0fc1dc0f70b3c3f2e2e637936fa56ef00b0468524e24bff-50176

ie a fully qualified path. I have confirmed the file exists and is readable by the process.

The exact same code worked with slides 15.1.0. The only thing I have changed is a new license file.

Thanks for any tips on debugging this,

Ben


Hi Ben,


I have observed the issue shared by you and request you to please share the license file with us by following these guidelines. Please also confirm that if Aspose.Slides for Java 15.4.0 works on your end. In case, if the issue is in Aspose.Slides for Java 15.5.1 then please share the working sample project and steps to reproduce the issue on our end so that we may help you further in this regard.

Many Thanks,

I have emailed you the license file. Note it is the file which is the subject of SLIDESJAVA-34922.


Version 15.4.0 works.

I don’t think I can give you any more information on how to reproduce it, apart from the file, which is attached. Note it’s given to the Presentation constructor as a full UNIX style pathname.

Could you look in the source and tell me under what condition that exception is thrown?

Ben


Hi Ben,

Our product team has investigated the issue on their end and tried reproducing the issue using Mint OS with OpenJDK 7. Can you please share the information about the complete JDK version and Operating System details. We will investigate the issue further on our end once the requested information will be shared.


Many Thanks,

Mudassir,


We’re using the Oracle JVM on OmniOS (like Solaris 11): java version “1.8.0_45”, Java™ SE Runtime Environment (build 1.8.0_45-b14), Java HotSpot™ 64-Bit Server VM (build 25.45-b02, mixed mode)

I wouldn’t expect you to replicate this environment.

Could you look in your source code and tell me under what circumstances that error is thrown? It may be something I can fix if I know what it means, but the message is vague (what ‘source directory’?) and the stack trace is obfuscated.

Ben

Hi Ben,


Thank you for sharing the information with us. I have created an issue with ID SLIDESJAVA-34924 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,

Can you replicate the error if you try loading the file from a pathname that does not include the extension?


That is, try “example”, not “example.ods”.

Thanks,

Ben


Hi Ben,

I have observed your comments and like to share that you can load the valid PPT/PPTX file using Aspose.Slides, even if its extension is missing or wrong. If there is still an issue please provide the valid presentation file without extension with which you are having issue with. I will investigate that further to help you out.

Many Thanks,


Hello,

Could you try again with the attached file? I have tried it with and without the extension, and with and without specifying a source format.

But every time I get a "Source directory must exist" exception and I have no idea how to debug this.

It worked fine with 15.4.0, and doesn't with 15.6.0 (as well as 15.5.1). Latest stack trace at end.

I would be incredibly grateful if you could search for the string "Source directory must exist" in your code, and tell me what it's checking?

Or check the differences between 15.4.0 and 15.5.1 to see if there's any relevant change?

Many thanks,

Ben


class com.aspose.slides.ms.pbdb106a0.i: Source directory must exist

com.aspose.slides.pa2137a2a.qw.do(Unknown Source)

com.aspose.slides.Presentation.do(Unknown Source)

com.aspose.slides.Presentation.do(Unknown Source)

com.aspose.slides.Presentation.(Unknown Source)

com.aspose.slides.Presentation.(Unknown Source)

Hi Ben,


I have observed the presentation file shared by you using Aspose.Slides for Java 15.6.0 on my end. I have not been able to observed any issue on my end using following sample code.

Presentation ppst=new Presentation(path+“example_with_pic.ppt”);


Can you please create a sample java console based application and try using the specified version on your end to load the presentation.

Many Thanks,

Here you go:

import com.aspose.slides.Presentation;

public class test {
public static void main(String [] args) {
new Presentation("test/fixtures/files/example_with_pic.ppt");
}
}

Running it shows the stack trace at the end of this message.

I have tried dissembling the code, and using OS tracing and a Java SecurityManager to trace what your code is doing.

However, I can't work out what it is, because I think something is passing a null to a function which checks for the existence of a directory. If it were trying to access a specific directory I could have found what it was looking for and worked from there.

This is obviously something in the environment we're running it under (output of java -version) at end.

But I cannot debug it until you tell me what causes that exception.

Please look at your code, and the changes between 15.4.0 and 15.5.1, and tell me what I need to look at next.

We are only going to solve this if you use your access to the source code to help me.

Please!!!!!

Ben


java -version

java version "1.8.0_51"

Java(TM) SE Runtime Environment (build 1.8.0_51-b16)

Java HotSpot(TM) 64-Bit Server VM (build 25.51-b03, mixed mode)



Exception in thread "main" class com.aspose.slides.ms.pbdb106a0.i: Source directory must exist

com.aspose.slides.pa2137a2a.qw.do(Unknown Source)

com.aspose.slides.Presentation.do(Unknown Source)

com.aspose.slides.Presentation.do(Unknown Source)

com.aspose.slides.Presentation.(Unknown Source)

com.aspose.slides.Presentation.(Unknown Source)

com.aspose.slides.Presentation.(Unknown Source)

test.main(test.java:6)

at com.aspose.slides.pa2137a2a.qw.do(Unknown Source)

at com.aspose.slides.Presentation.do(Unknown Source)

at com.aspose.slides.Presentation.do(Unknown Source)

at com.aspose.slides.Presentation.(Unknown Source)

at com.aspose.slides.Presentation.(Unknown Source)

at com.aspose.slides.Presentation.(Unknown Source)

at test.main(test.java:6)



Hi Ben,

I have discussed the issue with our product team. They are also unable to reproduce this behavior on their PC, but I think that the problem is related to access to default fonts directory. You should verify whether there is access from the process to the font directory. Also, there is a possibility that can help FontsLoader.loadExternalFonts (String []) to load the fonts externally by loading them manually.

Also, please perform your test in simple console application. It is some thing related to your environment as it is not reproducible on my as well our product team end. Please share your feedback with us after performing the suggested consideration.

Many Thanks,

Thank you for looking at the code. I believe I have identified the bug in these versions of Aspose.Slides for Java.


When running on a UNIX platform, if none of the following directories exist, the misleading “Source directory must exist” exception is thrown:

/usr/share/fonts

/usr/local/share/fonts

/usr/X11R6/lib/X11/fonts

$HOME/.fonts

This happens regardless of whether FontSettings.setFontsFolder() is used to set the location of the fonts on this platform.

Unfortunately, creating these directories is not an option. Would it be possible to fix this bug?

Thanks,

Ben


Hi Ben,

Thank you for sharing valuable feedback as it will help in understanding and resolving the issue based on information available on your end. I have shared the information with our product team and will share good news with you as soon as the issue will be fixed.

Many Thanks,

I have run into this issue today running on a minimal Linux OS.


com.aspose.slides.ms.pbdb106a0.i: Source directory must exist
com.aspose.slides.pa2137a2a.qw.do(Unknown Source)
com.aspose.slides.Presentation.do(Unknown Source)
com.aspose.slides.Presentation.do(Unknown Source)
com.aspose.slides.Presentation.(Unknown Source)
com.aspose.slides.Presentation.(Unknown Source)
com.aspose.slides.Presentation.(Unknown Source)
Environment details:

Running on BusyBox v1.22.1.

OpenJDK v8.60.22 (64 bit)


Creating the folders identified by Ben works around the problem.


Thanks to Ben for the hard work in identifying and posting that information.

Hi Shaun and Ben,


I like to share that the issue shared has been created in our issue tracking system and we are looking into resolving this issue. We will share the good news with you as soon as the issue will be fixed.

Many Thanks,

Mudassir


How are you getting on with resolving this issue? It is preventing us from upgrading.

Thanks,

Ben


Hi Ben,

I have verified the issue status from our issue tracking system and regret to share that issue has been marked resolved in upcoming version Aspose.Slides for Java 15.7.0. The said release is in process at the moment and will be available for download by tomorrow. I will share the product notification with you as well once the release will be available.

Many Thanks,