Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » StackOverFlow in Form Editor
StackOverFlow in Form Editor [message #480325] Sat, 15 August 2009 03:23 Go to next message
Etienne Lacombe is currently offline Etienne LacombeFriend
Messages: 83
Registered: July 2009
Member
Hello. I'm trying RAP - new to it. I made a Class which is a form editor
and made an editor page. I get a weird StackOverFlow when I open the
editor.

I'm probably missing something which causes this recurrence but since none
of my code is touched, per the stack trace, I'm not sure what I'm doing
wrong.

Here is the stack trace and what I think is the relevant code.

Etienne



!ENTRY org.eclipse.rap.ui 4 0 2009-08-14 23:08:24.143
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.StackOverflowError
at
org.eclipse.swt.internal.widgets.ItemHolder.getItem(ItemHold er.java:101)
at org.eclipse.swt.custom.CTabFolder.getItem(CTabFolder.java:23 2)
at
org.eclipse.ui.part.MultiPageEditorPart.getItem(MultiPageEdi torPart.java:581)
at
org.eclipse.ui.part.MultiPageEditorPart.getEditor(MultiPageE ditorPart.java:506)
at
org.eclipse.ui.part.MultiPageEditorPart.getActiveEditor(Mult iPageEditorPart.java:435)
at
org.eclipse.ui.forms.editor.FormEditor.getActiveEditor(FormE ditor.java:442)
at
org.eclipse.ui.forms.editor.FormEditor$FormEditorSelectionPr ovider.getSelection(FormEditor.java:92)
at
org.eclipse.ui.forms.editor.FormEditor$FormEditorSelectionPr ovider.getSelection(FormEditor.java:97)
at
org.eclipse.ui.forms.editor.FormEditor$FormEditorSelectionPr ovider.getSelection(FormEditor.java:97)
at
org.eclipse.ui.forms.editor.FormEditor$FormEditorSelectionPr ovider.getSelection(FormEditor.java:97)
at
org.eclipse.ui.forms.editor.FormEditor$FormEditorSelectionPr ovider.getSelection(FormEditor.java:97)
at
org.eclipse.ui.forms.editor.FormEditor$FormEditorSelectionPr ovider.getSelection(FormEditor.java:97)
at
org.eclipse.ui.forms.editor.FormEditor$FormEditorSelectionPr ovider.getSelection(FormEditor.java:97)
......



Here is the key code:


public class TranslationEditor extends FormEditor

protected void addPages ()
{
try {
translationEditorPage = new TranslationEditorPage (this);
addPage (translationEditorPage, getEditorInput());
}
catch (PartInitException myPartInitException) {
myPartInitException.printStackTrace ();
}
}




public class TranslationEditorPage extends FormPage
public void createFormContent (
IManagedForm aManagedForm
)
{

FormToolkit myToolkit = aManagedForm.getToolkit ();
ScrolledForm myScrolledForm = aManagedForm.getForm ();
myScrolledForm.setText (

objectToTranslate.getIdentifier ()
+ " ["
+
objectToTranslate.getTranslationLocale ()
+ "]"
);
setPartName (myScrolledForm.getText ());
myToolkit.decorateFormHeading (myScrolledForm.getForm ());



}



public class OpenObjectTranslationEditorAction extends Action
implements ISelectionListener
public void run ()
{
if (selection == null || isEnabled () == false) {
return;
}
else {
try {
TranslationEditorInput myEditorInput = new
TranslationEditorInput ((ObjectToTranslate) selection.getFirstElement ());
workbenchWindow.getActivePage ().openEditor (
myEditorInput,

TranslationEditor.ID,
true
);
}
catch (PartInitException myException) {
myException.printStackTrace();
}

}
}


public void selectionChanged (IWorkbenchPart aPart, ISelection
aSelection)
{
if (aSelection instanceof IStructuredSelection) {
selection = (IStructuredSelection) aSelection;
setEnabled ((selection.size () == 1) &&
(selection.getFirstElement () instanceof ObjectToTranslate));
}
else {
selection = null;
setEnabled (false);
}
}
Re: StackOverFlow in Form Editor [message #480326 is a reply to message #480325] Sat, 15 August 2009 03:39 Go to previous messageGo to next message
Etienne Lacombe is currently offline Etienne LacombeFriend
Messages: 83
Registered: July 2009
Member
I found the culprit line of code.

protected void addPages ()
{
try {
translationEditorPage = new TranslationEditorPage (this);
addPage (translationEditorPage, getEditorInput());
}
catch (PartInitException myPartInitException) {
myPartInitException.printStackTrace ();
}
}



Specifically:

addPage (translationEditorPage, getEditorInput());

It should have been

addPage (translationEditorPage);

Funny though is I was using another app (RCP) that I made which runs
perfectly fine against Eclipse 3.3.

But on Galileo, RAP, I get the StackOverFlow.

Anyway, hope this helps somebody else in the future.

Etienne
Re: StackOverFlow in Form Editor [message #480334 is a reply to message #480326] Sat, 15 August 2009 09:06 Go to previous messageGo to next message
Robert Enyedi is currently offline Robert EnyediFriend
Messages: 68
Registered: July 2009
Member
Etienne,

I recently experienced myself some RCP/RAP functionality discrepancies.
This makes me wonder if a stack overflow would result also when running
on the 3.5 RCP.

If yes, then this is a RCP bug, but if not, then a RAP 1.2 one. In
either case, a great help would be for you to file a bug report on this.

Regards,
Robert

Etienne Lacombe wrote:
> I found the culprit line of code.
>
> protected void addPages ()
> {
> try {
> translationEditorPage = new TranslationEditorPage (this);
> addPage (translationEditorPage, getEditorInput());
> }
> catch (PartInitException myPartInitException) {
> myPartInitException.printStackTrace ();
> }
> }
>
>
>
> Specifically:
>
> addPage (translationEditorPage, getEditorInput());
>
> It should have been
>
> addPage (translationEditorPage);
>
> Funny though is I was using another app (RCP) that I made which runs
> perfectly fine against Eclipse 3.3.
>
> But on Galileo, RAP, I get the StackOverFlow.
>
> Anyway, hope this helps somebody else in the future.
>
> Etienne
>
>
>
>
Re: StackOverFlow in Form Editor [message #480379 is a reply to message #480334] Sun, 16 August 2009 14:20 Go to previous message
Etienne Lacombe is currently offline Etienne LacombeFriend
Messages: 83
Registered: July 2009
Member
Hi Robert - I logged the issue in Bugzilla.

Etienne
Previous Topic:Download/Checkout 1.3 M1
Next Topic:Problems using my RAP Application in Tomcat
Goto Forum:
  


Current Time: Fri Apr 26 20:37:58 GMT 2024

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

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

Back to the top