Kundalini
Kundalini

Reputation: 11

Deploying a RAP .war file in jetty

I created an hello-world RAP application following the eclipse tutorial. I have no problems starting it in eclipse.

Now i want to package it as a .war file with maven and deploy it inside a jetty server. That's the point where i'm already unsure if it is the right approach. My .war file includes all RAP, equinox and maven plugins, a web.xml and a config.ini. I'm building it with Tycho but i'm open to other solutions.

config.ini:

#Product Runtime Configuration File
osgi.bundles=RapHello/BasicEntryPoint@start,\
  org.eclipse.core.commands@start,\
  org.eclipse.core.jobs@start,\
  org.eclipse.equinox.common@start,\
  org.eclipse.equinox.console@start,\
  org.eclipse.equinox.ds@start,\
  org.eclipse.equinox.http.registry@start,\
  org.eclipse.equinox.servletbridge.extensionbundle,\
  org.eclipse.equinox.http.servlet@start,\
  org.eclipse.equinox.http.servletbridge@start,\
  org.eclipse.equinox.registry@start,\
  org.eclipse.equinox.servletbridge@start,\
  org.eclipse.equinox.util@start,\
  org.eclipse.osgi.services@start,\
  org.eclipse.rap.jface@start,\
  org.eclipse.rap.rwt@start,\
  org.eclipse.rap.rwt.osgi@start,\
  raphello.BasicEntryPoint@start
osgi.bundles.defaultStartLevel=4

web.xml (copied from another sample .war):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app id="WebApp">
  <servlet id="bridge">  
    <servlet-name>equinoxbridgeservlet</servlet-name>
    <display-name>Equinox Bridge Servlet</display-name>
    <description>Equinox Bridge Servlet</description>
    <servlet-class>org.eclipse.equinox.servletbridge.BridgeServlet</servlet-class>

    <!-- Framework Controls could be useful for testing purpose, but
         we disable it per default -->
    <init-param>
      <param-name>enableFrameworkControls</param-name>
      <param-value>false</param-value>      
    </init-param>

    <!-- Enable multi-language support for the extension registry -->
    <!-- the OSGi console is useful for trouble shooting but will fill up your 
         appserver log quickly, so deactivate on production use. Uncomment
         the -console parameter to enabled OSGi console access.  -->
    <init-param>
      <param-name>commandline</param-name>
      <param-value>-registryMultiLanguage <!-- -console --></param-value>     
    </init-param>

    <load-on-startup>1</load-on-startup>    
  </servlet>

  <servlet-mapping>
    <servlet-name>equinoxbridgeservlet</servlet-name>
    <url-pattern>/*</url-pattern>
  </servlet-mapping>

</web-app>

When i deploy the file in my jetty server, i get no errors and it seems like the file gets picked up, but all i get are

HTTP ERROR 404
Problem accessing /hellorap. Reason:

  ProxyServlet: /hellorap

i think i tried all possible paths. What i read so far is, that the path should be the file name of my .war but that doesn't work.

jetty start log:

    INFO::main: Logging initialized @276ms to org.eclipse.jetty.util.log.StdErrLog
    INFO:oejs.Server:main: jetty-9.4.10.v20180503; built: 2018-05-03T15:56:21.710Z; git: daa59876e6f384329b122929e70a80934569428c; jvm 1.8.0_181-b13
    INFO:oejw.StandardDescriptorProcessor:main: NO JSP Support for /, did not find org.eclipse.jetty.jsp.JettyJspServlet
    INFO:oejs.session:main: DefaultSessionIdManager workerName=node0
    INFO:oejs.session:main: No SessionScavenger set, using defaults
    INFO:oejs.session:main: node0 Scavenging every 600000ms
    INFO:oejsh.ContextHandler:main: Started o.e.j.w.WebAppContext@561b6512{/,file:///C:/Users/USR/AppData/Local/Temp/jetty-0.0.0.0-8081-raphello.war-_-any-511053963228532950.dir/webapp/,AVAILABLE}{webapps/raphello.war}
    INFO:oejs.AbstractConnector:main: Started ServerConnector@2898ac89{HTTP/1.1,[http/1.1]}{0.0.0.0:8081}
    INFO:oejs.Server:main: Started @4477ms

So the question is: What am i doing wrong? Is it even the right approach?

This answer doesn't seem to work so my error is propably at an earlier stage.

Upvotes: 1

Views: 338

Answers (0)

Related Questions