Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » RWT Standalone - WEB.XML help(Content of WEB.XML for RWT Standalone)
RWT Standalone - WEB.XML help [message #1277770] Wed, 26 March 2014 08:52 Go to next message
John Gymer is currently offline John Gymer
Messages: 185
Registered: November 2012
Location: UK
Senior Member
I am trying to get a RAP/Tabris application running as RWT Standalone (i.e. without OSGi), initially from within Eclipse IDE, but ultimately to package as a WAR to deploy in an AppServer (WebLogic, WebSphere, JBoss etc.).

I can run the RWT Standalone from Eclipse using an Entry Point on the Run Config pointing directly to my Entry Point class, but cannot get it to work with a web.xml.

Perhaps the content of the web.xml needs to be altered, and is currently based on the dev docs for RAP:
http://www.eclipse.org/rap/developers-guide/devguide.php?topic=launcher.html&version=2.2#rwt-launcher
and:
http://www.eclipse.org/rap/developers-guide/devguide.php?topic=rwt-standalone.html&version=2.2

Is this information still up-to-date? Specifically this:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
  version="2.4">

  <context-param>
    <param-name>org.eclipse.rap.applicationConfiguration</param-name>
    <param-value>uk.co.iet.rapide.tabris.Configuration</param-value>
  </context-param>

  <listener>
    <listener-class>org.eclipse.rap.rwt.engine.RWTServletContextListener</listener-class>
  </listener>

  <servlet>
    <servlet-name>rwtServlet</servlet-name>
    <servlet-class>org.eclipse.rap.rwt.engine.RWTServlet</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>rwtServlet</servlet-name>
    <url-pattern>/test</url-pattern>
  </servlet-mapping>
</web-app> 


This always gives me a 503:

HTTP ERROR: 503

Problem accessing /test. Reason:

    Service Unavailable


My Configuration Class looks like this:

public class Configuration implements ApplicationConfiguration {
	public void configure( Application application ) {
		bootstrapTabris( application );
		Map<String,String>epProps = new HashMap<String, String>();
		epProps.put("title", "Rapide Application");
		application.addEntryPoint( "/test", TABRISEntryPoint_Test.class, epProps );
		application.addStyleSheet(RWT.DEFAULT_THEME_ID, "WEB-INF/css/rapideTheme.css");
	}
	
	private void bootstrapTabris( Application application ) {
		TabrisClientInstaller.install(application);
	}
}


Perhaps this cannot be done with Tabris? This is Tabris 1.4 nightly server and RAP 2.3 nightly from a couple of days ago.

I also noticed that although I can connect ok to RWT Standalone by specifying my EntryPoint (not using web.xml), I couldn't get a mobile Tabris client to connect to it - only browser. Possibly a different issue.

I presume that I'll be able to use my custom theme this way (using web.xml), and also to be able to specify multiple entry points? This is important for our apps. I notice the comment below in the RAP docs about using RWT Launcher (worries me a bit about using RWT without OSGi):
Consequentially, this method does not allow multiple entry points or any customization of the application (e.g. using a custom theme).


Help on the web.xml questions are the priority though, so thoughts welcome.
John


---
Just because you can doesn't mean you should
Re: RWT Standalone - WEB.XML help [message #1277807 is a reply to message #1277770] Wed, 26 March 2014 09:47 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1782
Registered: July 2009
Senior Member
Hi John,
your web.xml and application configuration look good. I've just created
a simple "hello world" standalone application based on RAP from master
and it's working fine. In RWT launch config window I've selected "Run
from web.xml" (located in WEB-INF directory). I assume that you have rwt
bundle in "lib" directory under WEB-INF. Does your standalone
application work in browser (probably without Tabris installation code)?
Best,
Ivan

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RWT Standalone - WEB.XML help [message #1277814 is a reply to message #1277807] Wed, 26 March 2014 09:59 Go to previous messageGo to next message
John Gymer is currently offline John Gymer
Messages: 185
Registered: November 2012
Location: UK
Senior Member
Hi Ivan,
I included the org.eclipse.rap.rwt_2.3.0.20140321-1606.jar file under WEB-INF/lib.
My web.xml is in WEB-INF, as you state.
This combination gives the 503 error.
I have no Extensions or Extension Points defined in the project at all - didn't think these were used since it is supposed to be called my Application's Configuration Class code.
I know it is using the web.xml because if I change "org.eclipse.rap.applicationConfiguration" in there to something invalid, the error changes to a 500.
Any other ideas?
Thanks, John



---
Just because you can doesn't mean you should
Re: RWT Standalone - WEB.XML help [message #1278414 is a reply to message #1277814] Thu, 27 March 2014 05:59 Go to previous messageGo to next message
John Gymer is currently offline John Gymer
Messages: 185
Registered: November 2012
Location: UK
Senior Member
Perhaps I'm confused about my port... what port does the RWTServlet listen on?

My Run Configuration looks like this (I prefer to use port 9090 for my testing, which has been fine for OSGi, but I specify that explicitly on startup for OSGi... where is the equivalent for RWTServlet? I think this is probably the piece I am missing.

index.php/fa/17847/0/

Thx
John
  • Attachment: RWTPort.jpg
    (Size: 176.29KB, Downloaded 78 times)


---
Just because you can doesn't mean you should
Re: RWT Standalone - WEB.XML help [message #1278427 is a reply to message #1278414] Thu, 27 March 2014 06:24 Go to previous messageGo to next message
John Gymer is currently offline John Gymer
Messages: 185
Registered: November 2012
Location: UK
Senior Member
Have moved on a little... part of the problem was related to not having SLF4J logging JARs available. I don't understand why, but I guess there is something using by the RWTServlet/contextlistener that requires this?

Anyway, with those jars added, I now get successful connection in browser and Tabris client, which leaves me (I think) with just one remaining issue under RWT standalone - I cannot use a custom theme CSS.

As soon as I put in this statement in my Entry Point:

application.addStyleSheet(RWT.DEFAULT_THEME_ID, "WEB-INF/css/rapideTheme.css");


It complains it cannot find the css file, and doesn't start the servlet properly - nothing connects.

This is the full console output:

SLF4J: Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError. 
SLF4J: See also http://www.slf4j.org/codes.html#log4jDelegationLoop for more details.
2014-03-27 10:23:02.465:INFO:oejs.Server:jetty-8.1.14.v20131031
2014-03-27 10:23:02.653:INFO:oejw.StandardDescriptorProcessor:NO JSP Support for /, did not find org.apache.jasper.servlet.JspServlet
2014-03-27 10:23:02.893:WARN:oejw.WebAppContext:Failed startup of context o.e.j.w.WebAppContext{/,file:/C:/JVM/eclipse44/Rapide1.0/.metadata/.plugins/org.eclipse.rap.tools.launch.rwt/Rapide%20Tabris%20RWT/web-app/},C:\JVM\eclipse44\Rapide1.0\.metadata\.plugins\org.eclipse.rap.tools.launch.rwt\Rapide Tabris RWT\web-app
java.lang.IllegalArgumentException: Could not open resource WEB-INF/css/rapideTheme.css
	at org.eclipse.rap.rwt.internal.theme.css.CssFileReader.readStyleSheet(CssFileReader.java:56)
	at org.eclipse.rap.rwt.internal.application.ApplicationImpl.readStyleSheet(ApplicationImpl.java:170)
	at org.eclipse.rap.rwt.internal.application.ApplicationImpl.addStyleSheet(ApplicationImpl.java:130)
	at org.eclipse.rap.rwt.internal.application.ApplicationImpl.addStyleSheet(ApplicationImpl.java:122)
	at uk.co.iet.rapide.tabris.Configuration.configure(Configuration.java:28)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextImpl.doActivate(ApplicationContextImpl.java:328)
	at org.eclipse.rap.rwt.internal.application.ApplicationContextImpl.activate(ApplicationContextImpl.java:205)
	at org.eclipse.rap.rwt.application.ApplicationRunner.start(ApplicationRunner.java:82)
	at org.eclipse.rap.rwt.engine.RWTServletContextListener.contextInitialized(RWTServletContextListener.java:50)
	at org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:782)
	at org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:424)
	at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:774)
	at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:249)
	at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1221)
	at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:717)
	at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:454)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
	at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:229)
	at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:172)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
	at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:95)
	at org.eclipse.jetty.server.Server.doStart(Server.java:282)
	at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:64)
	at org.eclipse.rap.tools.launch.rwt.internal.jetty.JettyLauncher.main(JettyLauncher.java:37)
