Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RCP to RAP Example - Error
RCP to RAP Example - Error [message #1174830] Thu, 07 November 2013 05:39 Go to next message
Clément Chausson is currently offline Clément Chausson
Messages: 13
Registered: November 2013
Junior Member
Hi,

I tried to convert a RCP Application To RAP Application with the RCP Mail Template

I used this tutorial for help.

My EntryPoint code is the following:
package org.eclipse.rap.demo.mail;


import org.eclipse.rap.rwt.application.EntryPoint;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.application.WorkbenchAdvisor;


public class MailApplication implements EntryPoint  {

	public int createUI() {
		Display display = PlatformUI.createDisplay();
	      WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
	      return PlatformUI.createAndRunWorkbench( display, advisor );
	  }
}


But when I run this project as RWT Application I have this error:
Quote:
HTTP ERROR 500

Problem accessing /rap. Reason:

Server Error

Caused by:

java.lang.NullPointerException
at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:716)
at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:168)
at org.eclipse.rap.demo.mail.MailApplication.createUI(MailApplication.java:13)
at org.eclipse.rap.rwt.internal.lifecycle.PrepareUIRoot.execute(PrepareUIRoot.java:39)
at org.eclipse.rap.rwt.internal.lifecycle.PhaseExecutor.execute(PhaseExecutor.java:35)
at org.eclipse.rap.rwt.internal.lifecycle.SimpleLifeCycle.execute(SimpleLifeCycle.java:51)
at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.runLifeCycle(LifeCycleServiceHandler.java:139)
at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.handlePostRequest(LifeCycleServiceHandler.java:125)
at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.synchronizedService(LifeCycleServiceHandler.java:76)
at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.service(LifeCycleServiceHandler.java:67)
at org.eclipse.rap.rwt.engine.RWTServlet.handleValidRequest(RWTServlet.java:119)
at org.eclipse.rap.rwt.engine.RWTServlet.handleRequest(RWTServlet.java:106)
at org.eclipse.rap.rwt.engine.RWTServlet.doPost(RWTServlet.java:99)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:457)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
at org.eclipse.jetty.server.Server.handle(Server.java:368)
at org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
at org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
at org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:953)
at org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1014)
at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:861)
at org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
at org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
at org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
at java.lang.Thread.run(Unknown Source)


I think that the problem comes from
PlatformUI.createDisplay();
but I'm not sure and I have not found any solution on this forum or on Internet.

If you have ideas or solutions please tell me.

Thank you for your help
Re: RCP to RAP Example - Error [message #1175141 is a reply to message #1174830] Thu, 07 November 2013 09:52 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1691
Registered: July 2009
Senior Member
Hi Clément,
workbench (OSGi) based application can't be run with RWT Launcher. You
have to create RAP launch configuration. See [1].
As a start use File -> New -> Plugin Project and create your first RAP
application with workbench based on "RAP Mail Template".

[1]
http://eclipse.org/rap/developers-guide/devguide.php?topic=launcher.html&version=2.1
HTH,
Ivan

On 11/7/2013 3:50 PM, Clément Chausson wrote:
> Hi,
>
> I tried to convert a RCP Application To RAP Application with the RCP
> Mail Template
>
> I used this http://wiki.eclipse.org/RCP_to_RAP_Migration_Example for
> help.
>
> My EntryPoint code is the following:
> package org.eclipse.rap.demo.mail;
>
>
> import org.eclipse.rap.rwt.application.EntryPoint;
> import org.eclipse.swt.widgets.Display;
> import org.eclipse.ui.PlatformUI;
> import org.eclipse.ui.application.WorkbenchAdvisor;
>
>
> public class MailApplication implements EntryPoint {
>
> public int createUI() {
> Display display = PlatformUI.createDisplay();
> WorkbenchAdvisor advisor = new ApplicationWorkbenchAdvisor();
> return PlatformUI.createAndRunWorkbench( display, advisor );
> }
> }
>
> But when I run this project as RWT Application I have this error:
> Quote:
>> HTTP ERROR 500
>>
>> Problem accessing /rap. Reason:
>>
>> Server Error
>>
>> Caused by:
>>
>> java.lang.NullPointerException
>> at
>> org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:716)
>> at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:168)
>> at
>> org.eclipse.rap.demo.mail.MailApplication.createUI(MailApplication.java:13)
>> at
>> org.eclipse.rap.rwt.internal.lifecycle.PrepareUIRoot.execute(PrepareUIRoot.java:39)
>> at
>> org.eclipse.rap.rwt.internal.lifecycle.PhaseExecutor.execute(PhaseExecutor.java:35)
>> at
>> org.eclipse.rap.rwt.internal.lifecycle.SimpleLifeCycle.execute(SimpleLifeCycle.java:51)
>> at
>> org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.runLifeCycle(LifeCycleServiceHandler.java:139)
>> at
>> org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.handlePostRequest(LifeCycleServiceHandler.java:125)
>> at
>> org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.synchronizedService(LifeCycleServiceHandler.java:76)
>> at
>> org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.service(LifeCycleServiceHandler.java:67)
>> at
>> org.eclipse.rap.rwt.engine.RWTServlet.handleValidRequest(RWTServlet.java:119)
>> at
>> org.eclipse.rap.rwt.engine.RWTServlet.handleRequest(RWTServlet.java:106)
>> at org.eclipse.rap.rwt.engine.RWTServlet.doPost(RWTServlet.java:99)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:755)
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
>> at
>> org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:669)
>> at
>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:457)
>> at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:137)
>> at
>> org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:557)
>> at
>> org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:231)
>> at
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1075)
>> at
>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:384)
>> at
>> org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:193)
>> at
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1009)
>> at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:135)
>> at
>> org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:255)
>> at
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:116)
>> at org.eclipse.jetty.server.Server.handle(Server.java:368)
>> at
>> org.eclipse.jetty.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:489)
>> at
>> org.eclipse.jetty.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:53)
>> at
>> org.eclipse.jetty.server.AbstractHttpConnection.content(AbstractHttpConnection.java:953)
>> at
>> org.eclipse.jetty.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:1014)
>> at org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:861)
>> at
>> org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:240)
>> at
>> org.eclipse.jetty.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:72)
>> at
>> org.eclipse.jetty.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:264)
>> at
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:608)
>> at
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:543)
>> at java.lang.Thread.run(Unknown Source)
>
>
> I think that the problem comes from PlatformUI.createDisplay(); but
> I'm not sure and I have not found any solution on this forum or on
> Internet.
>
> If you have ideas or solutions please tell me.
>
> Thank you for your help

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RCP to RAP Example - Error [message #1176889 is a reply to message #1175141] Fri, 08 November 2013 11:21 Go to previous message
Clément Chausson is currently offline Clément Chausson
Messages: 13
Registered: November 2013
Junior Member
Hi Ivan,

Thanks for you answer.

I finally find a solution to my problem

I needed to create a RAP Run configuration for my project (in Run > Run Configuration)

Once it is done i run my application by Run As > RAP Application and i choosed the configuration previously created.

Regards,

CC

[Updated on: Fri, 08 November 2013 11:24]

Report message to a moderator

Previous Topic:WorkbenchAdvisor SHOW_SYSTEM_JOBS
Next Topic:How to set the different border width in theme css ?
Goto Forum:
  


Current Time: Fri Apr 18 11:48:39 EDT 2014

Powered by FUDForum. Page generated in 0.02263 seconds