JDK1.5Update07
The latest is JDK1.5Update08. Download the windows version and follow
the default install.
Eclipse 3.2
http://download.eclipse.org/eclipse/downloads/drops/R-3.2-200606291905/index.php
download eclipse-SDK-3.2-win32.zip
WTP1.5.1 (WTP1.5.0 has a bug displaying JSP page in host mode)
http://www.eclipse.org/downloads/download.php?file=/webtools/downloads/drops/R1.5/M-1.5.1-200608032139/wtp-sdk-M-1.5.1-200608032139.zip
pick a server to download wtp-sdk-M-1.5.1-200608032139.zip
WTP requires some other plug-ins.
EMF driver
http://download.eclipse.org/tools/emf/downloads//drops/2.2.1/M200607270021/emf-sdo-xsd-SDK-M200607270021.zip
GEF driver
http://download.eclipse.org/tools/gef/downloads/drops/R-3.2-200606270816/GEF-SDK-3.2.zip
Java EMF Model Runtime driver
http://download.eclipse.org/tools/ve/downloads/drops/R-1.2-200606280938/JEM-SDK-1.2.zip
GWT1.1.0 (GWT1.0.21, you have to modify the launch file. I am using the
latest one to make my life easier.)
Tomcat 5.5.17
http://apache.mirrors.northco.net/tomcat/tomcat-5/v5.5.17/bin/apache-tomcat-5.5.17.zip
Here we use the zip file to have more control on tomcat, and it is more
convenient.
Notice we use the zip file, not the windowz bin file.
Setup
Make a new directory <eclipse-home> wherever you like, eclipse doesn't
install anything in registry. Unzip eclipse-SDK-3.2-win32.zip under
<eclipse-home>. Then you will see a directory called
eclipse-SDK-3.2-win32, which contains the eclipse files,i.e,
eclipse.exe, which starts the IDE. You can rename eclipse-SDK-3.2-win32
as you like, here we will call it <eclipse-dev>.
So now, you will have <eclipse-home>\<eclipse-dev>. Let s look into
<eclipse-dev> for now, you will see a directory called plugin. It is
usually where you install the plugins. However, I would like to
seperate the ide and plugins, since I know I am going to update the
plugins or the ide sooner or later. Therefore, I create a directory
called links under <eclipse-dev>(links is in the same directory as
eclipse.exe), and create a directory <eclipse-plugins> under
<eclipse-home>. You now have <eclipse-home>\<eclipse-plugins> and
<eclipse-home>\<eclipse-dev>\links\.
Unzip each eclipse plugin into <eclipse-plugins>. In words, create a
directory for each plugin, unzip in this directory, under which you
will have a single fold "eclipse". Something like this,
<eclipse-plugins>\<plugin1>\eclipse\pluginfiles. On the other hand,
create a .link file for each plugin in <eclipse-dev>\links. Put the
path to the plugin in the .link file, like
"path=..\\..\\<eclipse-plugins>\\<plugin1>". Note that use double back
slash, DO NOT include quotation mark, and replace with the actual
directory names you use.
After you have done these, you are all set to launch the IDE, make sure
the WTP plugin starts up. Check in the menu Window->Preferences, in the
left column you should see "server". If there is problem, please make
sure you have the right path in the link file.
Fun Part:
Start Eclipse IDE, you might have to install/set JDK and server.
JDK: Window->Preference, on the left column, find Jave->installed JREs,
choose a jdk you like to use.
Server: Unzip apache-tomcat-5.5.17.zip to <apache-tomcat>. Then,
Window->Preference, on the left column, find Server->installed
Runtimes. Click Add, find Apache Tomcat v5.5, fill in name, the
directory where you install tomcat, and the jre tomcat will use(select
jdk for safety), and finish.
Create WTP project. File->new->project, choose Dynamic Web project,
next Project Name DynaTable, and finish. IDE will ask you to switch to
J2EE perspective, choose yes.
In Project Explorer, Right click DynaTable->src, new package, Package
name: com.google.gwt.sample.dynatable, finish.
Unzip GWT1.1.0 to <gwt>. Open a command box, go to
<workspace>\DynaTable, run
<gwt>\applicationCreator -eclipse DynaTable
com.google.gwt.sample.dynatable.client.DynaTable (in a single line)
Switch back to eclipse, Right click DynaTable in the project explorer,
Properties, find Java build path, choose add external JARs, add
gwt-user.jar in <gwt>, and ok.
Refresh project explorer.
Copy <gwt>\samplse\DynaTable\src to <workspace>\DynaTable\src,
overwrite the whole src directory.
Refresh project explorer. You will see client and server show up
instead of original only single client fold showing under src. You will
also notice that there are several unresolved compilation error(little
red marks), which leads us to next step.
Copy <gwt>\gwt-servlet.jar to
<workspace>\DynaTable\WebContent\WEB-INF\lib
Refresh. The compile error should go away.
Go to SchoolCalendarWidget.java . Two places to modify to enable real
RPC.
line 108: set USE_STATIC_RPC_ANSWERS = false;
line 39: in constructor, change
target.setServiceEntryPoint("/calendar");
to
target.setServiceEntryPoint(GWT.getModuleBaseURL()+"/calendar");
Right click Depolyment Descriptor, open with text editor,
add the following before <welcome-file-list>:
<servlet>
<servlet-name>SchoolCalendar</servlet-name>
<servlet-class>com.google.gwt.sample.dynatable.server.SchoolCalendarServiceImpl</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SchoolCalendar</servlet-name>
<url-pattern>/calendar</url-pattern>
</servlet-mapping>
Don't forget to save the xml file, or it will give an error.
Before you give it a shot in host mode, right click
DynaTable->Properties, click Server on the left column, and choose
apache-tomcatv5.5 as the default server for the project.
Go to Run->Run...
Left column, find Java Application->DynaTable, choose it, you will see
its main class is com.google.gwt.dev.GWTShell, if it isn't, try the
search button next to it. Then click run, the program should run in
host mode. My computer is slow, so it takes a while to show data, be
patient. And now you can play with it.
Last step, deploy it onto server. If you follow this tutorial through,
the last step would be pretty trival. Sit back and a cup of coffe. You
will see the beauty of gwt in the next few minutes.
Go to <workspace>\DynaTable, execute DynaTable-compile.cmd, it takes
about a minute to generate a new directory called www. Go down to
www\com.google.gwt.sample.dynatable.Dynatable, copy everything to
<workspace>\DynaTable\WebContent. Remember we unzip apache-tomcat in
<apache-tomcat>? Go to <apache-tomcat>/bin. Execute startup.bat, it
will pop up one console window. This means your tomcat is on. Switch
back to eclipse, right click on DynaTable->Export->WAR file. Choose the
Destination location as <apache-tomcat>\webapps\DynaTable.war, and
finish. Take a look at the tomcat console window, you will see a
message showing DynaTable is automatically deployed, you don't have to
reboot.
Try http://localhost:8080/DynaTable/DynaTable.html, you should see the
page.
I found out this setup minimizes the repeated work everytime, and it is
really smooth from debugging in host mode to deploying on local/remote
server.
Anyways, this is the end of the tutorial. I hope everyone has a
pleasant start with gwt.
Al
Failed to access data: <html><head><title>Apache Tomcat/5.0.28 - Error
report</title><style><!--H1
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
H2
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
H3
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
BODY
{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}
B
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
P
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A
{color : black;}A.name {color : black;}HR {color : #525D76;}--></style>
</head><body><h1>HTTP Status 500 - </h1><HR size="1"
noshade="noshade"><p><b>type</b> Exception report</p><p><b>message</b>
<u></u></p><p><b>description</b> <u>The server encountered an internal
error () that prevented it from fulfilling this
request.</u></p><p><b>exception</b>
<pre>javax.servlet.ServletException: Servlet execution threw an
exception
</pre></p><p><b>root cause</b>
<pre>java.lang.UnsupportedClassVersionError: Bad version number in
.class file
java.lang.ClassLoader.defineClass1(Native Method)
java.lang.ClassLoader.defineClass(Unknown Source)
java.security.SecureClassLoader.defineClass(Unknown Source)
java.net.URLClassLoader.defineClass(Unknown Source)
java.net.URLClassLoader.access$100(Unknown Source)
java.net.URLClassLoader$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
java.net.URLClassLoader.findClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.loadClass(Unknown Source)
java.lang.ClassLoader.loadClassInternal(Unknown Source)
java.lang.Class.forName0(Native Method)
java.lang.Class.forName(Unknown Source)
com.google.gwt.dev.shell.GWTShellServlet.tryGetOrLoadServlet(GWTShellServlet.java:660)
com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:165)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
</pre></p><p><b>note</b> <u>The full stack trace of the root cause is
available in the Apache Tomcat/5.0.28 logs.</u></p><HR size="1"
noshade="noshade"><h3>Apache Tomcat/5.0.28</h3></body></html>
what really confuses me is i have tomcat 5.5.17 not 5.0.28
this time the error came from tomcat 5.5.17
any help in this would be much appreciated.
Grt work dude
I really appreciate that
Sandy
Rafael Lessa Barreto
-----Mensagem original-----
De: Google-We...@googlegroups.com
[mailto:Google-We...@googlegroups.com] Em nome de Sandy
Enviada em: sexta-feira, 15 de setembro de 2006 05:02
Para: Google Web Toolkit
Assunto: Re: Run RPC sample code from scratch with Eclipse WTP Tomcat WinXP
SP2
GWT team "Normalized behavior of GWT.getModuleBaseURL() with respect to
hosted mode" in this version.