Skip to main content



      Home
Home » Eclipse Projects » Eclipse 4 » NPE closing part(NPE when closing the second dynamic opned part)
NPE closing part [message #757052] Wed, 16 November 2011 04:24 Go to next message
Eclipse UserFriend
I am working on an application opening dynamic parts as "editors". In an OpenEditor handler I open the part(s) dynamically.
This works with several parts like the 3.x editors as I wanted. All parts have the property "closable".

If I close the first part - all is okay. But If I close the second one I get an exception (see below). I tested with the 4.2M3 Build. And it's the same with the basic application, created when defining a new e4 project. I just added some id's, modified the OpenHandler and the behaviour is the same.

Is this a bug?

Thx for any help...
Beat



!ENTRY org.eclipse.e4.ui.workbench 4 0 2011-11-16 09:42:14.899
!MESSAGE Internal Error
!STACK 0
java.lang.NullPointerException
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.closePart(StackRenderer.java:700)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.access$7(StackRenderer.java:686)
at org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$6.close(StackRenderer.java:653)
at org.eclipse.e4.ui.widgets.CTabFolder.onMouse(CTabFolder.java:1787)
at org.eclipse.e4.ui.widgets.CTabFolder$1.handleEvent(CTabFolder.java:275)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:972)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:888)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:90)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:147)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:352)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:611)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:624)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:579)
at org.eclipse.equinox.launcher.Main.run(Main.java:1431)
at org.eclipse.equinox.launcher.Main.main(Main.java:1407)

