Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » NullPointerException in SetPerspective
NullPointerException in SetPerspective [message #870993] Thu, 10 May 2012 13:40 Go to next message
Hugo Herrera is currently offline Hugo HerreraFriend
Messages: 20
Registered: July 2009
Junior Member
Hola,

I'm using Indigo and JavaSE 1.6 to create a Rap app.

I created an additional plugin which defines a new Perspective.

In the ApplicationWorkbenchWindowAdvisor of the main plugin, the configurer.setShowPerspectiveBar is set to true.

In Run Configurations I added/selected the new bundle.

When I try to switch to the new perspective, i got the following error.

Am I missing something?


java.lang.NullPointerException
	at org.eclipse.ui.internal.WorkbenchPage.setPerspective(WorkbenchPage.java:3715)
	at org.eclipse.ui.handlers.ShowPerspectiveHandler.openPerspective(ShowPerspectiveHandler.java:146)
	at org.eclipse.ui.handlers.ShowPerspectiveHandler.openOther(ShowPerspectiveHandler.java:118)
	at org.eclipse.ui.handlers.ShowPerspectiveHandler.execute(ShowPerspectiveHandler.java:57)
	at org.eclipse.ui.internal.handlers.HandlerProxy.execute(HandlerProxy.java:306)
	at org.eclipse.core.commands.Command.executeWithChecks(Command.java:476)
	at org.eclipse.core.commands.ParameterizedCommand.executeWithChecks(ParameterizedCommand.java:508)
	at org.eclipse.ui.internal.handlers.HandlerService.executeCommand(HandlerService.java:167)
	at org.eclipse.ui.internal.handlers.SlaveHandlerService.executeCommand(SlaveHandlerService.java:239)
	at org.eclipse.ui.internal.actions.CommandAction.runWithEvent(CommandAction.java:155)
	at org.eclipse.ui.internal.actions.CommandAction.run(CommandAction.java:169)
	at org.eclipse.rap.internal.design.example.builder.PerspectiveSwitcherBuilder$2.widgetSelected(PerspectiveSwitcherBuilder.java:158)
	at org.eclipse.swt.events.SelectionEvent.dispatchToObserver(SelectionEvent.java:196)
	at org.eclipse.rwt.internal.events.Event.processEvent(Event.java:44)
	at org.eclipse.swt.events.TypedEvent.processEvent(TypedEvent.java:161)
	at org.eclipse.swt.events.TypedEvent.executeNext(TypedEvent.java:201)
	at org.eclipse.swt.widgets.Display.runPendingMessages(Display.java:1143)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1133)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2733)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2694)
	at org.eclipse.ui.internal.Workbench.access$5(Workbench.java:2530)
	at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:702)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:685)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:157)
	at org.vsoft.vmenu.web.Application.start(Application.java:18)
	at org.eclipse.rap.ui.internal.application.EntrypointApplicationWrapper.createUI(EntrypointApplicationWrapper.java:25)
	at org.eclipse.rwt.internal.lifecycle.EntryPointManager.createUI(EntryPointManager.java:81)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle.createUI(RWTLifeCycle.java:204)
	at org.eclipse.rwt.internal.lifecycle.RWTLifeCycle$UIThreadController.run(RWTLifeCycle.java:88)
	at java.lang.Thread.run(Thread.java:636)
	at org.eclipse.rwt.internal.lifecycle.UIThread.run(UIThread.java:101)



Re: NullPointerException in SetPerspective [message #872254 is a reply to message #870993] Tue, 15 May 2012 19:19 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1296
Registered: July 2009
Senior Member

Hola Hugo,

our demo bundle org.eclipse.rap.demo contains different perspectives.
The bundle org.eclipse.rap.demo.databinding contributes another
perspective. Maybe you can spot the difference between your application
and this demo? Have you tried your application with RCP?

Saludos, Ralf

--
Ralf Sternberg

Twitter: @EclipseRAP
Blog: http://eclipsesource.com/blogs/

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: NullPointerException in SetPerspective [message #876059 is a reply to message #872254] Wed, 23 May 2012 20:31 Go to previous messageGo to next message
Hugo Herrera is currently offline Hugo HerreraFriend
Messages: 20
Registered: July 2009
Junior Member
Hola Ralf,

thanks for your response.

I did another try with a simple sample and it worked.

I will dig a little bit more on mine.

Gracias!
Re: NullPointerException in SetPerspective [message #886766 is a reply to message #876059] Fri, 15 June 2012 15:41 Go to previous messageGo to next message
Agnes Thanbichler is currently offline Agnes ThanbichlerFriend
Messages: 2
Registered: May 2012
Junior Member
Hola Hugo,

did you find out something more on this issue?

thanks,
Agnes
Re: NullPointerException in SetPerspective [message #910662 is a reply to message #886766] Mon, 10 September 2012 07:08 Go to previous message
Dmitrij Zavrid is currently offline Dmitrij ZavridFriend
Messages: 1
Registered: September 2012
Junior Member
Hi,

Had the same issue (rap version 1.5).
Helped to add configurer.setShowCoolBar(true) to resolve the issue.
public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {

	public ApplicationWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
		super(configurer);
	}

	@Override
	public void preWindowOpen() {
		IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
		// some how cool bar is required for rap to switch perspectives,
		// otherwise - NPE
		configurer.setShowCoolBar(true);
		
.....

[Updated on: Mon, 10 September 2012 07:09]

Report message to a moderator

Previous Topic:JFace ControlDecoration not consistent.
Next Topic:MESSAGE Exception in org.eclipse.ui.internal.PageLayout.addView
Goto Forum:
  


Current Time: Mon Dec 22 18:37:57 GMT 2014

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

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