Null pointer with 4.1.1 8/23 release

SWT Designer allows you to create the views, editors, perspectives, pref pages, composites, etc. that comprise Eclipse SWT & RCP applications and plug-ins.

Moderators: Konstantin.Scheglov, gnebling, Alexander.Mitin, jwren, Eric Clayberg

Null pointer with 4.1.1 8/23 release

Postby jnorris » Wed Aug 24, 2005 5:39 am

I just downloaded and installed the Aug 23rd release and now I am getting null pointer errors when I open views in Design View. These are occurring in ViewParts that are part of a standalone RCP application. When I run the application everything is ok. Like a dummy I overwrote the previous version of designer that I had from a couple of weeks ago so I can't re-install it.

I first deleted the older version of designer using designer-delete.bat. I then installed the new version and started eclipse with the -clean option.

The exception being thrown is:
Code: Select all
!ENTRY com.swtdesigner 4 4 2005-08-24 09:24:23.928
!MESSAGE Designer internal error: java.lang.NullPointerException
!STACK 0
java.lang.NullPointerException
   at com.swtdesigner.model.swt.rcp.parts.ViewPartInfo.createShot(ViewPartInfo.java:98)
   at com.swtdesigner.model.JavaInfo.notifyPropertyChanged(JavaInfo.java:5762)
   at com.swtdesigner.model.swt.widgets.control.ControlInfo.notifyPropertyChanged(ControlInfo.java:282)
   at com.swtdesigner.model.swt.rcp.parts.WorkbenchPartInfo.notifyPropertyChanged(WorkbenchPartInfo.java:144)
   at com.swtdesigner.model.JavaInfo.notifyPropertyChanged(JavaInfo.java:5736)
   at com.swtdesigner.gef.common.property.DesignerEditorPropertyComposite.handleRootNodeSelected(DesignerEditorPropertyComposite.java:548)
   at com.swtdesigner.gef.common.property.DesignerEditorPropertyComposite.updatePropertyComposite(DesignerEditorPropertyComposite.java:727)
   at com.swtdesigner.gef.DesignerEditor.parseCompilationUnit(DesignerEditor.java:997)
   at com.swtdesigner.gef.DesignerEditor.handleActivate(DesignerEditor.java:896)
   at com.swtdesigner.gef.DesignerEditor.handleActivate(DesignerEditor.java:862)
   at com.swtdesigner.editors.MultiPageEditor.showDesignEditor(MultiPageEditor.java:325)
   at com.swtdesigner.editors.MultiPageEditor$2.widgetSelected(MultiPageEditor.java:168)
   at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:90)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:867)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:852)
   at org.eclipse.swt.widgets.Widget.notifyListeners(Widget.java:660)
   at org.eclipse.swt.custom.CTabFolder.setSelection(CTabFolder.java:3138)
   at org.eclipse.swt.custom.CTabFolder.onMouse(CTabFolder.java:1922)
   at org.eclipse.swt.custom.CTabFolder$1.handleEvent(CTabFolder.java:288)
   at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
   at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
   at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3080)
   at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2713)
   at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1699)
   at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
   at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:367)
   at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:143)
   at org.eclipse.ui.internal.ide.IDEApplication.run(IDEApplication.java:103)
   at org.eclipse.core.internal.runtime.PlatformActivator$1.run(PlatformActivator.java:226)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:376)
   at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:163)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334)
   at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
   at org.eclipse.core.launcher.Main.run(Main.java:973)
   at org.eclipse.core.launcher.Main.main(Main.java:948)


Any ideas on what is causing this to happen now?

Jim
jnorris
 
Posts: 17
Joined: Tue Jul 27, 2004 5:10 am

Re: Null pointer with 4.1.1 8/23 release

Postby Eric Clayberg » Wed Aug 24, 2005 6:24 am

jnorris wrote:I just downloaded and installed the Aug 23rd release and now I am getting null pointer errors when I open views in Design View. These are occurring in ViewParts that are part of a standalone RCP application.

Does this happen with any view or a specific view. Can you send a test case as well as the rest of your .log file? We have quite a few ViewPart examples and they are all opening fine on our end. We are in the process of significantly enhancing our support for ViewParts and other RCP components, but the exception you listed doesn't point to anything in particular.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Null pointer with 4.1.1 8/23 release

Postby jnorris » Wed Aug 24, 2005 9:08 am

The problem occurs with 3 of 4 views that worked fine yesterday with the earlier version. One of the views has just a JFace tableviewer in it. I stripped everything out but the instantiation of the viewer object and still had the same problem. Then I created another view exactly the same as that one and it worked fine. The only difference I saw between the two classes was that I had deleted the createActions(), initializeToolBar() and initializeMenu() methods in my class. I added those methods back to two of the views that cause the NPE and now they both work as expected. In the 3rd view with the NPE I had left the 3 methods in the code but had commented out the "IToolBarManager tbm =" and "IMenuBarManager manager =" statements. When I uncommented those two lines that view stopped throwing the NPE too. For whatever reason, the fourth view that does not throw an NPE does not have those three methods either (they were also deleted). If it also begins to throw an NPE I'll just add them back into that class as well and hopefully that will work too.

Jim

PS. I confirmed that the following causes the NPE:
Code: Select all
  private void initializeToolBar()
  {
//    IToolBarManager tbm = getViewSite().getActionBars().getToolBarManager() ;
  }
jnorris
 
Posts: 17
Joined: Tue Jul 27, 2004 5:10 am

Re: Null pointer with 4.1.1 8/23 release

Postby Eric Clayberg » Wed Aug 24, 2005 1:26 pm

jnorris wrote:The problem occurs with 3 of 4 views that worked fine yesterday with the earlier version. One of the views has just a JFace tableviewer in it. I stripped everything out but the instantiation of the viewer object and still had the same problem. Then I created another view exactly the same as that one and it worked fine. The only difference I saw between the two classes was that I had deleted the createActions(), initializeToolBar() and initializeMenu() methods in my class. I added those methods back to two of the views that cause the NPE and now they both work as expected. In the 3rd view with the NPE I had left the 3 methods in the code but had commented out the "IToolBarManager tbm =" and "IMenuBarManager manager =" statements. When I uncommented those two lines that view stopped throwing the NPE too. For whatever reason, the fourth view that does not throw an NPE does not have those three methods either (they were also deleted). If it also begins to throw an NPE I'll just add them back into that class as well and hopefully that will work too.

This problem should now be fixed in the latest v4.1.1 build.
Eric Clayberg
Software Engineering Manager
Google
http://code.google.com/webtoolkit/download.html

Author: "Eclipse Plug-ins"
http://www.qualityeclipse.com
Eric Clayberg
Moderator
 
Posts: 4503
Joined: Tue Sep 30, 2003 6:39 am
Location: Boston, MA USA

Re: Null pointer with 4.1.1 8/23 release

Postby jnorris » Thu Aug 25, 2005 3:53 am

Thanks for the quick fixes on this and the dialog bug Eric.

Designer is a great product with superb support!

Jim
jnorris
 
Posts: 17
Joined: Tue Jul 27, 2004 5:10 am


Return to SWT Designer

Who is online

Users browsing this forum: No registered users and 1 guest