how do I deploy my gwt application to the tomcat server?
found nothing...
greetz from germany
if your question is how to i build a non-trivial gwt web application
archive (ie. war) that can be deployed into tomcat then consider
looking at:
1. (from http://juls.googlecode.com/svn/trunk/build.xml)
<target name="build" depends="compile, compileJs">
<antcall target="buildLibs" />
<antcall target="buildWar" />
</target>
<target name="buildWar" depends="buildLibs">
<antcall target="cleanDebug" />
<mkdir dir="${milestone.dir}" />
<copy todir="${build.dir}/tmp.web-inf-lib" flatten="true">
<fileset dir="${cm-assemblies.lib.dir}"
excludes="**/*-javadocs.jar">
<include name="gems-gwt-user/gems-gwt-rpc-1.0.21.jar"/>
<include name="gems/gems-svc-api.jar"/>
<include name="gems/gems-server.jar"/>
<include name="log4j/log4j-1.2.8.jar"/>
<include name="commons-fileupload/commons-fileupload-1.1-RC2.jar"/>
<include name="commons-io/commons-io-1.2.jar"/>
<include name="commons-lang/commons-lang-2.1-RC8.jar"/>
</fileset>
</copy>
<war warfile="${milestone.dir}/${war.name}" webxml="${web.xml}">
<fileset dir="${webapp.dir}" />
<lib dir="${build.dir}/tmp.web-inf-lib" />
<lib dir="${libs.dir}" />
</war>
<delete includeEmptyDirs="true" failonerror="false">
<fileset dir="${build.dir}/tmp.web-inf-lib" />
</delete>
</target>
<target name="compileJs" depends="compile, cleanForJs">
<copy todir="${webapp.dir}/${gwt-xml-ep.name}">
<fileset dir="${gem-appl-public.dir}" includes="**/*"/>
</copy>
<java classpathref="js.build.classpath"
classname="com.google.gwt.dev.GWTCompiler"
fork="true">
<arg value="-out"/>
<arg value="${webapp.dir}"/>
<arg value="${gwt-xml-ep.name}"/>
<!--
Every now and then you will need uncomment the following to be
able
to debug FF in Venkman to remove a gwt-user-lib bug that only
manifests itself in non IE browsers.
<arg value="-style"/>
<arg value="DETAILED"/>
-->
</java>
<move todir="${webapp.dir}">
<fileset dir="${webapp.dir}/${gwt-xml-ep.name}">
<include name="jump.css"/>
<include name="images/**" />
</fileset>
</move>
</target>
alternatively, if your question is how to i deploy a jee application
into tomcat, then tomcat versions will play a roll here. i have two
examples based on tomcat 5.5.9 release:
approach 1.
1. first take a look at my server.xml. u will notice that there is
bugger all in here:
http://juls.googlecode.com/svn/trunk/dist/jakarta-tomcat-5.5.9/conf/server.xml
2. i mounted my application into tomcat's root context. that means my
application does not need a root context to get signalled. Take a look
at my ROOT.xml:
http://juls.googlecode.com/svn/trunk/dist/jakarta-tomcat-5.5.9/conf/Catalina/localhost/ROOT.xml
you will notice that my non-debug context has the following docBase
value: docBase="${catalina.home}/../bin/juls.war"
this means that on tomcat boot, it will extract juls.war from the
specified location into tomcat's ${catalina.home}/webapps folder if it
as not already been extracted
approach 2.
If i change the docBase value (which i do to debug the server code) to
docBase="${catalina.home}/../../webapp", then it will use my source
rather than a built package.
rgds ash
http://www.gworks.com.au/
self help sources:
1. http://javaongems.org/ -> http://code.google.com/p/javaongems/
2. http://code.google.com/p/gems-gwt-user/
3. http://code.google.com/p/juls/
Normally there are 2 parts:
- client-part
- server-part
I think in most cases tomcat is used as webserver.
there the root for deploying is in:
<path-to-tomcat-host>/webapps/<application-dir>/
there should be a dir for the html/js things ... let us call it
"hellogwt"
so you get the following structure
./hellogwt
./WEB_INF
./WEB_INF/lib
./WEB_INF/classes
where lib and classes are the places for all that is needed for the
Servlet
All that should be put into file <application-dir>.war
and this file should be copied to the webapps-dir.
A Tomcat with an enhanced management can be found at:
http://centaurus.sourceforge.net/home.html
Centaurus-Platform makes tomcat very much easyier ...
If i undestood properly, These are the basic primitive steps needed to
get ur GWT app runnng on a stand-alone Tomcat.
1. Put the gwt released jars in ur project classpath. Compile ur
project and copy the classes to tomcat WEB-INF / classes folder.
2. Run <urAppName>-compile.cmd file, it will generate the javascript
from ur java source, needed to be deployed in tomcat.
Obviously this cmd file should contain the proper path of ur
project src, classes and all the referenced jars including gwt jars.
3. This cmd file emits lots of .cache, html and xml files in www /
xyz.123.bla.bla.html folder (ur module name).Copy all these files
in tomcat parallel to WEB-INF directory. Map ur servlet in web.xml
file, this mapping should coincide with service entry point u
have specified in ur gwt app rpc calls to the servlet.
4. Now start ur tomcat and run ur application like a normal web
application. Its done.