Hi,
I am using java code to remotely connect to Open Office Server,I am using
Open Office 2.1.
Sometimes suddenly I am getting a DisposedException where my connection to
Open Office server fails and the documents stop generating.
But using telnet I can see that the Open Office server is up and running.
Can you suggest where its a code problem or configuration issue?
This is the code to get OO connection : -
protected static XComponent newDocComponentFromTemplate(String loadUrl)
throws java.lang.Exception
{
LogHelper.log(" Entering in the method
OpenOfficeHelper.newDocComponentFromTemplate",
LogHelper.DEBUG);
// get the remote service manager
mxRemoteServiceManager = getRemoteServiceManager(unoUrl);
//Added on 25/07/2007 fro OO connection issue
LogHelper.log(" Value of mxRemoteServiceManager="
+mxRemoteServiceManager,
LogHelper.DEBUG);
// retrieve the Desktop object, we need its XComponentLoader
Object desktop =
mxRemoteServiceManager.createInstanceWithContext(
"com.sun.star.frame.Desktop",
mxRemoteContext);
XComponentLoader xComponentLoader = (XComponentLoader)
UnoRuntime.queryInterface(XComponentLoader.class, desktop);
// define load properties according to
com.sun.star.document.MediaDescriptor
// the boolean property AsTemplate tells the office to create a
new document
// from the given file
PropertyValue[] loadProps = new PropertyValue[2];
loadProps[0] = new PropertyValue();
loadProps[0].Name = "AsTemplate";
loadProps[0].Value = new Boolean(true);
loadProps[1] = new PropertyValue();
loadProps[1].Name = "Hidden";
loadProps[1].Value = new Boolean(true);
//loadProps[1].Value = new Boolean(true);
// load
LogHelper.log(" Returning from the method
OpenOfficeHelper.newDocComponentFromTemplate",
LogHelper.DEBUG);
LogHelper.log("The filnal URL of open office template ="+loadUrl,
LogHelper.DEBUG);
//System.out.println("The filnal URL of open office template
="+loadUrl) ;
return xComponentLoader.loadComponentFromURL(loadUrl, "_blank", 0,
loadProps);
}
Thanks and Regards
Atul Ganeriwala
Tata Consultancy Services
Cell:- 09830005170
Mailto: [EMAIL PROTECTED]
Website: http://www.tcs.com
____________________________________________
Experience certainty. IT Services
Business Solutions
Outsourcing
____________________________________________
=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you