2014-03-27 10:23:02.908:INFO:oejs.AbstractConnector:Started SocketConnector@0.0.0.0:9090


I assume that I can in principle use a CSS under RWT standalone? Perhaps my path is wrong, but it is the same relative path that I use to load other files/resources.


---
Just because you can doesn't mean you should
Re: RWT Standalone - WEB.XML help [message #1278437 is a reply to message #1278427] Thu, 27 March 2014 06:37 Go to previous messageGo to next message
Ivan Furnadjiev is currently offline Ivan Furnadjiev
Messages: 1782
Registered: July 2009
Senior Member
Hi Jonh,
your theme contribution and all related resources must be under "src"
folder. Set the theme as:
application.addStyleSheet(RWT.DEFAULT_THEME_ID, "css/rapideTheme.css");
HTH,
Ivan

--
Ivan Furnadjiev

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

Professional services for RAP and RCP?
http://eclipsesource.com/services/rap/
Re: RWT Standalone - WEB.XML help [message #1278472 is a reply to message #1278437] Thu, 27 March 2014 07:32 Go to previous message
John Gymer is currently offline John Gymer
Messages: 185
Registered: November 2012
Location: UK
Senior Member
That's it! Thanks Ivan.
Next thing is to get the RWT standalone packaged as a WAR to deploy in WebSphere... argh - probably a new post for that one!


---
Just because you can doesn't mean you should
Previous Topic:Rap incubator DropDown/Autosuggest fine tuning
Next Topic:IE8 & Autosuggest does not work
Goto Forum:
  


Current Time: Tue Jul 29 21:04:02 EDT 2014

Powered by FUDForum. Page generated in 0.02700 seconds