Hi all, this is for the java programmers.

I've set up a basic java program based on frontline's Test converter
(http://www.oooforum.org/forum/viewtopic.phtml?p=64417&highlight=documentfor
mat#64417) to perform document format conversions using jooconverter.
Here's my current code:


import net.sf.joott.uno.*;
import java.io.*;
 
public class converter {
 
        public static void main(String[] a) throws Exception {
                UnoConnection conn = new
UnoConnection("socket,host=192.168.0.5,port=8100,tcpNoDelay=1");
                conn.connect();
                File source = new File("test.ppt");
                File dest = new File("test.swf");
                DocumentConverter conv = new DocumentConverter(conn);
                conv.convert(source, dest, DocumentFormat.FLASH_IMPRESS);
        }
}



It compiles fine. I used his guidelines suggested here
(http://www.openoffice.org/issues/show_bug.cgi?id=41675) for compiling
and running it. This app will run in a Linux server, and the listener
in a Windows box running OpenOffice in listening mode using this
command:

.\soffice -invisible
"-accept=socket,host=0,port=8100;urp;StarOffice.NamingService"

But when I ran it, the conversion failed, and this is the error message I got:

[EMAIL PROTECTED]:~/code$ java -cp
jooconverter.jar:/home/julio/code:jurt.jar:juh.jar:ridl.jar:sandbox.jar:unoil.j
ar converter
Feb 24, 2005 3:46:13 PM net.sf.joott.uno.UnoConnection connect
INFO: connecting using "socket,host=192.168.0.5,port=8100,tcpNoDelay=1"...
Feb 24, 2005 3:46:13 PM net.sf.joott.uno.UnoConnection connect
INFO: connected
Feb 24, 2005 3:46:13 PM net.sf.joott.uno.DocumentConverter convert
SEVERE: conversion failed; source = ""; destination = "";
filterProperties =
"{FilterName=impress_flash_Export}"com.sun.star.lang.IllegalArgumentException:
Null pointer, empty AND not loadable URL's are not allowed!
Exception in thread "main" net.sf.joott.uno.UnoException: conversion failed
at net.sf.joott.uno.DocumentConverter.convert(DocumentConverter.java:107)
at net.sf.joott.uno.DocumentConverter.convert(DocumentConverter.java:79)
at converter.main(converter.java:13)
Caused by: com.sun.star.lang.IllegalArgumentException: Null pointer,
empty AND not loadable URL's are not allowed!
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessor
Impl.java:39)
at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructor
AccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at 
com.sun.star.lib.uno.protocols.urp.Unmarshal.readThrowable(Unmarshal.java:315)
at com.sun.star.lib.uno.protocols.urp.Unmarshal.readAny(Unmarshal.java:157)
at com.sun.star.lib.uno.protocols.urp.Unmarshal.readObject(Unmarshal.java:404)
at com.sun.star.lib.uno.protocols.urp.urp.readReply(urp.java:192)
at com.sun.star.lib.uno.protocols.urp.urp.readMessage(urp.java:308)
at com.sun.star.lib.uno.protocols.urp.urp.readMessage(urp.java:607)
at 
com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge$MessageDispatcher.i
nvoke(java_remote_bridge.java:184)
at 
com.sun.star.lib.uno.bridges.java_remote.java_remote_bridge$MessageDispatcher.r
un(java_remote_bridge.java:175)

It seems to me the app is not catching the source and the destination
file handle. According to the class documentation, it should be a file
handle, and not a file name. Anyway, I tried to supply a string
containing a file name (with/without path) for both cases, but it
didn't work as well.
In this link (http://onlive.hopto.org/~julio/code.zip) you can find
all the classes I used on the procedures mentioned above and the
program itself. Since jooconverter's webpage seems to be down, I'm
hosting it here:
http://onlive.hopto.org/~julio/jooconverter-1.0b4.tar.gz.
Any tips or ideas? Thanks a lot in advance. 


-- 
Julio C. Ody
http://rootshell.be/~julioody

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GCS/SS/CC d@ s: a? C++(+++) ULB+++$ P++++ L+++$ !E W++(+++) N+ !o K- !w O- M
V- PS+ PE Y+ PGP++(-) t 5 X R+ tv-- b++ DI-- D+ G++ e h r+ y++*
------END GEEK CODE BLOCK------
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to