Last modified by Pascal Robert on 2010/09/13 00:24

Hide last authors
Pascal Robert 6.1 1 == Debugging Classpath Problems ==
Quinton Dolan 2.1 2
Pascal Robert 6.1 3 === Chuck Hill ===
Quinton Dolan 2.1 4
5 I recently found this useful and thought others might too:
6
Pascal Robert 6.1 7 {{code}}
Quinton Dolan 2.1 8
Pascal Robert 6.1 9 System.out.println("\nClassPath Follows....\n");
10 ClassLoader classLoader = ClassLoader.getSystemClassLoader();
11 URL[] urls = ((URLClassLoader)classLoader).getURLs();
12 for(int i=0; i<urls.length; i++) {
13 System.out.println(urls[i].toString() + "\n");
14 }
Quinton Dolan 2.1 15
Pascal Robert 6.1 16 {{/code}}
Quinton Dolan 2.1 17
Pascal Robert 10.1 18 Add this to public static void main(String argv[]) before the call to WOApplication.main(argv, Application.class) and add these imports:
Quinton Dolan 2.1 19
Pascal Robert 6.1 20 {{code}}
Quinton Dolan 2.1 21
Pascal Robert 6.1 22 import java.io.*;
23 import java.net.*;
Quinton Dolan 2.1 24
Pascal Robert 6.1 25 {{/code}}
chuckhill 7.1 26
27 == Backtracked Too Far Errors ==
28
29 There are several things that can cause this:
30
Pascal Robert 10.1 31 * having a page cache size that is too small, set the cache size on Application
32 * the session missing on the URL. If WO creates a new session and then tries to use a component action URL you can get this error
33 * bad HTML on the page can cause a new session to get generated. If you are storing the session ID in cookies, this can replace the "real" session ID
34 * something (java script, bad HTML) creating a flurry of bad requests to the app and thus knocking the page out of the cache. You can override and add logging to savePage() in Session to check for this
chuckhill 7.1 35 * other things...
36
37 === Not Using PageWithName to Create Pages ===
38
39 Creating pages directly like this
40
Pascal Robert 10.1 41 {{code 0="java"}}
chuckhill 7.1 42
43 public EditOrder editBooking() {
44 EditOrder nextPage = new EditOrder(context()); // BAD BAD BAD
45 return nextPage;
46 }
47
48 {{/code}}
49
50 instead of,
51
Pascal Robert 10.1 52 {{code 0="java"}}
chuckhill 7.1 53
54 public EditOrder editBooking() {
yllan 8.1 55 EditOrder nextPage = (EditOrder)pageWithName(EditOrder.class.getName());
chuckhill 7.1 56 return nextPage;
57 }
58
59 {{/code}}
60
61 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.