I integrate the SDK to springboot. When we request the api first time when the server starting, the code will report an error. And when we request the api the second time or more... , it works normal. I don't know why? Anyone can help?
- Code: Select all
@Async
@Override
public void docConvStartAsync(Params p) {
docConvStart(p);
}
@Override
public File docConvStart(Params p) {
return pdf2docx(p);
}
private File pdf2docx(Params p) {
try {
String fileName = "xxx.pdf";
doc = new PdfDocument();
doc.loadFromFile(myFileDir + "/" + fileName);
String targetFileName = "xxx.docx";
String targetFilePath = myFileDir + "/" + targetFileName;
doc.saveToFile(targetFilePath, com.spire.pdf.FileFormat.DOCX);
File outFile = new File(targetFilePath);
return outFile;
} catch(Exception e) {
log(e) // we will get error in this place
}
}
- Code: Select all
Error Message:
com.spire.office.packages.sprdce: Neutral cultures cannot be used in formatting and parsing and therefore cannot be set as the thread's current culture