Complete build with junit tests (mvn clean install) worked without test failures when I used 1.6.0_13, so for your case, I'd try: 1) upgrading to the latest Sun 1.6.0_13 JDK and making sure JAVA_HOME points to that level
2) checking out the source to c:\openjpa\trunk and trying the build again
3) try turning off any anti-virus programs during the build (I'm using Symantec w/o problems)
4) use a different OS :-)


-Donald


Donald Woods wrote:
I tried Maven 2.1.0 with Sun Java 1.5.0_16 on WinXP and all the tests under openjpa-lib and openjpa-persistence-jdbc passed for me using the latest trunk code.

I have everything checked out under C:\openjpa\trunk, but don't know if that would help you (maybe a long path/filename problem on Windows.)

I'll try running with Sun Java 1.6.0_13 next.....


-Donald


Anurag Rai wrote:
I am using the following version:
Apache Maven 2.1.0 (r755702; 2009-03-19 00:40:27+0530)
Java version: 1.6.0_07
Java home: C:\Program Files\Java\jdk1.6.0_07\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows vista" version: "6.0" arch: "x86" Family: "windows"

The problem is bit strange, because when i compile(mvn compile) i dont get any errors. But I guess the problem is solved because when I ran the project
in netbeans6.1(using maven plugin) the file "second-persistence" was
created. But still i am not able to run the test cases, it gives me the
following error related to XMLFactory:

Scanning for projects...
project-execute
[#process-sources]
Setting property: classpath.resource.loader.class =>
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
Setting property: velocimacro.messages.on => 'false'.
Setting property: resource.loader => 'classpath'.
Setting property: resource.manager.logwhenfound => 'false'.
************************************************************** Starting Jakarta Velocity v1.4
RuntimeInstance initializing.
Default Properties File:
org\apache\velocity\runtime\defaults\velocity.properties
Default ResourceManager initializing. (class
org.apache.velocity.runtime.resource.ResourceManagerImpl)
Resource Loader Instantiated:
org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
ClasspathResourceLoader : initialization starting.
ClasspathResourceLoader : initialization complete.
ResourceCache : initialized. (class
org.apache.velocity.runtime.resource.ResourceCacheImpl)
Default ResourceManager initialization complete.
Loaded System Directive: org.apache.velocity.runtime.directive.Literal
Loaded System Directive: org.apache.velocity.runtime.directive.Macro
Loaded System Directive: org.apache.velocity.runtime.directive.Parse
Loaded System Directive: org.apache.velocity.runtime.directive.Include
Loaded System Directive: org.apache.velocity.runtime.directive.Foreach
Created: 20 parsers.
Velocimacro : initialization starting.
Velocimacro : adding VMs from VM library template : VM_global_library.vm
[ERROR]ResourceManager : unable to find resource 'VM_global_library.vm' in
any resource loader.
Velocimacro : error using  VM library template VM_global_library.vm :
org.apache.velocity.exception.ResourceNotFoundException: Unable to find
resource 'VM_global_library.vm'
Velocimacro :  VM library template macro registration complete.
Velocimacro : allowInline = true : VMs can be defined inline in templates
Velocimacro : allowInlineToOverride = false : VMs defined inline may NOT
replace previous VM definitions
Velocimacro : allowInlineLocal = false : VMs defined inline will be global
in scope if allowed.
Velocimacro : initialization complete.
Velocity successfully started.
[checkstyle:checkstyle]
Starting audit...
Audit done.
[WARN]Unable to locate Source XRef to link to - DISABLED
[#process-resources]
[resources:resources]
Using 'UTF-8' encoding to copy filtered resources.
Copying 8 resources
Copying 2 resources to META-INF
[#compile]
[compiler:compile]
Nothing to compile - all classes are up to date
[#process-test-resources]
[resources:testResources]
Using 'UTF-8' encoding to copy filtered resources.
Copying 2 resources
[#test-compile]
[compiler:testCompile]
Compiling 2 source files to
C:\Users\anurag\Documents\acads\GSoC\OpenJPA\trunk\openjpa-persistence\target\test-classes
[antrun:run]
Executing tasks
      [jar] Building jar:
C:\Users\anurag\Documents\acads\GSoC\OpenJPA\trunk\openjpa-persistence\target\test-classes\second-persistence.jar
Executed tasks
[#test]
[surefire:test]
Surefire report directory:
C:\Users\anurag\Documents\acads\GSoC\OpenJPA\trunk\openjpa-persistence\target\surefire-reports
-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running org.apache.openjpa.persistence.TestEnumToKernelConstantMappings
Running org.apache.openjpa.persistence.TestPersistenceProductDerivation
An error occurred while attempting to determine the version of
"file:/C:/Users/anurag/Documents/acads/GSoC/OpenJPA/trunk/openjpa-persistence/target/test-classes/META-INF/persistence.xml".
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.315 sec
<<< FAILURE!
testGetAnchorsInResource(org.apache.openjpa.persistence.TestPersistenceProductDerivation) Time elapsed: 0.295 sec <<< ERROR!
java.lang.NoClassDefFoundError: Could not initialize class
org.apache.openjpa.lib.xml.XMLFactory
        at
org.apache.openjpa.lib.meta.XMLMetaDataParser.parseNewResource(XMLMetaDataParser.java:352)
        at
org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:318)
        at
org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:295)
        at
org.apache.openjpa.lib.meta.XMLMetaDataParser.parse(XMLMetaDataParser.java:268)
        at
org.apache.openjpa.persistence.PersistenceProductDerivation$ConfigurationParser.parse(PersistenceProductDerivation.java:614)
        at
org.apache.openjpa.persistence.PersistenceProductDerivation.getAnchorsInResource(PersistenceProductDerivation.java:280)
        at
org.apache.openjpa.persistence.TestPersistenceProductDerivation.testGetAnchorsInResource(TestPersistenceProductDerivation.java:39)
        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:140)
        at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
        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:334)
        at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:980)
Results :
Tests in error: testGetAnchorsInResource(org.apache.openjpa.persistence.TestPersistenceProductDerivation) [ERROR]Mojo: [ERROR] org.apache.maven.plugins:maven-surefire-plugin:2.4:test [ERROR]FAILED for project: [ERROR] org.apache.openjpa:openjpa-persistence:jar:2.0.0-SNAPSHOT
[ERROR]Reason:
[ERROR]There are test failures.
[ERROR]Please refer to
C:\Users\anurag\Documents\acads\GSoC\OpenJPA\trunk\openjpa-persistence\target\surefire-reports
for the individual test results.
------------------------------------------------------------------------
For more information, run with the -e flag
------------------------------------------------------------------------
BUILD FAILED
------------------------------------------------------------------------
Total time: 10 seconds
Finished at: Wed May 06 21:21:56 IST 2009
Final Memory: 67M/207M
------------------------------------------------------------------------








DWoods wrote:
What level of Java and Maven are you using?
Also, it looks like you're using either Vista or Win2008 Server, so wondering does your user account have administrator rights or not?

On WinXP, I'm using the following to build trunk without problems -
    Sun Java 1.5.0_16
    Maven 2.0.9

From the root of the source you checked out (trunk in my case), try running -
    mvn clean install


-Donald





Reply via email to