New issue 7 by a.shah.314: Can't load classes from jar files on windows
http://code.google.com/p/thread-weaver/issues/detail?id=7
What steps will reproduce the problem?
1. Use windows
2. Attempt to instrument a class which has dependencies in a jar file on
the classpath
Fails with null pointer exception
Caused by: java.lang.NullPointerException
at
com.google.testing.instrumentation.InstrumentedClassLoader.loadClassData(InstrumentedClassLoader.java:152)
at
com.google.testing.instrumentation.InstrumentedClassLoader.findClass(InstrumentedClassLoader.java:137)
at
com.google.testing.instrumentation.InstrumentedClassLoader.loadClass(InstrumentedClassLoader.java:113)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at
com.google.testing.threadtester.AnnotatedTestWrapper.runTests(AnnotatedTestWrapper.java:231)
... 31 more
Using version 0.1 on Windows XP
Cause if from line 135 of
com.google.testing.instrumentation.InstrumentedClassLoader
"String resourceName = className.replace('.', File.separatorChar)
+ ".class";"
File separator on windows is a backslash. But the
ClassLoader.getResource(String name) method requires a forwardslash in
order to find a resource from a jar. The input stream found on line 136 is
null which cuases the NPE further on.
THis has been fixed (See issue #5) but I have not yet built a new version.
Sorry about that. I will try and get a new version out soon, or you can
build from the source.