Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RAP 2.1 + Virgo 3.6.2: illegalState Exception
RAP 2.1 + Virgo 3.6.2: illegalState Exception [message #1067161] Sat, 06 July 2013 22:23 Go to next message
Tobias P. is currently offline Tobias P.Friend
Messages: 43
Registered: April 2012
Member
Hello guys,

i managed to get RAP working on Virgo following this this tutorial:

http://eclipsesource.com/blogs/tutorials/developing-web-application-bundles-with-rap-and-virgo/

Now i want to step further, and create an Eclipse Workbench Application, but when i access virgo i get the following exception:

2013-07-07 00:12:55.694] WARN  qtp1716158245-89             org.eclipse.jetty.servlet.ServletHandler                          /daios java.lang.IllegalStateException: No context available outside of the request processing.
	at org.eclipse.rap.rwt.internal.service.ContextProvider.getContext(ContextProvider.java:95)
	at org.eclipse.rap.rwt.internal.service.ContextProvider.getUISession(ContextProvider.java:183)
	at org.eclipse.swt.widgets.Display.setAppVersion(Display.java:2161)
	at org.eclipse.ui.internal.Workbench.createDisplay(Workbench.java:723)
	at org.eclipse.ui.PlatformUI.createDisplay(PlatformUI.java:168)
	at de.hswt.daios.ui.core.DaiosApplication.createUI(DaiosApplication.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:136)
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.handlePostRequest(LifeCycleServiceHandler.java:122)
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.synchronizedService(LifeCycleServiceHandler.java:75)
	at org.eclipse.rap.rwt.internal.service.LifeCycleServiceHandler.service(LifeCycleServiceHandler.java:66)
	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.rap.rwt.osgi.internal.CutOffContextPathWrapper.service(CutOffContextPathWrapper.java:106)
	at org.eclipse.equinox.http.servlet.internal.ServletRegistration.service(ServletRegistration.java:61)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.processAlias(ProxyServlet.java:128)
	at org.eclipse.equinox.http.servlet.internal.ProxyServlet.service(ProxyServlet.java:60)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:848)
	at org.eclipse.equinox.http.jetty.internal.HttpServerManager$InternalHttpServiceServlet.service(HttpServerManager.java:386)
	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.session.SessionHandler.doHandle(SessionHandler.java:229)
	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.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.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.AsyncHttpConnection.handle(AsyncHttpConnection.java:82)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint.handle(SelectChannelEndPoint.java:628)
	at org.eclipse.jetty.io.nio.SelectChannelEndPoint$1.run(SelectChannelEndPoint.java:52)


I have read the FAQ, but i am a bit confused, becaus i dont do anything regarding the context (I believe...)

Here is my EntryPoint

public class MyApplication implements EntryPoint {

	@Override
	public int createUI() {

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

}


Application WorkbenchSdvisor

public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {

	private static final String PERSPECTIVE_ID = "de.hswt.daios.ui.search.perspective";

	public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(
			IWorkbenchWindowConfigurer configurer) {
		return new ApplicationWorkbenchWindowAdvisor(configurer);
	}

	public String getInitialWindowPerspectiveId() {
		return PERSPECTIVE_ID;
	}

}


ApllicationConfiguration

public class DaiosApplicationConfiguration implements ApplicationConfiguration {

	@Override
	public void configure(Application application) {
		Map<String, String> properties = new HashMap<String, String>();
		properties.put(WebClient.PAGE_TITLE, "DAIOS");
		application.addEntryPoint("/daios", DaiosApplication.class, properties);
	}

}


Plugin.xml

<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.4"?>
<plugin>
   <extension
         id="id1"
         point="org.eclipse.core.runtime.applications">
      <application
            cardinality="singleton-global"
            thread="main"
            visible="true">
         <run
               class="de.hswt.daios.ui.core.DaiosApplication">
         </run>
      </application>
   </extension>
   <extension
         point="org.eclipse.ui.perspectives">
      <perspective
            class="de.hswt.daios.ui.core.perspective.SearchPerspective"
            id="de.hswt.daios.ui.search.perspective"
            name="DAIOS">
      </perspective>
   </extension>
   <extension
         point="org.eclipse.ui.views">
      <view
            allowMultiple="false"
            class="de.hswt.daios.ui.core.view.DaiosSearchView"
            id="de.hswt.daios.ui.view.search.DaiosSearchView"
            name="DAIOS"
            restorable="true">
      </view>
   </extension>
   <extension
         point="org.eclipse.ui.perspectiveExtensions">
      <perspectiveExtension
            targetID="de.hswt.daios.ui.search.perspective">
         <view
               closeable="false"
               id="de.hswt.daios.ui.view.search.DaiosSearchView"
               minimized="false"
               moveable="false"
               ratio="0.35"
               relationship="left"
               relative="org.eclipse.ui.editorss"
               showTitle="false"
               standalone="false"
               visible="true">
         </view>
      </perspectiveExtension>
   </extension>
</plugin>


If you need more information please feel free to ask.

Thanks in advance
Tobias
Re: RAP 2.1 + Virgo 3.6.2: illegalState Exception [message #1067521 is a reply to message #1067161] Tue, 09 July 2013 08:20 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Tobias,

you're trying to start a Workbench-based application with an
ApplicationConfiguration. This is not going to work. Workbench
applications must be configured using entrypoint and branding extensions
in a plugin.xml.

ApplicationConfiguration is used to configure lightweight applications,
i.e. those without Workbench and extension registry.

Regards,
Ralf

--
Ralf Sternberg

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RAP 2.1 + Virgo 3.6.2: illegalState Exception [message #1067717 is a reply to message #1067161] Wed, 10 July 2013 09:36 Go to previous message
Tobias P. is currently offline Tobias P.Friend
Messages: 43
Registered: April 2012
Member
Hello Ralf,

thank you for your answer. It seems i am still having a problem understanding the combination Virgo Jetty + Eclipse RAP

First of all i got it working using the following plugins and deploying my application as an OSGi Bundle (as a jar not WEB or something...)

 
                                             org.eclipse.rap.rwt_2.0.0.20130205-1612.jar
org.eclipse.rap.rwt.osgi_2.0.0.20130110-2216.jar    org.eclipse.rap.ui_2.0.0.20121230-1109.jar
org.eclipse.rap.ui.forms_2.0.0.20130111-1314.jar
org.eclipse.rap.ui.views_2.0.0.20130111-1314.jar
org.eclipse.rap.ui.workbench_2.0.0.20130107-1035.jar
org.eclipse.equinox.http.jetty_3.0.1.v20121109-203239.jar      
org.eclipse.equinox.http.registry_1.1.200.v20120522-2049.jar   
org.eclipse.equinox.http.servlet_1.1.300.v20120522-1841.jar    
org.eclipse.equinox.http.servlet_1.1.300.v20120912-130548.jar 


The ApplicationConfiguration approach works, because i am using the following DS

<?xml version="1.0" encoding="UTF-8"?>
<scr:component xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0" name="Component Definition">
  <implementation class="de.hswt.daios.ui.core.configuration.DaiosApplicationConfiguration"/>
  <service>
     <provide interface="org.eclipse.rap.rwt.application.ApplicationConfiguration"/>
  </service>
  <property name="contextName" type="String" value="daios"/>
</scr:component>


Are there further steps required to make virgo recognize my .jar as a plugin and process the plugin.xml?


Previous Topic:RAP-2.1 How to display image on the loading page?
Next Topic:Drawing combo in workbench
Goto Forum:
  


Current Time: Thu Apr 18 09:07:30 GMT 2024

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

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

Back to the top