Hi All,
Yesturday I downloaded the new jod 3.0 from oo
3.0.My oo is running on
a different machine and I had to send an rtf to convert it pdf.Here is
what I'm doing.
First I am establishing connection to remote machine using the below
code
OfficeManager officeManager = new ManagedProcessOfficeManager
(OfficeUtils.getDefaultOfficeHome(), OfficeUtils.getDefaultProfileDir
(), "socket,host=172.18.14.21,port=8100");
officeManager.start();
//It says connected
After that I am getting the output format from documentformatregistry
like this
fficeDocumentConverter converter = new OfficeDocumentConverter
(officeManager);
DocumentFormatRegistry registry = new
DefaultDocumentFormatRegistry();
DocumentFormat outputFormat = registry.getFormatByExtension
("pdf");
Finally converting the file like this
converter.convert(new File(inputFilename), new File
(outputFilename),outputFormat);
officeManager.stop();
when I run the above code I get the following exception:
Jan 19, 2009 1:32:05 PM
net.sf.jodconverter.office.ManagedOfficeProcess recreateProfileDir
WARNING: profile dir 'D:\DOCUME~2\501636~1\LOCALS~1\Temp
\.jodconverter_socket_host-172.18.14.21_port-8100' already exists;
deleting
Jan 19, 2009 1:32:06 PM net.sf.jodconverter.office.OfficeProcess start
INFO: starting process with acceptString
'socket,host=172.18.14.21,port=8100' and profileDir 'D:
\DOCUME~2\501636~1\LOCALS~1\Temp
\.jodconverter_socket_host-172.18.14.21_port-8100'
Jan 19, 2009 1:32:06 PM net.sf.jodconverter.office.OfficeProcess start
INFO: started process; pid -1
Jan 19, 2009 1:32:12 PM net.sf.jodconverter.office.OfficeConnection
connect
INFO: connected: 'socket,host=172.18.14.21,port=8100'
Connection Established --->Mon Jan 19 13:32:12 EST 2009
Exception in thread "main" net.sf.jodconverter.office.OfficeException:
could not complete task
at net.sf.jodconverter.office.ManagedProcessOfficeManager.execute
(ManagedProcessOfficeManager.java:128)
at net.sf.jodconverter.OfficeDocumentConverter.convert
(OfficeDocumentConverter.java:71)
at OOoStreamConverter.main(OOoStreamConverter.java:80)
Caused by: java.util.concurrent.ExecutionException:
java.lang.NullPointerException
at java.util.concurrent.FutureTask$Sync.innerGet(Unknown Source)
at java.util.concurrent.FutureTask.get(Unknown Source)
at net.sf.jodconverter.office.ManagedProcessOfficeManager.execute
(ManagedProcessOfficeManager.java:123)
... 2 more
Caused by: java.lang.NullPointerException
at net.sf.jodconverter.AbstractConversionTask.execute
(AbstractConversionTask.java:71)
at net.sf.jodconverter.office.ManagedProcessOfficeManager$2.run
(ManagedProcessOfficeManager.java:118)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown
Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
In my application the usage of JODConverter as a webservice is not
possible is there a way I can achieve the document convertion using
remote openoffice using JODConverter ?
Please let me know.