Changes for page Development-Common Pitfalls and Troubleshooting
Last modified by Pascal Robert on 2010/09/13 00:24
Summary
-
Page properties (3 modified, 0 added, 0 removed)
Details
- Page properties
-
- Title
-
... ... @@ -1,1 +1,1 @@ 1 - Programming__WebObjects-WebApplications-Development-Common Pitfalls and Troubleshooting1 +Web Applications-Development-Common Pitfalls and Troubleshooting - Author
-
... ... @@ -1,1 +1,1 @@ 1 -XWiki. smmccraw1 +XWiki.chuckhill - Content
-
... ... @@ -1,28 +1,61 @@ 1 -== Debugging Classpath Problems 1 +== Debugging Classpath Problems == 2 2 3 -=== Chuck Hill 3 +=== Chuck Hill === 4 4 5 5 I recently found this useful and thought others might too: 6 6 7 -{{ panel}}7 +{{code}} 8 8 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 - { 14 - System.out.println(urls[i].toString() + "\n"); 15 - } 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 +} 16 16 17 -{{/ panel}}16 +{{/code}} 18 18 19 -Add this to public static void main(String argv [[]]) before the call to WOApplication.main(argv, Application.class) and add these imports:18 +Add this to public static void main(String argv) before the call to WOApplication.main(argv, Application.class) and add these imports: 20 20 21 -{{ panel}}20 +{{code}} 22 22 23 - 24 - 22 +import java.io.*; 23 +import java.net.*; 25 25 26 -{{/ panel}}25 +{{/code}} 27 27 28 -Category:WebObjects 27 +== Backtracked Too Far Errors == 28 + 29 +There are several things that can cause this: 30 + 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 35 +* other things... 36 + 37 +=== Not Using PageWithName to Create Pages === 38 + 39 +Creating pages directly like this 40 + 41 +{{code value="java"}} 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 + 52 +{{code value="java"}} 53 + 54 +public EditOrder editBooking() { 55 + EditOrder nextPage = (EditOrder)pageWithName("EditOrder"); 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.