Debugging Classpath Problems

Chuck Hill

I recently found this useful and thought others might too:

System.out.println("\nClassPath Follows....\n");
ClassLoader classLoader = ClassLoader.getSystemClassLoader();
URL[] urls = ((URLClassLoader)classLoader).getURLs();
for(int i=0; i<urls.length; i++) {
  System.out.println(urls[i].toString() + "\n");
}

Add this to public static void main(String argv[]) before the call to WOApplication.main(argv, Application.class) and add these imports:

import java.io.*;
import java.net.*;

Backtracked Too Far Errors

There are several things that can cause this:

Not Using PageWithName to Create Pages

Creating pages directly like this

public EditOrder editBooking() {
   EditOrder nextPage = new EditOrder(context());  // BAD BAD BAD
   return nextPage;
}

instead of,

public EditOrder editBooking() {
   EditOrder nextPage = (EditOrder)pageWithName(EditOrder.class.getName());
   return nextPage;
}

can result in the page not getting saved in the page cache (and probably other bad things too) which will result in this back tracking error.