Things break constantly on Windows due to spaces in directory names.
Given this works on Linux, I would assume this is your problem. Move everything to directories without spaces and try again. Wayne On 5/1/07, insitu <[EMAIL PROTECTED]> wrote:
Hello, I have a strange problem running tests with maven. My test first create a directory and a jar in the temporary directory for the user, (property java.io.tmpdir), writes a class file to it, then uses that jar file to pass to a tested class that creates a classloader from it and loads a class using ClassLoader.loadClass("mypacakge.MyClass"). Jar creation is done in setUp method in junit and jar deletion is done in tearDown method. Everything runs fine on linux box using jdk1.6, in maven2.0.6 and eclipse3.2. On windowsXP with jdk1.6, it runs fine in eclipse but breaks in maven2.0.6 with a strange errror: a NPE in the classloading, hinting at the fact the class loaded may be null. I tried to use forkMode always for surefire but it does not change result. Help of course appreciated, PS: Here is the full XML report and a link to the source file for tes (http://patchwork-cover.googlecode.com/svn/trunk/patchwork-main/src/test/java/oqube/patchwork/MainTest.java). <?xml version="1.0" encoding="UTF-8" ?> - <testsuite failures="0" time="0.859" errors="2" skipped="0" tests="5" name="oqube.patchwork.MainTest"> - <properties> <property name="java.runtime.name" value="Java(TM) SE Runtime Environment" /> <property name="sun.boot.library.path" value="C:\program files\Java\jdk1.6.0_01\jre\bin" /> <property name="java.vm.version" value="1.6.0_01-b06" /> <property name="java.vm.vendor" value="Sun Microsystems Inc." /> <property name="java.vendor.url" value="http://java.sun.com/" /> <property name="path.separator" value=";" /> <property name="java.vm.name" value="Java HotSpot(TM) Client VM" /> <property name="file.encoding.pkg" value="sun.io" /> <property name="user.country" value="FR" /> <property name="sun.java.launcher" value="SUN_STANDARD" /> <property name="sun.os.patch.level" value="Service Pack 2" /> <property name="launcher.libdir" value="C:\DOCUME~1\nono\LOCALS~1\Temp\Main-test" /> <property name="java.vm.specification.name" value="Java Virtual Machine Specification" /> <property name="user.dir" value="C:\Documents and Settings\nono\Mes documents\patchwork\patchwork-main" /> <property name="java.runtime.version" value="1.6.0_01-b06" /> <property name="java.awt.graphicsenv" value="sun.awt.Win32GraphicsEnvironment" /> <property name="basedir" value="C:\Documents and Settings\nono\Mes documents\patchwork\patchwork-main" /> <property name="java.endorsed.dirs" value="C:\program files\Java\jdk1.6.0_01\jre\lib\endorsed" /> <property name="os.arch" value="x86" /> <property name="java.io.tmpdir" value="C:\DOCUME~1\nono\LOCALS~1\Temp\" /> <property name="line.separator" value="" /> <property name="java.vm.specification.vendor" value="Sun Microsystems Inc." /> <property name="user.variant" value="" /> <property name="os.name" value="Windows XP" /> <property name="sun.jnu.encoding" value="Cp1252" /> <property name="java.library.path" value="C:\program files\Java\jdk1.6.0_01\jre\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\program files\Java\jdk1.6.0_01\bin;c:\program files\maven-2.0.6\bin\" /> <property name="java.specification.name" value="Java Platform API Specification" /> <property name="java.class.version" value="50.0" /> <property name="sun.management.compiler" value="HotSpot Client Compiler" /> <property name="os.version" value="5.1" /> <property name="user.home" value="C:\Documents and Settings\nono" /> <property name="user.timezone" value="Europe/Paris" /> <property name="java.awt.printerjob" value="sun.awt.windows.WPrinterJob" /> <property name="file.encoding" value="Cp1252" /> <property name="java.specification.version" value="1.6" /> <property name="user.name" value="nono" /> <property name="java.class.path" value="C:\Documents and Settings\nono\.m2\repository\org\codehaus\plexus\plexus-archiver\1.0-alpha-7\plexus-archiver-1.0-alpha-7.jar;C:\Documents and Settings\nono\.m2\repository\org\apache\maven\surefire\surefire-api\2.3\surefire-api-2.3.jar;C:\Documents and Settings\nono\.m2\repository\org\codehaus\plexus\plexus-container-default\1.0-alpha-8\plexus-container-default-1.0-alpha-8.jar;C:\Documents and Settings\nono\.m2\repository\org\codehaus\plexus\plexus-utils\1.1\plexus-utils-1.1.jar;C:\Documents and Settings\nono\.m2\repository\org\apache\maven\surefire\surefire-booter\2.3\surefire-booter-2.3.jar;C:\Documents and Settings\nono\.m2\repository\classworlds\classworlds\1.1-alpha-2\classworlds-1.1-alpha-2.jar;C:\Documents and Settings\nono\.m2\repository\commons-lang\commons-lang\2.1\commons-lang-2.1.jar;C:\Documents and Settings\nono\.m2\repository\junit\junit\3.8.1\junit-3.8.1.jar" /> <property name="java.vm.specification.version" value="1.0" /> <property name="sun.arch.data.model" value="32" /> <property name="java.home" value="C:\program files\Java\jdk1.6.0_01\jre" /> <property name="java.specification.vendor" value="Sun Microsystems Inc." /> <property name="user.language" value="fr" /> <property name="awt.toolkit" value="sun.awt.windows.WToolkit" /> <property name="java.vm.info" value="mixed mode, sharing" /> <property name="java.version" value="1.6.0_01" /> <property name="java.ext.dirs" value="C:\program files\Java\jdk1.6.0_01\jre\lib\ext;C:\WINDOWS\Sun\Java\lib\ext" /> <property name="launcher.main" value="oqube.patchwork.Dummy" /> <property name="sun.boot.class.path" value="C:\program files\Java\jdk1.6.0_01\jre\lib\resources.jar;C:\program files\Java\jdk1.6.0_01\jre\lib\rt.jar;C:\program files\Java\jdk1.6.0_01\jre\lib\sunrsasign.jar;C:\program files\Java\jdk1.6.0_01\jre\lib\jsse.jar;C:\program files\Java\jdk1.6.0_01\jre\lib\jce.jar;C:\program files\Java\jdk1.6.0_01\jre\lib\charsets.jar;C:\program files\Java\jdk1.6.0_01\jre\classes" /> <property name="java.vendor" value="Sun Microsystems Inc." /> <property name="localRepository" value="C:\Documents and Settings\nono\.m2\repository" /> <property name="file.separator" value="\" /> <property name="java.vendor.url.bug" value="http://java.sun.com/cgi-bin/bugreport.cgi" /> <property name="sun.cpu.endian" value="little" /> <property name="sun.io.unicode.encoding" value="UnicodeLittle" /> <property name="sun.desktop" value="windows" /> <property name="sun.cpu.isalist" value="pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86" /> </properties> <testcase time="0.125" name="test00NoEnv" /> - <testcase time="0.484" name="testLaunchDummyMain"> <error type="java.lang.NullPointerException">java.lang.NullPointerException at sun.misc.URLClassPath$3.run(URLClassPath.java:323) at java.security.AccessController.doPrivileged(Native Method) at sun.misc.URLClassPath.getLoader(URLClassPath.java:320) at sun.misc.URLClassPath.getLoader(URLClassPath.java:297) at sun.misc.URLClassPath.getResource(URLClassPath.java:167) at java.net.URLClassLoader$1.run(URLClassLoader.java:192) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at oqube.patchwork.Launch.run(Launch.java:130) at oqube.patchwork.MainTest.testLaunchDummyMain(MainTest.java:68) at oqube.patchwork.MainTest.testLaunchDummyMain(MainTest.java:68) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:163) at org.apache.maven.surefire.Surefire.run(Surefire.java:84) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:244) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:814)</error> </testcase> <testcase time="0.031" name="test02DirNotExists" /> <testcase time="0.015" name="test03NotADir" /> - <testcase time="0.047" name="test04MainClassSet"> <error type="java.lang.NullPointerException">java.lang.NullPointerException at sun.misc.URLClassPath$3.run(URLClassPath.java:323) at java.security.AccessController.doPrivileged(Native Method) at sun.misc.URLClassPath.getLoader(URLClassPath.java:320) at sun.misc.URLClassPath.getLoader(URLClassPath.java:297) at sun.misc.URLClassPath.getResource(URLClassPath.java:167) at java.net.URLClassLoader$1.run(URLClassLoader.java:192) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:306) at java.lang.ClassLoader.loadClass(ClassLoader.java:251) at oqube.patchwork.Launch.run(Launch.java:130) at oqube.patchwork.MainTest.test04MainClassSet(MainTest.java:110) at oqube.patchwork.MainTest.test04MainClassSet(MainTest.java:110) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138) at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:163) at org.apache.maven.surefire.Surefire.run(Surefire.java:84) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:244) at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:814)</error> </testcase> </testsuite> -- View this message in context: http://www.nabble.com/Strange-test-execution-problem-tf3676850s177.html#a10274623 Sent from the Maven - Users mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]