Hi All,

I was wondering if someone could help me out with this problem I have with 
XExporter.  Basically, it is throwing me an
IllegalArgumentException error. This leads me to believe that the ODP format 
does not support any service which is supported by this
exporter.  However, I know ODP should have some export services associated as I 
can go into OO and then export ODP files to a
variety of file formats.  So I have to conclude I'm doing something wrong. 

Could someone help me spot my error?  

Thanks!


public static void main(String[] args) {
 XComponentContext xContext = Bootstrap.bootstrap();
 XMultiComponentFactory xServiceManager = xContext.getServiceManager();
 Object desktop = 
xServiceManager.createInstanceWithContext("com.sun.star.frame.Desktop", 
xContext);
 XComponentLoader xComponentLoader = 
(XComponentLoader)UnoRuntime.queryInterface(XComponentLoader.class, desktop);
 PropertyValue[] loadNewProps = new PropertyValue[3];
 loadNewProps[0] = new PropertyValue();
 loadNewProps[0].Name = "Silent";
 loadNewProps[0].Value = true;
 loadNewProps[1] = new PropertyValue();
 loadNewProps[1].Name = "Hidden";
 loadNewProps[1].Value = true;
 loadNewProps[2] = new PropertyValue();
 loadNewProps[2].Name = "ReadOnly";
 loadNewProps[2].Value = true;
 String loadUrlODP = new String("file:///c:/test.odp");
 XComponent xNewComponent = xComponentLoader.loadComponentFromURL(loadUrlODP, 
"_blank", 0, loadNewProps);
 Object GraphicExportFilter = 
xServiceManager.createInstanceWithContext("com.sun.star.drawing.GraphicExportFilter",
 xContext);
 XExporter xExporter = (XExporter)UnoRuntime.queryInterface(XExporter.class, 
GraphicExportFilter);
 xExporter.setSourceDocument(xNewComponent);
}

causes:
com.sun.star.lang.IllegalArgumentException: 
        at 
com.sun.star.lib.uno.environments.remote.Job.remoteUnoRequestRaisedException(Job.java:182)
        at com.sun.star.lib.uno.environments.remote.Job.execute(Job.java:148)
        at 
com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:344)
        at 
com.sun.star.lib.uno.environments.remote.JobQueue.enter(JobQueue.java:313)
        at 
com.sun.star.lib.uno.environments.remote.JavaThreadPool.enter(JavaThreadPool.java:101)
        at 
com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge.sendRequest(java_remote_bridge.java:652)
        at 
com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.request(ProxyFactory.java:154)
        at 
com.sun.star.lib.uno.bridges.java_remote.ProxyFactory$Handler.invoke(ProxyFactory.java:136)
        at $Proxy5.setSourceDocument(Unknown Source)
        at com.snowbound.testOOUno.main(testOOUno.java:72)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.sun.star.lib.loader.Loader.main(Loader.java:144)



-
Albert


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@api.openoffice.org
For additional commands, e-mail: dev-h...@api.openoffice.org

Reply via email to