My Java web application installed in server 2008. Basically application convert doc files to pdf using jodCOnverter library (using openoffice service). i am using following code to convert document.
String OpenOfficeConnString="C:\\Program Files (x86)\\OpenOffice 4\\program\\soffice.exe -headless -accept=\"socket,host=127.0.0.1,port=8100;urp;\" -nofirststartwizard";
Runtime rt = Runtime.getRuntime();
Process pSoffice = rt.exec(OpenOfficeConnString);
File inputFile = srcDoc;
String destDoc = srcDoc.getAbsolutePath().substring(0,
srcDoc.getAbsolutePath().lastIndexOf("."))
+ "." + outputFileExt;
outputFile = new File(destDoc);
// connect to an OpenOffice.org instance running on port 8100
OpenOfficeConnection connection = new SocketOpenOfficeConnection(
8100);
connection.connect();
// convert
DocumentConverter converter = new OpenOfficeDocumentConverter(
connection);
converter.convert(inputFile, outputFile);
// close the connection
connection.disconnect();
When there is single request document convert successfully.
But when multiple users try to convert document at same time it fire an error :
Error something like this:
com.artofsolving.jodconverter.openoffice.connection.abstractopenofficeconnection disposing info disconnected
My question is how can i handle multiple request so every one can convert their documents without fetching any problem.