| View previous topic :: View next topic |
| Author |
Message |
Amith Newbie

Joined: 26 Aug 2011 Posts: 4
|
Posted: Fri Aug 26, 2011 10:14 pm Post subject: com.sun.star.uno.RuntimeException: java.lang.ClassNotFoundEx |
|
|
i have a lib in my project contains unoil.jar and also "com.sun.star.frame.XComponentLoader" class is present but still ihave this Exception com.sun.star.uno.RuntimeException: java.lang.ClassNotFoundException
here is the code
String oooExeFolder = "C:/Program Files/OpenOffice.org 3/program";
com.sun.star.uno.XComponentContext context =BootstrapSocketConnector.bootstrap(oooExeFolder);
/** Constructor. */
XComponent document = null;
////////////////////////////////////////////////////////////////////
// Create the document.
////////////////////////////////////////////////////////////////////
System.out.println(
"WriterDoc: Start up or connect to the remote service manager.");
// Get remote service manager. We only need one instance regardless
// of the number of documents we create.
XMultiComponentFactory serviceManager = context.getServiceManager();
// ///////////////////////Retrieve the Desktop object and get its XComponentLoader.
Object desktop = serviceManager.createInstanceWithContext(
"com.sun.star.frame.Desktop", context);
// Friends Exception ocuur in the following line
XComponentLoader loader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, desktop); |
|
| Back to top |
|
 |
floris_v Moderator


Joined: 12 Jul 2007 Posts: 4605 Location: Netherlands
|
Posted: Fri Aug 26, 2011 10:54 pm Post subject: |
|
|
Moved to appropriate forum. _________________ LibreOffice 3.6.3; OOo 3.4.1 on Windows Vista
Join the Official community forum - in several languages, including Nederlandstalig forum |
|
| Back to top |
|
 |
hol.sten Super User


Joined: 14 Nov 2004 Posts: 3532 Location: Hamburg, Germany
|
Posted: Fri Aug 26, 2011 11:03 pm Post subject: Re: com.sun.star.uno.RuntimeException: java.lang.ClassNotFou |
|
|
| Amith wrote: | | but still i have this Exception com.sun.star.uno.RuntimeException: java.lang.ClassNotFoundException |
unoil.jar does not suffice alone. The class file com.sun.star.uno.RuntimeException.class is located in ridl.jar.
As you can read for example in the following Iinks I always recommend to add juh.jar, jurt.jar, ridl.jar and unoil.jar to the classpath for a java project working with OOo:
Additionally this links might be helpful:
|
|
| Back to top |
|
 |
Amith Newbie

Joined: 26 Aug 2011 Posts: 4
|
Posted: Sat Aug 27, 2011 12:04 am Post subject: Re: com.sun.star.uno.RuntimeException: java.lang.ClassNotFou |
|
|
| Amith wrote: | i have a lib in my project contains unoil.jar and also "com.sun.star.frame.XComponentLoader" class is present but still ihave this Exception com.sun.star.uno.RuntimeException: java.lang.ClassNotFoundException
here is the code
String oooExeFolder = "C:/Program Files/OpenOffice.org 3/program";
com.sun.star.uno.XComponentContext context =BootstrapSocketConnector.bootstrap(oooExeFolder);
/** Constructor. */
XComponent document = null;
////////////////////////////////////////////////////////////////////
// Create the document.
////////////////////////////////////////////////////////////////////
System.out.println(
"WriterDoc: Start up or connect to the remote service manager.");
// Get remote service manager. We only need one instance regardless
// of the number of documents we create.
XMultiComponentFactory serviceManager = context.getServiceManager();
// ///////////////////////Retrieve the Desktop object and get its XComponentLoader.
Object desktop = serviceManager.createInstanceWithContext(
"com.sun.star.frame.Desktop", context);
// Friends Exception ocuur in the following line
XComponentLoader loader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, desktop); |
Thank you for your valuable reply But i have those jar files in my project lib [juh.jar, jurt.jar, ridl.jar and unoil.jar.] and i added all jar file in ma lib. having boostrap connector also then how this exception happends am using windows xp please help me........
My IDE is Eclipse-Helios
when i put curser on UnoRuntime.queryInterface
this messsage will displayed
Note: This element has no attached Javadoc and the Javadoc could not be found in the attached source
Help me yaarrrrrr plz............... Am trying to add some data on word doc .............
Last edited by Amith on Sat Aug 27, 2011 12:10 am; edited 1 time in total |
|
| Back to top |
|
 |
