I have upgraded my application from Wicket 1.x to 8.x version.
I am facing an issue to convert Excel file into PDF format.
Using this below dependencies:
<dependency>
<groupId>net.sf.jodconverter</groupId>
<artifactId>jodconverter</artifactId>
<version>3.0-beta-4</version>
</dependency>
Using these import classes
import org.artofsolving.jodconverter.OfficeDocumentConverter;
import org.artofsolving.jodconverter.office.ExternalOfficeManagerConfiguration;
import org.artofsolving.jodconverter.office.OfficeConnectionProtocol;
import org.artofsolving.jodconverter.office.OfficeManager;
Getting this below error on this line while calling buildOfficeManager() method.
OfficeManager officeManager = eomc.buildOfficeManager();
I am getting this below exception on this above line:
java.lang.ClassNotFoundException: com.sun.star.connection.NoConnectException
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1358)
at org.apache.catalina.loader.WebappClassLoaderBase.loadClass(WebappClassLoaderBase.java:1180)
at org.artofsolving.jodconverter.office.ExternalOfficeManager.(ExternalOfficeManager.java:55)
at org.artofsolving.jodconverter.office.ExternalOfficeManagerConfiguration.buildOfficeManager(ExternalOfficeManagerConfiguration.java:50)
Using below system parameters:
[openofficeHome=C:/Program Files/openoffice.org3, hostname=127.0.0.1, port=8100, protocol=SOCKET]
Below is the more detail of code:
ExternalOfficeManagerConfiguration eomcTest = new ExternalOfficeManagerConfiguration();
eomcTest.setConnectOnStart(true);
eomcTest.setConnectionProtocol(ooConfig.getProtocol());
if (OfficeConnectionProtocol.PIPE.equals(ooConfig.getProtocol())) {
eomcTest.setPipeName("officePipe");
} else {
eomcTest.setPortNumber(ooConfig.getPort());
}
OfficeManager officeManager = eomcTest.buildOfficeManager();
officeManager.start();
OfficeDocumentConverter officeDocConverter = new OfficeDocumentConverter(officeManager);
resultFile = File.createTempFile(sheetName, TypeOfFile.PDF.getFileExtension());
officeDocConverter.convert(tempFile, resultFile);
fout.close();
officeManager.stop();
Kindly anyone let me know why buildOfficeManager() is giving error here and what can be the solution here to resolve this issue. It will be more appreciable.
question from:
https://stackoverflow.com/questions/65892072/org-artofsolving-jodconverter-office-officemanager-is-not-initializing-in-wicket 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…