在码头部署RAP .war文件

时间:2018-12-07 11:10:51

标签: maven jetty war tycho eclipse-rap

在eclipse教程之后,我创建了一个hello-world RAP应用程序。我在eclipse中启动它没有问题。

现在,我想使用maven将其打包为.war文件,并将其部署在码头服务器内。那就是我已经不确定这是否是正确方法的地方。 我的.war文件包括所有RAP,Equinox和Maven插件,一个web.xml和一个config.ini。我正在用Tycho构建它,但我愿意接受其他解决方案。

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(从另一个示例.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>

当我在码头服务器中部署文件时,我没有收到任何错误,文件似乎被捡起了,但是我得到的只是

HTTP ERROR 404
Problem accessing /hellorap. Reason:

  ProxyServlet: /hellorap

我认为我尝试了所有可能的路径。到目前为止,我读到的是该路径应该是我的.war的文件名,但这不起作用。

码头开始记录:

    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

所以问题是:我在做什么错?甚至是正确的方法吗?

This answer似乎不起作用,所以我的错误很可能在早期。

0 个答案:

没有答案