Results 1 to 4 of 4
- 05-31-2010, 10:26 AM #1
Member
- Join Date
- May 2010
- Posts
- 22
- Rep Power
- 0
Exception in thread "main" java.lang.NoClassDefFoundError: com/sun/star/lang/XEventLi
error trackJava Code:/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package tcplistener; /** * * @author baktha */ 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; /* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author baktha */ 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(); } } }
i am using linux please help me how to solve this errorJava 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
- 05-31-2010, 03:22 PM #2
Do you have the jar file that contains the missing class?
If so you need to put it on the classpath for the jvm to use.
- 06-01-2010, 07:39 AM #3
Member
- Join Date
- May 2010
- Posts
- 22
- Rep Power
- 0
please reply which jar file missing
- 06-01-2010, 03:01 PM #4
The one containing the class: com/sun/star/lang/XEventListener
The class must have been available to the compiler(javac) when the program using that class was compiled. Find that jar file and put it on the classpath for the java command.
Where do the packages: com.artofsolving.jodconverter come from?
Similar Threads
-
Exception in thread "main" java.lang.NoClassDefFoundError
By bhupal4all in forum New To JavaReplies: 12Last Post: 06-06-2012, 09:04 AM -
Exception in thread "main" java.lang.NoClassDefFoundError: client
By fithous in forum New To JavaReplies: 1Last Post: 04-02-2009, 09:50 PM -
Exception in thread "main" java.lang.NoClassDefFoundError: client Help
By b000m in forum New To JavaReplies: 6Last Post: 08-18-2008, 06:44 AM -
Exception in thread "main" java.lang.NoClassDefFoundError
By baltimore in forum New To JavaReplies: 1Last Post: 08-06-2007, 06:07 AM -
Exception in thread "main" java.lang.NoClassDefFoundError
By carl in forum New To JavaReplies: 2Last Post: 08-01-2007, 05:26 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks