Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Unable to create editor input
Unable to create editor input [message #332526] Mon, 27 October 2008 02:24 Go to next message
Raja Kannappan is currently offline Raja KannappanFriend
Messages: 24
Registered: July 2009
Junior Member
Hi,

I've an editor (Editor1) in my RCP app which has a button and when user
clicks on that button in Editor1, I'm trying to open another editor
(Editor2). However, when I try to instantiate editor2 I always get this
exception: com.sun.jdi.InvocationException occurred invoking method.

Editor2 is my class and it exists in the same package as editor1. It seems
like the classloader could not find this class (Editor2). Does anyone know
why this is happening? Below is my code:

------------------------------------------------------------ ------------------------------------------------------------ -

IWorkbenchPage page = getEditorSite().getWorkbenchWindow().getActivePage();

Editor2Input editorInput2 = new Editor2Input(); // I could not instantiate
this class even though this class is in my project in the same package as
this code is

try {

page.openEditor(editorInput2, Editor2.ID);

}

catch (PartInitException e) {

e.printStackTrace();

}

------------------------------------------------------------ ---------------------------------------------------------

Thanks in advance,

- Raja.
Re: Unable to create editor input [message #332528 is a reply to message #332526] Mon, 27 October 2008 10:34 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33192
Registered: July 2009
Senior Member
Raja,

The problem could be as simple as not exporting all the packages of the
plugin. If you open the MANIFEST.MF, go to the Runtime tab, and use
"Add..." to export more pages, does it suggest any? Generally showing a
full stack trace helps with details you might have omitted. For
example, sometimes the class might be found, but static initialization
for it fails...


Raja Kannappan wrote:
> Hi,
>
> I've an editor (Editor1) in my RCP app which has a button and when user
> clicks on that button in Editor1, I'm trying to open another editor
> (Editor2). However, when I try to instantiate editor2 I always get this
> exception: com.sun.jdi.InvocationException occurred invoking method.
>
> Editor2 is my class and it exists in the same package as editor1. It seems
> like the classloader could not find this class (Editor2). Does anyone know
> why this is happening? Below is my code:
>
> ------------------------------------------------------------ ------------------------------------------------------------ -
>
> IWorkbenchPage page = getEditorSite().getWorkbenchWindow().getActivePage();
>
> Editor2Input editorInput2 = new Editor2Input(); // I could not instantiate
> this class even though this class is in my project in the same package as
> this code is
>
> try {
>
> page.openEditor(editorInput2, Editor2.ID);
>
> }
>
> catch (PartInitException e) {
>
> e.printStackTrace();
>
> }
>
> ------------------------------------------------------------ ---------------------------------------------------------
>
> Thanks in advance,
>
> - Raja.
>
>
>
>
>
>
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Unable to create editor input [message #332556 is a reply to message #332528] Tue, 28 October 2008 16:39 Go to previous messageGo to next message
Raja Kannappan is currently offline Raja KannappanFriend
Messages: 24
Registered: July 2009
Junior Member
In this case, both Editor1 and Editor2 reside in the same packge under my
source folder, but still when I try to instantiate Editor2Input class (which
is in the same package also) I get this exception:
com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred
invoking method.

Not sure why this is class not loaded while running my RCP app. Any ideas?

Thanks,

- Raja.


"Ed Merks" <Ed.Merks@gmail.com> wrote in message
news:ge45f2$as6$2@build.eclipse.org...
> Raja,
>
> The problem could be as simple as not exporting all the packages of the
> plugin. If you open the MANIFEST.MF, go to the Runtime tab, and use
> "Add..." to export more pages, does it suggest any? Generally showing a
> full stack trace helps with details you might have omitted. For example,
> sometimes the class might be found, but static initialization for it
> fails...
>
>
> Raja Kannappan wrote:
>> Hi,
>>
>> I've an editor (Editor1) in my RCP app which has a button and when user
>> clicks on that button in Editor1, I'm trying to open another editor
>> (Editor2). However, when I try to instantiate editor2 I always get this
>> exception: com.sun.jdi.InvocationException occurred invoking method.
>>
>> Editor2 is my class and it exists in the same package as editor1. It
>> seems like the classloader could not find this class (Editor2). Does
>> anyone know why this is happening? Below is my code:
>>
>> ------------------------------------------------------------ ------------------------------------------------------------ -
>>
>> IWorkbenchPage page =
>> getEditorSite().getWorkbenchWindow().getActivePage();
>>
>> Editor2Input editorInput2 = new Editor2Input(); // I could not
>> instantiate this class even though this class is in my project in the
>> same package as this code is
>>
>> try {
>>
>> page.openEditor(editorInput2, Editor2.ID);
>>
>> }
>>
>> catch (PartInitException e) {
>>
>> e.printStackTrace();
>>
>> }
>>
>> ------------------------------------------------------------ ---------------------------------------------------------
>>
>> Thanks in advance,
>>
>> - Raja.
>>
>>
>>
>>
>>
>>
>>
Re: Unable to create editor input [message #332557 is a reply to message #332556] Tue, 28 October 2008 16:55 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33192
Registered: July 2009
Senior Member
This is a multi-part message in MIME format.
--------------080309010808010804060405
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Raja,

Maybe you misspelled it in the plugin.xml? The fact that it's not a
class not found exception makes me think there's something going on
you've not mentioned. I.e., that something is failing during the
initialization of the class. Have you tried to step through this in the
debugger?


Raja Kannappan wrote:
> In this case, both Editor1 and Editor2 reside in the same packge under my
> source folder, but still when I try to instantiate Editor2Input class (which
> is in the same package also) I get this exception:
> com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred
> invoking method.
>
> Not sure why this is class not loaded while running my RCP app. Any ideas?
>
> Thanks,
>
> - Raja.
>
>
> "Ed Merks" <Ed.Merks@gmail.com> wrote in message
> news:ge45f2$as6$2@build.eclipse.org...
>
>> Raja,
>>
>> The problem could be as simple as not exporting all the packages of the
>> plugin. If you open the MANIFEST.MF, go to the Runtime tab, and use
>> "Add..." to export more pages, does it suggest any? Generally showing a
>> full stack trace helps with details you might have omitted. For example,
>> sometimes the class might be found, but static initialization for it
>> fails...
>>
>>
>> Raja Kannappan wrote:
>>
>>> Hi,
>>>
>>> I've an editor (Editor1) in my RCP app which has a button and when user
>>> clicks on that button in Editor1, I'm trying to open another editor
>>> (Editor2). However, when I try to instantiate editor2 I always get this
>>> exception: com.sun.jdi.InvocationException occurred invoking method.
>>>
>>> Editor2 is my class and it exists in the same package as editor1. It
>>> seems like the classloader could not find this class (Editor2). Does
>>> anyone know why this is happening? Below is my code:
>>>
>>> ------------------------------------------------------------ ------------------------------------------------------------ -
>>>
>>> IWorkbenchPage page =
>>> getEditorSite().getWorkbenchWindow().getActivePage();
>>>
>>> Editor2Input editorInput2 = new Editor2Input(); // I could not
>>> instantiate this class even though this class is in my project in the
>>> same package as this code is
>>>
>>> try {
>>>
>>> page.openEditor(editorInput2, Editor2.ID);
>>>
>>> }
>>>
>>> catch (PartInitException e) {
>>>
>>> e.printStackTrace();
>>>
>>> }
>>>
>>> ------------------------------------------------------------ ---------------------------------------------------------
>>>
>>> Thanks in advance,
>>>
>>> - Raja.
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>
>
>

--------------080309010808010804060405
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Raja,<br>
<br>
Maybe you misspelled it in the plugin.xml?&nbsp; The fact that it's not a
class not found exception makes me think there's something going on
you've not mentioned.&nbsp; I.e., that something is failing during the
initialization of the class.&nbsp; Have you tried to step through this in
the debugger?<br>
<br>
<br>
Raja Kannappan wrote:
<blockquote cite="mid:ge7f8l$hru$1@build.eclipse.org" type="cite">
<pre wrap="">In this case, both Editor1 and Editor2 reside in the same packge under my
source folder, but still when I try to instantiate Editor2Input class (which
is in the same package also) I get this exception:
com.sun.jdi.ClassNotLoadedException: Type has not been loaded occurred
invoking method.

Not sure why this is class not loaded while running my RCP app. Any ideas?

Thanks,

- Raja.


"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:Ed.Merks@gmail.com">&lt;Ed.Merks@gmail.com&gt;</a> wrote in message
<a class="moz-txt-link-freetext" href="news:ge45f2$as6$2@build.eclipse.org">news:ge45f2$as6$2@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Raja,

The problem could be as simple as not exporting all the packages of the
plugin. If you open the MANIFEST.MF, go to the Runtime tab, and use
"Add..." to export more pages, does it suggest any? Generally showing a
full stack trace helps with details you might have omitted. For example,
sometimes the class might be found, but static initialization for it
fails...


Raja Kannappan wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,

I've an editor (Editor1) in my RCP app which has a button and when user
clicks on that button in Editor1, I'm trying to open another editor
(Editor2). However, when I try to instantiate editor2 I always get this
exception: com.sun.jdi.InvocationException occurred invoking method.

Editor2 is my class and it exists in the same package as editor1. It
seems like the classloader could not find this class (Editor2). Does
anyone know why this is happening? Below is my code:

------------------------------------------------------------ ------------------------------------------------------------ -

IWorkbenchPage page =
getEditorSite().getWorkbenchWindow().getActivePage();

Editor2Input editorInput2 = new Editor2Input(); // I could not
instantiate this class even though this class is in my project in the
same package as this code is

try {

page.openEditor(editorInput2, Editor2.ID);

}

catch (PartInitException e) {

e.printStackTrace();

}

------------------------------------------------------------ ---------------------------------------------------------

Thanks in advance,

- Raja.







</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->

</pre>
</blockquote>
</body>
</html>

--------------080309010808010804060405--


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: Unable to create editor input [message #332585 is a reply to message #332557] Thu, 30 October 2008 01:50 Go to previous message
Raja Kannappan is currently offline Raja KannappanFriend
Messages: 24
Registered: July 2009
Junior Member
I tried refactoring the packages and it works now. Not sure exactly what
went wrong, but it works now. I'll post it, if I find out what was the
cause. Thanks for the help.
Previous Topic:Refresh Coolbar after creating new AbstractContributionFactory.
Next Topic:Altering the Eclipse plugin - how to add to product build
Goto Forum:
  


Current Time: Thu Aug 08 16:27:57 GMT 2024

Powered by FUDForum. Page generated in 0.04549 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top