TIFF to Image conversion issue in Java

null pointer error . its saying error in this line-
in conversion.java-
conversionConfig.setStoragePath(source.getParent().toString());


This Topic is created by atirtahir3 using the Email to Topic plugin.

@amrit007,

Thank you for your inquiry.
It seems that storage path/directory is not configured properly. Please debug this line and see what path you are getting (does it return a valid path?).
Furthermore, you can see how we are setting the storage path here.

i gave the path to my local correctly. now its showing -
[Fatal Error] :1:1: Content is not allowed in prolog.

while passing the document …
.Conversion.convertToPdfAsFilePath(“D:/New folder/BSWordSample1.docx”);

here is the error coming saying -[Fatal Error] :1:1: Content is not allowed in prolog

i dont know what is thaT

@amrit007,

Do you face this error for a particular file or for all the (different) source files?

ok so it seems the license part is giving error… when i uncommented it , the error was gone.
in Mainclass-

now the error is -Exception in thread “main” java.lang.VerifyError: Bad type on operand stack

@amrit007,

How you are applying the license? You can easily apply it by following this article.

public static final Path licensePath = getProjectBaseDir().resolve(“C:/Users/681120/Downloads/GroupDocs.Conversion-for-Java-master/License”);

    public static void applyLicense()
	{
		License lic=new License();
		lic.setLicense(licensePath.toString());
	}

this is how i am doing. but same error is coming.

where i am doing wrong???:persevere:

@amrit007,

Please try this way:

public static final Path licensePath = getProjectBaseDir().resolve("GroupDocs.Total.Java.lic");

In applyLicense method:

// Setup license
License lic = new License();
lic.setLicense(licensePath.toString());

and in getProjectBaseDir method:

public static Path getProjectBaseDir() {
Properties props = new Properties();
try {
		InputStream i = Utilities.class.getResourceAsStream("/project.properties");
		props.load(i);
	} catch (IOException x) {
		throw new RuntimeException(x);
	}
return FileSystems.getDefault().getPath(props.getProperty("project.basedir"));

}

(Utilities is the class name)

Finally, in your project.properties file:
project.basedir=${basedir}

Moreover, you can evaluate our sample GitHub project.

1 Like

ok did the same…seems that error resolved… but the error-
now the error is -Exception in thread “main” java.lang.VerifyError: Bad type on operand stack

what is it?

Exception: Can’t find file: C:\Users\681120\Desktop\GroupDocs.Conversion-for-Java-master\Examples\GroupDocs.Conversion.Examples.Java\GroupDocs.Total.Java.lic.

i am running out of deadline :disappointed_relieved:

@amrit007,

It is clearly a path/directory issue. In order to further investigate it at our end, we need a simple console project (using that issue could be reproduced) from you. Or you can explore our example project.

where is this “GroupDocs.Total.Java.lic” located in ur project?

[Fatal Error] :1:1: Content is not allowed in prolog.
this error keep coming

@amrit007,

In base directory (D:\GroupDocs.Conversion-for-Java\Examples\GroupDocs.Conversion.Examples.Java). For better elaboration, see this screenshot and observe the directory path - License Path.JPG (18.2 KB)

is there any chance fault in License file?

I am not having this file… mine looks like this…
Untitled.png (2.7 KB)