RWT Standalone - WEB.XML help [message #1277770] |
Wed, 26 March 2014 12:52 |
|
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 #1277814 is a reply to message #1277807] |
Wed, 26 March 2014 13:59 |
|
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 #1278427 is a reply to message #1278414] |
Thu, 27 March 2014 10:24 |
|
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
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03536 seconds