如何在tomcat服务器上部署Gwt RPC servlet?

时间:2011-07-14 14:11:38

标签: gwt gwt-rpc

我的窗口xp服务器上有apache-tomcat-7.0.16和jdk1.6.0.25。我安装eclipse并从google网站复制stockwatcher的程序员。我编译程序并在eclipse开发模式下运行它运行正常。 eclipse创建war文件夹我在apache-tomcat-7.0.16 / webapps下复制这个war文件夹..然后我通过输入http://localhost:8080检查我的tomcat服务器:它正在运行并运行tomcat的servlet示例。然后我输入 http:// localhost:8080 / war / stockwatcher.html。它给出了一些java错误。然后再移动并复制,现在找不到错误页面。

war文件夹的内容是 图片 的StockWatcher WEB-INF stockwatcher.css stockwatcher.html

我认为我将文件复制到错误的位置,或者我必须配置tomcat

2 个答案:

答案 0 :(得分:0)

你说的这个java错误是什么? 你确定GWT库位于WEB-INF / lib文件夹中吗?这些是GWT-RPC机制运行所必需的。

请访问以下网站以供参考:

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/3408c38464c57d4a?pli=1

GWT app - deploying on Tomcat or any other servlet container

答案 1 :(得分:0)

不要使用该war文件夹将gwt应用程序部署到tomcat。不起作用。程序是: 1)gwt首先编译项目。 2)创建一个webbuilder.xml文件并将代码放在其中。

<project name="ExceptionReport" basedir="." default="default">

    <target name="default" depends="buildwar,deploy"></target>

    <target name="buildwar">
        <war basedir="war" destfile="
                    ExceptionReport.war" webxml="war/WEB-INF/web.xml">
        <exclude name="WEB-INF/**" />
        <webinf dir="war/WEB-INF/">
            <include name="**/*.jar" />
        </webinf>
       </war>
     </target>

     <target name="deploy">
    <copy file="ExceptionReport.war" todir="." />
      </target>

</project>

ExceptionReport是我的项目名称。

3)将src文件夹导出为JAR文件并将其保存在war&gt; webinf&gt; lib中。 4)右键单击Web构建器文件,然后选择ant build选项。它会在你的项目中生成一个war文件。 5)将该war文件放在tomcat上。并重新启动你的tomcat。

相关问题