|
gwtTomcatWarBuilder
gwt Tomcat War Builder
Deprecated This PageI am going to stop support on the TomcatWarBuilder shortly. I didn't realize at the time that Ant could do the job so much better. Google has come up with an excellent system in 1.6+. I am excited about using future releases because of the entire change.
AntWarBuilding - New Location to goto for building projectReferencesgwtTomcat - gwt tomcat setup Tomcat War BuilderAuto Build or Compile a GWT project for tomcat server. Compile your project in a ready to go War archive. Deploy it by uploading the war file to your tomcat server. Quickly deploy your application for testing.
Easy Setup and RunExample setup of a main class that runs the builder. public class Run_WarBuilder_RpcBasic {
/**
* run this from console or debug configuration in eclipse
*
* @param args
*/
public static void main(String[] args) {
// refer to this object for variable options
WarBuilderData data = new WarBuilderData();
// choose your operating system
// [0=linux, 1=windows]
data.os = 0;
// project directory (examples below)
data.projectDirectory = "/home/branflake2267/workspace/gwt-test-RPC-basic";
// rename war file to [ROOT.war | project.war]
// ROOT.war is the virtual host root servlet context "/"
data.renameWarFile = false; //true = turn on will rename the servlet context (filename)
// if renameWarFile = true then rename to:
data.renameWarFileNameTo = "ROOT.war";
/********** OPTIONAL ***********/
// go to application instead of going to index.jsp true is recommended
data.goDirectlyToApplication = true;
// Ask for credentials to use application
data.askForLogin = false;
data.deleteTempFolder = false;
/********** OPTIONAL ***********/
// set up the object that will build the war
TomcatWarBuilder build = new TomcatWarBuilder();
build.setTomcatCompileData(data);
build.start();
}
}Builder Options: public class WarBuilderData {
// operating system
// [0:linux, 1:windows]
public int os = 0;
// project directory - absolute path to your project root
public String projectDirectory;
// rename war file at end
public boolean renameWarFile = true;
// rename war file to [ROOT.war | project.war]
// ROOT.war is the virtual host root servlet context "/"
public String renameWarFileNameTo = "ROOT.war";
/********** OPTIONAL ***********/
// temp build folder
public String tempBuildFolderName = "production";
// Ask for credentials to use gwt application
public boolean askForLogin = false;
public boolean deletetempBuildFolder = true;
//default location is project root. Set this for another location
//set with no trailing slash like "/home/branflake2267/warFiles"
//private String TempWarFileLocation = "/home/branflake2267";
public String tempWarFileLocation = null;
// after all done - delete the temp folder
public boolean deleteTempFolder = true;
// go to application instead of going to index.jsp - true is recommended
// you can set this to false if you want, when you intend to include your compilation of code to another site,
// although, you can directly copy the code from the www directory and include it in your sites setup
public boolean goDirectlyToApplication = true;
/********** OPTIONAL END ***********/
}
|
► Sign in to add a comment
I am a newbe and would really appreciate a more detailed set of instructions.
Yes I should know this but I do not.
For example first instruction is import this project into Eclipse. Sounds dumb but how do I do that?
Good point.
hmm, that will take me a little bit to go through svn then importing it.
Add Subversion to eclipse > Set SVN Connector > File > Import > From SVN > Setup new repository | select repository > Select folder from trunk > import.
I will work on a more detailed version later.
Comment by kostyando, Today (moments ago)
Hi,
what is ProjectClassName? I get null for it. This is my compile file:
@java -Xmx256M -cp "%~dp0\src;%~dp0\bin;D:/gwt-1.5.3/gwt-user.jar;D:/gwt-1.5.3/gwt-dev-windows.jar" com.google.gwt.dev.GWTCompiler -out "%~dp0\www" % com.google.gwt.sample.stockwatcher.StockWatcher?
And this is a correspondent pattern from your application: "\"\\$@\"\040(.?);". I'm not good familiar with reg-exp and I cannot understand, what should I change here?
Thank you beforehand
I rewrote the code. I am hoping that I solved the regex issue. I rewrote the file path separation so it would work on windows too. I haven't tested it on windows yet. The linux version works great. I added alot more error checking for helps.
I have tested it on windows, and have rewrote the regexp. It works great.
A simple set of real instructions to successfully run the "script" would be handy!
Thanks a bunch.
I couldn't agree more. I think this weekend I will work that up.
By the way, I am having some issues with Windows compiling and running it on linux tomcat. I will figure this out shortly as its a real need for me.
Hi,
I tried to create a sample application on RPC and built the war using TomcatWarBuilder? project (http://code.google.com/p/gwt-examples/wiki/ gwtTomcatWarBuilder) and deployed the war in Tomcat server. I have also setup security.AllPermission? in catalina.policy file as specfied in http://code.google.com/p/gwt-examples/wiki/gwtTomcat. But I'm getting 404 status error while the RPC call is made to server class. I verified web.xml in the war as well gwt.xml and everything seems to be good. I tried building test-gwt-MySQLConn project from SVN and got the same error. Kindly help me to resolve this issue.
Here are the details.
OS: Windows Tomcat : 6.0 jre : 1.6
Code snippets
ConnectionService?.java
public interface ConnectionService? extends RemoteService? {
}
ConnectionServiceAsync?.java
public interface ConnectionServiceAsync? {
}
ConnectionServiceImpl?.java
public class ConnectionServiceImpl? extends RemoteServiceServlet? implements ConnectionService? {
();
appModulesImpl.getApplicationModules();}
TestUI.gwt.xml
<servlet path="/ConnectionService?" class="com.nce.qc.server.services.ConnectionServiceImpl?"/>
RPC Call
private void rpcInit() { (ConnectionService?.class);
"ConnectionService?";
web.xml
<servlet> servlet-class> - <!-- url/path to servlet class and mapping - <servlet-mapping>
catalina.policy
grant codeBase "file:${catalina.home}/webapps/-" { "connect";
};
grant codeBase "file:${catalina.home}/webapps/-" {
};
Error description
com.google.gwt.user.client.rpc.StatusCodeException?: HTTP Status 404 - /TestUI/ConnectionService? type Status report message /TestUI/ConnectionService? description The requested resource (/TestUI/ConnectionService?) is not available.
Thanks in Advance, Geeya.