Results 1 to 6 of 6
  1. #1
    Join Date
    May 2010
    Posts
    22
    Rep Power
    0

    Default Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/star/lang/XEventLi

    Java Code:
    import com.artofsolving.jodconverter.DocumentConverter;
    import com.artofsolving.jodconverter.openoffice.connection.OpenOfficeConnection;
    import com.artofsolving.jodconverter.openoffice.connection.SocketOpenOfficeConnection;
    import com.artofsolving.jodconverter.openoffice.converter.OpenOfficeDocumentConverter;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.IOException;
    import java.io.InputStreamReader;
    
    public class Pdfconvertor {
      public static void main(String args[])
        {
            try
            {
             Runtime r = Runtime.getRuntime();
             Process p = Runtime.getRuntime().exec("soffice -headless -accept=socket,host=127.0.0.1,port=8100;urp; -nofirststartwizard");
             BufferedReader in = new BufferedReader(new InputStreamReader(p.getInputStream()));
             String line = null;
             while ((line = in.readLine()) != null) {
                     System.out.println(line);
              }
    
    
            OpenOfficeConnection connection = new SocketOpenOfficeConnection(8100);
    
             connection.connect();
             File inputFile = new File("/home/baktha/Desktop/Rajat.xls");
            File outputFile = new File("/home/baktha/Desktop/Rajat.pdf");
    
    // convert
            DocumentConverter converter = new OpenOfficeDocumentConverter(connection);
            converter.convert(inputFile, outputFile);
    
    // close the connection
    //connection.disconnect();
    
            converter.convert(inputFile, outputFile);
            connection.disconnect();
    
            }
            catch (IOException e1)
            {
                e1.printStackTrace();
            }
    
        }
    }
    in linux i got the following error
    Java Code:
    Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/star/lang/XEventListener
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
            at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
            at java.lang.ClassLoader.defineClass1(Native Method)
            at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
            at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
            at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
            at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
            at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
            at tcplistener.Pdfconvertor.main(Pdfconvertor.java:45)
    Caused by: java.lang.ClassNotFoundException: com.sun.star.lang.XEventListener
            at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
            ... 25 more
    Java Result: 1
    i used jodconverter-2.2.2.jar, jodconverter-cli-2.2.2.jar any jar file missing

    what i am doing wrong

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,429
    Rep Power
    9

    Default

    Jeebus, you'll never learn, will you? You already had your account in the Oracle forums locked for multiposting, and now you also do it here.
    http://www.java-forums.org/advanced-...-xeventli.html
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    22

    Default

    @ Jeebus, I've notice that you've post the same question several times in different places in the forum. Please don't do it again. Keep in mind that....

  4. #4
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    22

  5. #5
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,429
    Rep Power
    9

    Default

    Quote Originally Posted by Eranga View Post
    @ Jeebus,
    :D Urban Dictionary: jeebus
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  6. #6
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,370
    Blog Entries
    1
    Rep Power
    22

Similar Threads

  1. Replies: 3
    Last Post: 06-01-2010, 03:01 PM
  2. Replies: 5
    Last Post: 09-29-2009, 12:14 PM
  3. Replies: 1
    Last Post: 04-02-2009, 09:50 PM
  4. Replies: 6
    Last Post: 08-18-2008, 06:44 AM
  5. Replies: 2
    Last Post: 08-01-2007, 05:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •