Compiling Sencha GXT showcase
I work professionally using GWT and Sencha GXT. Sencha offers a showcase, which is a huge help to understand their components. Sometimes I need to alter their examples in order to test something. Copying all necessary files is quite laborious. Since the source code is provided along with the library, I decided to set it up under Eclipse. In this article, I want to share all the steps and pitfalls with you.
- GWT 2.4 (for GXT 3.0.x) or GWT 2.5+ (for GXT 3.1.x)
- Java 1.6
Keep in mind: GXT 3.0 won't work with GWT 2.5+, and GXT 3.1 won't work with GWT 2.4.
- New Project → Google → Web Application Project
- Project name:
- Uncheck "Use Google App Engine" and "Generate project sample code"
- Project name:
- Download and unzip the GXT library
- Copy the subfolders from
gxt-examples-3.x.war(you might need to change the extension to
WEB-INF(extracted war folder) into
gwt-servlet.jar(this should already exist in your project)
- For GXT 3.0.x: copy
- For GXT 3.1.x: copy
- Add all libraries to your build path (select all → Build Path → Add to Build Path)
- Copy all files and folders from your extracted war file, except
com.sencha.gxt.explorer.Explorer.gwt.xml(Run as → Web Application) → Select
This should fail with the following exception:
org.apache.openjpa .persistence.ArgumentException: This configuration disallows runtime optimization, but the following listed types were not enhanced at build time or at class load time with a javaagent:
- com.sencha.gxt.examples .resources.server.data.Music
- com.sencha.gxt.examples .resources.server.data.Folder
Add a Java agent: Run → Run Configuration → Select
GXT-Examplesunder Web Application → Arguments → Add to VM arguments (jar version might be different):
If the Google plugin removes this argument, make the run configuration read-only: Common tab → Select Shared file → Apply → Close
Select the *.launch file in your root project directory → Properties → Read-only → OK
Run your configuration one more time. This time the Sencha Explorer should launch in your browser after a while. Have fun experimenting!