OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

com.sun.star.uno.RuntimeException: java.lang.ClassNotFoundEx

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API
View previous topic :: View next topic  
Author Message
Amith
Newbie
Newbie


Joined: 26 Aug 2011
Posts: 4

PostPosted: Fri Aug 26, 2011 10:14 pm    Post subject: com.sun.star.uno.RuntimeException: java.lang.ClassNotFoundEx Reply with quote

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
View user's profile Send private message
floris_v
Moderator
Moderator


Joined: 12 Jul 2007
Posts: 4791
Location: Netherlands

PostPosted: Fri Aug 26, 2011 10:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Fri Aug 26, 2011 11:03 pm    Post subject: Re: com.sun.star.uno.RuntimeException: java.lang.ClassNotFou Reply with quote

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
View user's profile Send private message
Amith
Newbie
Newbie


Joined: 26 Aug 2011
Posts: 4

PostPosted: Sat Aug 27, 2011 12:04 am    Post subject: Re: com.sun.star.uno.RuntimeException: java.lang.ClassNotFou Reply with quote

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
View user's profile Send private message
Amith
Newbie
Newbie


Joined: 26 Aug 2011
Posts: 4

PostPosted: Sat Aug 27, 2011 12:04 am    Post subject: Re: com.sun.star.uno.RuntimeException: java.lang.ClassNotFou Reply with quote

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
View user's profile Send private message
hol.sten
Super User
Super User


Joined: 14 Nov 2004
Posts: 3533
Location: Hamburg, Germany

PostPosted: Sat Aug 27, 2011 12:41 am    Post subject: Re: com.sun.star.uno.RuntimeException: java.lang.ClassNotFou Reply with quote

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
View user's profile Send private message
Amith
Newbie
Newbie


Joined: 26 Aug 2011
Posts: 4

PostPosted: Sat Aug 27, 2011 12:45 am    Post subject: Re: com.sun.star.uno.RuntimeException: java.lang.ClassNotFou Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Macros and API All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group