Deepak Bala wrote:What process runs and binds to port 8100 ? That seems to be missing. On a side note...
1. The servlet is a controller. It is doing more than what it should in your use case. A business object POJO is more suited to do the heavy lifting.
2. Class names must be in CamelCase.
3. A package named servlet does not sufficiently describe the intent of the classes under it.
4. Avoid using absolute paths / OS specific paths like (c:\)
5. After logging an exception with e.printStackTrace();, what does the user get to see on the browser ? Think about that.
6. I have many more but I am afraid they may side track your original question.
hi,
i have run the open office service on localhost and 8100 by this bat :
@echo off
rem Init start parameters
set OOO_APP="C:\Program Files (x86)\OpenOffice.org 3\program\soffice.exe"
set OOO_PARAM=-headless -norestore
set OOO_SOCKET="-accept=socket,host=localhost,port=8100,tcpNoDelay=1;urp;StarOffice.ServiceManager"- nofirststartwizard
rem Start OpenOffice.org
echo start "OpenOffice.org" %OOO_APP% %OOO_PARAM% %OOO_SOCKET% >>oo.log
start "OpenOffice.org" %OOO_APP% %OOO_PARAM% %OOO_SOCKET%
and i have used this class
java to converte and it's work
package finale;
import java.io.File;
import java.net.ConnectException;
import com.artofsolving.jodconverter.DocumentConverter;
import com.artofsolving.jodconverter.openoffice.connection.*;
import com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter;
public class PptConvert{
public static void main(
String[] args) {
String newname = "ra";
File inputFile = new File("C:\\file-ppt\\"+newname+".ppt");
System.out.println("Jointure de ppt en cours ...");
File outputFile = new File("C:\\file-essai\\"+newname+".pdf");
System.out.println("Creation de pdf en cours ...");
OpenOfficeConnection connection = new SocketOpenOfficeConnection(8100);
System.out.println("Connexion avec OOo (localhost:8100) en cours ...");
try {
connection.connect();
System.out.println("Connexion éffectuée ... ");
} catch (ConnectException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
DocumentConverter converter = new OpenOfficeDocumentConverter(connection);
converter.convert(inputFile, outputFile);
System.out.println("Convertion en cours ...");
connection.disconnect();
System.out.println("Deconnexion en cours ...");
}
}
so i dont see the exactely the error for the connection !