Eclipse - how tos and tips and tricks

Lots of Java ADF enthusiasts have asked for some guidance on working with Eclipse. I do teach them a few in the class but here is more comprehensive listing. Obviously you can find more info on the web but here is a list that is relevant to using Eclipse for web development.

1. Increasing the heap size of Eclipse (In simple terms : how to avoid out of memory errors)Two ways to deal with this issue :

  • Start Eclipse with an extra argument to the VM indicating the memory size
    eclipse -vmargs -Xmx512M
  • Edit the eclipse.ini file (located in eclipse home directory) and add the modify the vmargs values. Here is a sample
    Old:
    -vmargs
    -Xms40m
    -Xmx256m
    New:
    -vmargs
    -Xms40m
    -Xmx756m

2. How to get the intellisense for code completion.

Ctrl + Space bar

3. When deploying the application to Tomcat, sometimes you get an error saying the “JRE was not found”

- From the Menu items open the “Window” -> “Preferences”

- Select the “Server” -> “Installed Runtimes” option

eclipse-installed-runtime.jpg

- Select “Apache Tomcat” and click on “Edit” button

eclipse-set-jre.jpg

- In the window make sure you choose a valid JRE. Click on the “Finish” button.

4. What plugins do I need to start using Java ADF with Eclipse? 

There is detailed documentation on how to install Java ADF plugins for Eclipse on EDN. Here is the link :

http://edndoc.esri.com/arcobjects/9.2/Java/java/engine/ide_integration/eclipse/EclipseInstall.html

Here is a screenshot for reference showing all the plugins (including Java ADF plugins) installed in my Eclipse :

eclipse-plugins.jpg

More coming soon …

Yahoo! releases new performance best practices (14 + 20 new rules)

Another interesting presentation about web performance with 20 more tips by Stoyan Stefanov, lead developer, Yahoo! Performance team

Here is the link : http://www.slideshare.net/stoyan/high-performance-web-pages-20-new-best-practices

Few tools discussed in the slides :

  1. YSlow
  2. Fiddler
  3. IBM page detailer
  4. HTTPWatch
  5. AOL Pagetest
  6. JSLint
  7. JSMin
  8. YUI Compressor
  9. pngcrush (optipng, pngoptimizer)
  10. jpegtran

Configure Routing Task

In one of my recent teaching trips to St. Louis, MO the discussion came up as to how to use the network analyst extension capabilities in the web mapping application. While looking through the Web ADF Java Doc surprisingly I did find the Routing task and an associated taskinfo class. Java Web ADF has a ready to use Routing Task but is not configurable through the manager.

Out of curiosity and with help of fellow employee (Thanks Lloyd) we figured out that if you have ArcGIS Server Service with Network Analysis capability enabled and a Geocode service then you can use these services with the Routing task in your web mapping application. The only thing missing is documentation on how to configure and use the task. Here are the steps to add this task to your application :

Read the rest of this entry »

Measuring Web Mapping Application Performance using YSlow - part 1

I am big fan of Yahoo Developer Network and one of the sections in the site is the “Exceptional Performance” headed until recently by Steve Souders - performance Guru previously at Yahoo and now at Google. Recently Yahoo has come out with a new firefox add-on called YSlow. YSlow is a tool that follows the 13 Rules for High Performance Web Sites as listed on the Yahoo Exception Performance site and analyzes those 13 aspects on your site, giving you a grade (A-F) for each of the rules, and an overall grade for the site. The tool is free to download and installed as an add-on into Firefox firebug plugin.

The 13 benchmarks are listed here

  1. Make fewer HTTP requests
  2. Use a CDN
  3. Add an Expires header
  4. Gzip components
  5. Put CSS at the top
  6. Move scripts to the bottom
  7. Avoid CSS expressions
  8. Make JS and CSS external
  9. Reduce DNS lookups
  10. Minify JS
  11. Avoid redirects
  12. Remove duplicate scripts
  13. Configure ETags

If you are new to YSlow or the 13 rules for high performance, I strongly recommend reading the links above first before following the article. My mission after reading the articles and installing the plugin was to figure out what does these performance rules mean from a web mapping application perspective.

Read the rest of this entry »

Creating a deployable WAR file from Eclipse Project

Recently I was posed with a challenge of coming up with a solution to a seemingly simple problem “I want to use Eclipse to create by web mapping project and then deploy the solution directly into my Tomcat instance”

Sounds simple right, I started exploring ways to coming up with a solution. Eclipse allows us to run the application and then export the application to a standard WAR file. But then someone has to manually do the following steps :

  • Export the project to a WAR file using Eclipse Interface
  • Copy the WAR file from the location created to the Tomcat webapps folder

Here is a better alternative and a solution to the question :

Create an ANT script that will look at the Eclipse Project structure and build the WAR file and copy over the WAR file to the destination (Tomcat WebApps folder)

Read the rest of this entry »