[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tycho-dev] java.lang.NoClassDefFoundError during local build for OSGi compiler

Found the root cause: I accidentally imported the test projects in Eclipse when using the Eclipse Import from Git wizard. This triggered generation of the "bin" folder and compilation of classes. 

After removing those I made further progress until this one:
Running org.eclipse.tycho.surefire.TestMojoTest
[warn] Both parameter 'skipTests' and 'maven.test.skip' are set, 'skipTests' has a higher priority!
Tests run: 10, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.019 sec <<< FAILURE! - in org.eclipse.tycho.surefire.TestMojoTest
testSplitArgLineUnbalancedQuotes(org.eclipse.tycho.surefire.TestMojoTest)  Time elapsed: 0.007 sec  <<< ERROR!
java.lang.NoSuchMethodError: org.hamcrest.CoreMatchers.containsString(Ljava/lang/String;)Lorg/hamcrest/Matcher;
	at org.eclipse.tycho.surefire.TestMojoTest.testSplitArgLineUnbalancedQuotes(TestMojoTest.java:50)

This looks like Maven command line is using a different version. I don't get the compile error in Eclipse with M2E calculating the class path. A mvn -U clean install specifically for the tycho-surefire-plugin solved the issue.

Looks like all is good now and I can continue with getting the its tests rolling on my machine.


Gunnar Wagenknecht
gunnar@xxxxxxxxxxxxxxx, http://guw.io/

> Am 18.04.2015 um 12:49 schrieb Gunnar Wagenknecht <gunnar@xxxxxxxxxxxxxxx>:
> Hi,
> I tried a mvn clean install locally today in order to prepare for running its tests. However, it fails for the OSGi Compiler Plug-in. Any ideas what could be missing here?
> [INFO] Tycho OSGi Compiler Plugin (Incubation) ............ FAILURE [  2.967 s]
> ....
> [INFO] ------------------------------------------------------------------------
> [INFO] ------------------------------------------------------------------------
> [INFO] Total time: 02:24 min
> [INFO] Finished at: 2015-04-18T12:35:54+02:00
> [INFO] Final Memory: 187M/1031M
> [INFO] ------------------------------------------------------------------------
> [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test (default-test) on project tycho-compiler-plugin: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:2.17:test failed: There was an error in the forked process
> [ERROR] java.lang.NoClassDefFoundError: projects/resources/p001/bin/testresources/Test (wrong name: testresources/Test)
> [ERROR] at java.lang.ClassLoader.defineClass1(Native Method)
> [ERROR] at java.lang.ClassLoader.defineClass(ClassLoader.java:760)
> [ERROR] at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
> [ERROR] at java.net.URLClassLoader.defineClass(URLClassLoader.java:455)
> [ERROR] at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
> [ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:367)
> [ERROR] at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
> [ERROR] at java.security.AccessController.doPrivileged(Native Method)
> [ERROR] at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
> [ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
> [ERROR] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
> [ERROR] at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
> [ERROR] at org.apache.maven.surefire.util.DefaultScanResult.loadClass(DefaultScanResult.java:131)
> [ERROR] at org.apache.maven.surefire.util.DefaultScanResult.applyFilter(DefaultScanResult.java:95)
> [ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.scanClassPath(JUnit4Provider.java:206)
> [ERROR] at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:103)
> [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:200)
> [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:153)
> [ERROR] at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:103)
> [ERROR] -> [Help 1]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR] For more information about the errors and possible solutions, please read the following articles:
> [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginExecutionException
> [ERROR] After correcting the problems, you can resume the build with the command
> [ERROR]   mvn <goals> -rf :tycho-compiler-plugin
> -- 
> Gunnar Wagenknecht
> gunnar@xxxxxxxxxxxxxxx, http://guw.io/