Re: NPE closing part [message #757096 is a reply to message #757052] Wed, 16 November 2011 08:52 Go to previous messageGo to next message
Eclipse UserFriend
No Message Body
Re: NPE closing part [message #757098 is a reply to message #757096] Wed, 16 November 2011 08:54 Go to previous messageGo to next message
Eclipse UserFriend
Ooops.

Are you closing the parts by clicking on the close button in the tab? It sounds like we need more robust code. Please open a bug at https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Platform&component=UI

If you can include an example code that when we open 2 or 3 of these dynamic editors and close 2 it NPEs that would really help.

PW
Re: NPE closing part [message #757406 is a reply to message #757098] Fri, 18 November 2011 05:13 Go to previous messageGo to next message
Eclipse UserFriend
I opened a bug report (Bug 364125) for tthis error.

I have an additional question and I don't know if it hast to do with this error.
If I open an editor from my result view with the following code:

@SuppressWarnings("unchecked")
protected void openEditor() {
logger.debug("open editor");
if (!resultViewer.getSelection().isEmpty()) {
final IStructuredSelection selection = (IStructuredSelection) resultViewer.getSelection();
final GenericModelObject<VmIdentifikation> vmIdentProxy = (GenericModelObject<VmIdentifikation>) selection.getFirstElement();

// setting context
final Vm vm = VmModelProvider.INSTANCE.getVm(vmIdentProxy.getObject());
context.set(Vm.class, vm);

final Command cmd = commandService.getCommand("vm.command.openeditor");
final ParameterizedCommand pCmd = ParameterizedCommand.generateCommand(cmd, null);
handlerService.executeHandler(pCmd, context);
}
}

all is okay. I get the data put it in the context and execute the command handler to open the editor.
Then I close the editor and try to reopen the same. When debugging I see the same data. But when I try to execute the command handler (in the last line) nothing happens. If I debug in the eclipse code I see in HandlerServiceImpl:

public Object executeHandler(ParameterizedCommand command, IEclipseContext staticContext) {
String commandId = command.getId();
Object handler = lookUpHandler(context, commandId);
if (handler == null) {
return null;
}
...

handler is null!!!
As I wrote - same data, done twice, between closed editor - no more command handler to execute. Any hints? bug?

Thx Beat

Re: NPE closing part [message #757408 is a reply to message #757098] Fri, 18 November 2011 05:39 Go to previous message
Eclipse UserFriend
I opened a bug report (Bug 364125) for tthis error.

I have an additional question and I don't know if it hast to do with this error.
If I open an editor from my result view with the following code:

@SuppressWarnings("unchecked")
protected void openEditor() {
logger.debug("open editor");
if (!resultViewer.getSelection().isEmpty()) {
final IStructuredSelection selection = (IStructuredSelection) resultViewer.getSelection();
final GenericModelObject<VmIdentifikation> vmIdentProxy = (GenericModelObject<VmIdentifikation>) selection.getFirstElement();

// setting context
final Vm vm = VmModelProvider.INSTANCE.getVm(vmIdentProxy.getObject());
context.set(Vm.class, vm);

final Command cmd = commandService.getCommand("vm.command.openeditor");
final ParameterizedCommand pCmd = ParameterizedCommand.generateCommand(cmd, null);
handlerService.executeHandler(pCmd, context);
}
}

all is okay. I get the data put it in the context and execute the command handler to open the editor.
Then I close the editor and try to reopen the same. When debugging I see the same data. But when I try to execute the command handler (in the last line) nothing happens. If I debug in the eclipse code I see in HandlerServiceImpl:

public Object executeHandler(ParameterizedCommand command, IEclipseContext staticContext) {
String commandId = command.getId();
Object handler = lookUpHandler(context, commandId);
if (handler == null) {
return null;
}
...

handler is null!!!
As I wrote - same data, done twice, between closed editor - no more command handler to execute. Any hints? bug?

Thx Beat

Re: NPE closing part [message #757849 is a reply to message #757052] Wed, 16 November 2011 04:26 Go to previous message
Eclipse UserFriend
Looks like yes. Please file a bug.

Tom

Am 16.11.11 10:24, schrieb Beat:
> I am working on an application opening dynamic parts as "editors". In an
> OpenEditor handler I open the part(s) dynamically. This works with
> several parts like the 3.x editors as I wanted. All parts have the
> property "closable".
>
> If I close the first part - all is okay. But If I close the second one I
> get an exception (see below). I tested with the 4.2M3 Build. And it's
> the same with the basic application, created when defining a new e4
> project. I just added some id's, modified the OpenHandler and the
> behaviour is the same.
> Is this a bug?
>
> Thx for any help...
> Beat
>
>
>
> !ENTRY org.eclipse.e4.ui.workbench 4 0 2011-11-16 09:42:14.899
> !MESSAGE Internal Error
> !STACK 0
> java.lang.NullPointerException
> at
> org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.closePart(StackRenderer.java:700)
>
> at
> org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer.access$7(StackRenderer.java:686)
>
> at
> org.eclipse.e4.ui.workbench.renderers.swt.StackRenderer$6.close(StackRenderer.java:653)
>
> at org.eclipse.e4.ui.widgets.CTabFolder.onMouse(CTabFolder.java:1787)
> at
> org.eclipse.e4.ui.widgets.CTabFolder$1.handleEvent(CTabFolder.java:275)
> at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
> at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
> at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
> at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:972)
>
> at
> org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
>
> at
> org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:888)
>
> at
> org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:90)
>
> at
> org.eclipse.e4.ui.internal.workbench.swt.E4Application.start(E4Application.java:147)
>
> at
> org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
>
> at
> org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:352)
>
> at
> org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
>
> at java.lang.reflect.Method.invoke(Method.java:611)
> at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:624)
> at org.eclipse.equinox.launcher.Main.basicRun(Main.java:579)
> at org.eclipse.equinox.launcher.Main.run(Main.java:1431)
> at org.eclipse.equinox.launcher.Main.main(Main.java:1407)
>
>
Previous Topic:e4 closes with EXCEPTION_ACCESS_VIOLATION
Next Topic:Controlling enable/disable menu of eclipse4.x
Goto Forum:
  


Current Time: Wed Jul 23 07:54:11 EDT 2025

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

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

Back to the top