Wiki source code of Programming__WebObjects-Web Applications-Development-Common Pitfalls and Troubleshooting
                  Version 4.1 by smmccraw on 2007/07/08 09:45
              
      Hide last authors
| author | version | line-number | content | 
|---|---|---|---|
|                              | 
      2.1 | 1 | == Debugging Classpath Problems == | 
| 2 | |||
| 3 | === Chuck Hill === | ||
| 4 | |||
| 5 | I recently found this useful and thought others might too: | ||
| 6 | |||
|                              | 
      4.1 | 7 | {{panel}} | 
|        | 
      2.1 | 8 | |
|        | 
      4.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 | { | ||
| 14 | System.out.println(urls[i].toString() + "\n"); | ||
| 15 | } | ||
|        | 
      2.1 | 16 | |
|        | 
      4.1 | 17 | {{/panel}} | 
|        | 
      2.1 | 18 | |
| 19 | Add this to public static void main(String argv[[]]) before the call to WOApplication.main(argv, Application.class) and add these imports: | ||
| 20 | |||
|        | 
      4.1 | 21 | {{panel}} | 
|        | 
      2.1 | 22 | |
|        | 
      4.1 | 23 | import java.io.*; | 
| 24 | import java.net.*; | ||
|        | 
      2.1 | 25 | |
|        | 
      4.1 | 26 | {{/panel}} | 
|        | 
      2.1 | 27 | |
| 28 | Category:WebObjects |