Wiki source code of Web Applications-Development-Common Pitfalls and Troubleshooting
Version 6.1 by Pascal Robert on 2007/09/03 15:19
Hide last authors
| author | version | line-number | content |
|---|---|---|---|
| |
6.1 | 1 | == Debugging Classpath Problems == |
| |
2.1 | 2 | |
| |
6.1 | 3 | === Chuck Hill === |
| |
2.1 | 4 | |
| 5 | I recently found this useful and thought others might too: | ||
| 6 | |||
| |
6.1 | 7 | {{code}} |
| |
2.1 | 8 | |
| |
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 | } | ||
| |
2.1 | 15 | |
| |
6.1 | 16 | {{/code}} |
| |
2.1 | 17 | |
| |
6.1 | 18 | Add this to public static void main(String argv) before the call to WOApplication.main(argv, Application.class) and add these imports: |
| |
2.1 | 19 | |
| |
6.1 | 20 | {{code}} |
| |
2.1 | 21 | |
| |
6.1 | 22 | import java.io.*; |
| 23 | import java.net.*; | ||
| |
2.1 | 24 | |
| |
6.1 | 25 | {{/code}} |