Henri Yandell wrote:
We can change CI to use a JDK 1.6 if that's what Configuration's target is.
This doesn't seem to be the problem. We get errors like the one below.
Is there anything wrong with the JDK on the build machine?
Oliver
testGetConfiguration(org.apache.commons.configuration.TestDataConfiguration)
Time elapsed: 0.052 sec <<< ERROR!
java.lang.UnsatisfiedLinkError:
/usr/lib/jvm/j2sdk1.4.2_15/jre/lib/i386/libawt.so: libXp.so.6: cannot
open shared object file: No such file or directory
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1586)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1503)
at java.lang.Runtime.loadLibrary0(Runtime.java:788)
at java.lang.System.loadLibrary(System.java:834)
at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
at java.security.AccessController.doPrivileged(Native Method)
at java.awt.Toolkit.loadLibraries(Toolkit.java:1437)
at java.awt.Toolkit.<clinit>(Toolkit.java:1458)
at java.awt.Color.<clinit>(Color.java:250)
at
org.apache.commons.configuration.TestDataConfiguration.setUp(TestDataConfiguration.java:237)
at junit.framework.TestCase.runBare(TestCase.java:125)
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:324)
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:125)
at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
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:324)
at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:290)
at
org.apache.maven.surefire.booter.SurefireBooter.run(SurefireBooter.java:198)
at
org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:398)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:480)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:459)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
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:324)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
On 8/28/07, Oliver Heger <[EMAIL PROTECTED]> wrote:
Just an update: the tests should now run on a JDK 1.6. I was able to get
rid of these dependencies on static fields. I also applied most of the
improvements to the pom.xml Michiel suggested (thanks again).
However I doubt that CI will be impressed by these changes...
Oliver
Oliver Heger wrote:
Ben Speakmon wrote:
If you find that the JVM required for the test is important, you can specify
which one to use in the surefire plugin configuration. Never tried it
myself, though.
This would be an option. But I think in this case the tests are really a
bit bogus if they rely on certain values in static fields. I hope to
make them some more robust.
Oliver
On 8/27/07, Oliver Heger <[EMAIL PROTECTED]> wrote:
Hi Michiel,
thanks for this information. Obviously the tests depend on the JDK
version they are run. For me, using a JDK 1.5.0_09, the tests run fine.
CI also seems to use a JDK 1.5, but here 55 tests are failing, which
seems to be caused by classes from the java.awt package that cannot be
resolved (if I interpret the surefire reports correctly).
I just checked with a JDK 1.6 and can reproduce your results. I will
have a look how these problems can be avoided (they seem to be indeed
related to static fields).
The other improvements for the pom you suggest make certainly sense.
Oliver
Michiel Kalkman wrote:
To me, it seems we should at least be able to run the tests first,
outside of any continuous build systems.
Here's what I had to do to get them running with Maven2 under
jdk1.6.0_02. Maybe this helps ?
1) Get the Commons Parent project using subversion from
http://svn.apache.org/repos/asf/commons/proper/commons-parent/trunk.
2) From the project root, run "mvn install".
3) Then get the Commons Config project from
http://svn.apache.org/repos/asf/commons/proper/commons-parent/trunk
Now running "mvn test" results in:
Tests run: 1198, Failures: 1, Errors: 19, Skipped: 0
4) In pom.xml replace:
<forkMode>never</forkMode>
By:
<forkMode>pertest</forkMode>
AFAIK, this is the same as forking mode in Ant, which in the build.xmlof
Commons Config is set to true. I guess because some tests influence one
another
(static variables or something like that).
Then after running "mvn test" this results in:
Tests run: 1198, Failures: 1, Errors: 0, Skipped: 0
This failure occurs in
org.apache.commons.configuration.TestConfigurationFactory
(line 199) because it expects a SAXParseException where it gets only a
SAXException.
5) To resolve this, replace:
<dependency>
<groupId>xerces</groupId>
<artifactId>xerces</artifactId>
<version>2.2.1</version>
By:
<dependency>
<groupId>xerces</groupId>
<artifactId>xerces</artifactId>
<version>2.3.0</version>
I have no idea why this works.
6) Then there are two warnings:
[WARNING] While downloading xerces:xerces:2.3.0
This artifact has been relocated to xerces:xercesImpl:2.3.0.
[WARNING] While downloading servletapi:servletapi:2.4
This artifact has been relocated to javax.servlet:servlet-api:2.4.
Replace:
<dependency>
<groupId>xerces</groupId>
<artifactId>xerces</artifactId>
<version>2.3.0</version>
By:
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.3.0</version>
And replace:
<dependency>
<groupId>servletapi</groupId>
<artifactId>servletapi</artifactId>
<version>2.4</version>
By:
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
<version>2.4</version>
Or did I overlook something more simple ?
(BTW: I did not see any problems with colors)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]