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.
According to https://search.maven.org/search?q=fc:com.sun.star.connection.NoConnectException you need to add org.libreoffice:libreoffice
(or the old org.libreoffice:ridl
) dependency to Maven's pom.xml.
I don't see net.sf.jodconverter at https://search.maven.org/search?q=jodconverter. You may try with a more recent version of it - probably any of the listed ones here: https://search.maven.org/search?q=g:org.jodconverter