Amith Newbie

Joined: 26 Aug 2011 Posts: 4
|
Posted: Sat Aug 27, 2011 12:04 am Post subject: Re: com.sun.star.uno.RuntimeException: java.lang.ClassNotFou |
|
|
| Amith wrote: | i have a lib in my project contains unoil.jar and also "com.sun.star.frame.XComponentLoader" class is present but still ihave this Exception com.sun.star.uno.RuntimeException: java.lang.ClassNotFoundException
here is the code
String oooExeFolder = "C:/Program Files/OpenOffice.org 3/program";
com.sun.star.uno.XComponentContext context =BootstrapSocketConnector.bootstrap(oooExeFolder);
/** Constructor. */
XComponent document = null;
////////////////////////////////////////////////////////////////////
// Create the document.
////////////////////////////////////////////////////////////////////
System.out.println(
"WriterDoc: Start up or connect to the remote service manager.");
// Get remote service manager. We only need one instance regardless
// of the number of documents we create.
XMultiComponentFactory serviceManager = context.getServiceManager();
// ///////////////////////Retrieve the Desktop object and get its XComponentLoader.
Object desktop = serviceManager.createInstanceWithContext(
"com.sun.star.frame.Desktop", context);
// Friends Exception ocuur in the following line
XComponentLoader loader = (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class, desktop); |
Thank you for your valuable reply But i have those jar files in my project lib [juh.jar, jurt.jar, ridl.jar and unoil.jar.] and i added all jar file in ma lib. having boostrap connector also then how this exception happends am using windows xp please help me........ |
|
| Back to top |
|
 |
hol.sten Super User


Joined: 14 Nov 2004 Posts: 3532 Location: Hamburg, Germany
|
Posted: Sat Aug 27, 2011 12:41 am Post subject: Re: com.sun.star.uno.RuntimeException: java.lang.ClassNotFou |
|
|
| Amith wrote: | | Thank you for your valuable reply But i have those jar files in my project lib [juh.jar, jurt.jar, ridl.jar and unoil.jar.] and i added all jar file in ma lib. having boostrap connector also then how this exception happends am using windows xp please help me........ |
I have no further ideas. All I can guess is that you didn't add OOo's JAR files properly to your classpath.
| Amith wrote: | | My IDE is Eclipse-Helios |
I'm using Eclipse, too, and additionally NetBeans. I've never encountered the problem you described in either IDE.
| Amith wrote: | when i put curser on UnoRuntime.queryInterface this messsage will displayed
Note: This element has no attached Javadoc and the Javadoc could not be found in the attached source |
This has nothing to do with your exception. The message simply says that OOo's JAR files do not contain Javadoc and that is true. |
|
| Back to top |
|
 |
Amith Newbie

Joined: 26 Aug 2011 Posts: 4
|
Posted: Sat Aug 27, 2011 12:45 am Post subject: Re: com.sun.star.uno.RuntimeException: java.lang.ClassNotFou |
|
|
| hol.sten wrote: | | Amith wrote: | | Thank you for your valuable reply But i have those jar files in my project lib [juh.jar, jurt.jar, ridl.jar and unoil.jar.] and i added all jar file in ma lib. having boostrap connector also then how this exception happends am using windows xp please help me........ |
I have no further ideas. All I can guess is that you didn't add OOo's JAR files properly to your classpath.
| Amith wrote: | | My IDE is Eclipse-Helios |
I'm using Eclipse, too, and additionally NetBeans. I've never encountered the problem you described in either IDE.
| Amith wrote: | when i put curser on UnoRuntime.queryInterface this messsage will displayed
Note: This element has no attached Javadoc and the Javadoc could not be found in the attached source |
This has nothing to do with your exception. The message simply says that OOo's JAR files do not contain Javadoc and that is true. |
Thank you yarrrrrrrrrrrr............. |
|
| Back to top |
|
 |
|