Your entity class has to be listed in persistence.xml file, most likely.

On Mon, Sep 3, 2012 at 8:10 AM, Malcolm Edgar <med...@apache.org> wrote:
> Hi Guys,
>
> I am having trouble with the JPA unit tests. The typical error I am seeing
> is a NoClassDefFoundError with the JPA tests, for example:
>
> org\apache\cayenne\jpa\itest\ch2\entity\BidiOneToManyOwned (wrong name:
> org/apache/cayenne/jpa/itest/ch2/entity/BidiOneToManyOwned)"
> type="java.lang.NoClassDefFoundError">java.lang.NoClassDefFoundError:
> org\apache\cayenne\jpa\itest\ch2\entity\BidiOneToManyOwned (wrong name:
> org/apache/cayenne/jpa/itest/ch2/entity/BidiOneToManyOwned) at
> java.lang.ClassLoader.defineClass1(Native Method) at
> java.lang.ClassLoader.defineClass(ClassLoader.java:620
>
> Does anyone have some pointers as to where I should look to resolve this
> issue.
>
> regards
>
> On Fri, Aug 31, 2012 at 9:24 PM, Apache Jenkins Server <
> jenk...@builds.apache.org> wrote:
>
>> See <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/149/changes
>> >
>>
>> Changes:
>>
>> [medgar] CAY-1734: Added NuoDB database support
>>
>> ------------------------------------------
>> [...truncated 77879 lines...]
>> INFO: === returned 1 row. - took 0 ms.
>> Aug 31, 2012 11:24:29 AM org.apache.cayenne.access.QueryLogger
>> logCommitTransaction
>> INFO: +++ transaction committed.
>> Aug 31, 2012 11:24:29 AM org.apache.cayenne.remote.BaseConnection
>> sendMessage
>> INFO: === Message 1: Query done - took 2 ms.
>> Aug 31, 2012 11:24:29 AM org.apache.cayenne.remote.BaseConnection
>> sendMessage
>> INFO: --- Message 2: Query
>> Aug 31, 2012 11:24:29 AM org.apache.cayenne.access.QueryLogger
>> logQueryStart
>> INFO: --- will run 1 query.
>> Aug 31, 2012 11:24:29 AM org.apache.cayenne.access.QueryLogger
>> logBeginTransaction
>> INFO: --- transaction started.
>> Aug 31, 2012 11:24:29 AM org.apache.cayenne.access.QueryLogger logQuery
>> INFO: SELECT t0.name, t0.id FROM defaults_table3 t0 WHERE t0.id = ?
>> [bind: 1->id:2]
>> Aug 31, 2012 11:24:29 AM org.apache.cayenne.access.QueryLogger
>> logSelectCount
>> INFO: === returned 1 row. - took 0 ms.
>> Aug 31, 2012 11:24:29 AM org.apache.cayenne.access.QueryLogger
>> logCommitTransaction
>> INFO: +++ transaction committed.
>> Aug 31, 2012 11:24:29 AM org.apache.cayenne.remote.BaseConnection
>> sendMessage
>> INFO: === Message 2: Query done - took 2 ms.
>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.046 sec
>>
>> Results :
>>
>> Tests run: 9, Failures: 0, Errors: 0, Skipped: 0
>>
>> [INFO] [jar:jar {execution: default-jar}]
>> [INFO] Building jar: <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/cayenne-api/target/cayenne-api-3.0-SNAPSHOT.jar
>> >
>> [INFO] [install:install {execution: default-install}]
>> [INFO] Installing <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/cayenne-api/target/cayenne-api-3.0-SNAPSHOT.jar>
>> to
>> /home/jenkins/.m2/repository/org/apache/cayenne/itests/cayenne-api/3.0-SNAPSHOT/cayenne-api-3.0-SNAPSHOT.jar
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Building Integration Tests - POJO
>> [INFO]    task-segment: [clean, install]
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] [clean:clean {execution: default-clean}]
>> [INFO] [resources:resources {execution: default-resources}]
>> [INFO] Using 'UTF-8' encoding to copy filtered resources.
>> [INFO] Copying 3 resources
>> [INFO] [compiler:compile {execution: default-compile}]
>> [INFO] Compiling 4 source files to <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/pojo/target/classes
>> >
>> [INFO] [resources:testResources {execution: default-testResources}]
>> [INFO] Using 'UTF-8' encoding to copy filtered resources.
>> [INFO] skip non existing resourceDirectory <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/pojo/src/test/resources
>> >
>> [INFO] [compiler:testCompile {execution: default-testCompile}]
>> [INFO] Compiling 4 source files to <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/pojo/target/test-classes
>> >
>> [INFO] [surefire:test {execution: default-test}]
>> [INFO] Surefire report directory: <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/pojo/target/surefire-reports
>> >
>> *** CayenneAgent starting...
>>
>> -------------------------------------------------------
>>  T E S T S
>> -------------------------------------------------------
>> Running org.apache.cayenne.itest.pojo.ExposedPkTest
>> log4j:WARN No appenders could be found for logger
>> (org.apache.cayenne.conf.DefaultConfiguration).
>> log4j:WARN Please initialize the log4j system properly.
>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.785 sec
>> Running org.apache.cayenne.itest.pojo.ManyToOneObjectTest
>> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.068 sec
>> Running org.apache.cayenne.itest.pojo.OneToManyObjectTest
>> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.026 sec
>> Running org.apache.cayenne.itest.pojo.SimpleObjectTest
>> Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.02 sec
>>
>> Results :
>>
>> Tests run: 10, Failures: 0, Errors: 0, Skipped: 0
>>
>> [INFO] [jar:jar {execution: default-jar}]
>> [INFO] Building jar: <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/pojo/target/pojo-3.0-SNAPSHOT.jar
>> >
>> [INFO] [install:install {execution: default-install}]
>> [INFO] Installing <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/pojo/target/pojo-3.0-SNAPSHOT.jar>
>> to
>> /home/jenkins/.m2/repository/org/apache/cayenne/itests/pojo/3.0-SNAPSHOT/pojo-3.0-SNAPSHOT.jar
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Building Integration Tests - JPA Chapter 2
>> [INFO]    task-segment: [clean, install]
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] [clean:clean {execution: default-clean}]
>> [INFO] [resources:resources {execution: default-resources}]
>> [INFO] Using 'UTF-8' encoding to copy filtered resources.
>> [INFO] Copying 1 resource
>> [INFO] [compiler:compile {execution: default-compile}]
>> [INFO] Compiling 35 source files to <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter2/target/classes
>> >
>> [INFO] [resources:testResources {execution: default-testResources}]
>> [INFO] Using 'UTF-8' encoding to copy filtered resources.
>> [INFO] Copying 1 resource
>> [INFO] [compiler:testCompile {execution: default-testCompile}]
>> [INFO] Compiling 8 source files to <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter2/target/test-classes
>> >
>> [INFO] [surefire:test {execution: default-test}]
>> [INFO] Surefire report directory: <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter2/target/surefire-reports
>> >
>> *** CayenneAgent starting...
>>
>> -------------------------------------------------------
>>  T E S T S
>> -------------------------------------------------------
>> Running
>> org.apache.cayenne.jpa.itest.ch2._2_1_8_2_BidiManyToOneRelationshipTest
>> log4j:WARN No appenders could be found for logger
>> (org.apache.cayenne.jpa.Provider).
>> log4j:WARN Please initialize the log4j system properly.
>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.782 sec
>> Running
>> org.apache.cayenne.jpa.itest.ch2._2_1_8_1_BidiOneToOneRelationshipsTest
>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.006 sec
>> Running org.apache.cayenne.jpa.itest.ch2._2_1_5_EmbeddableTest
>> Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.129 sec
>> Running
>> org.apache.cayenne.jpa.itest.ch2._2_1_1_PeristentFieldsAndPropertiesTest
>> Tests run: 5, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.019 sec
>> Running org.apache.cayenne.jpa.itest.ch2._2_1_10_1_SingleTablePerClassTest
>> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.084 sec
>> Running org.apache.cayenne.jpa.itest.ch2._2_1_4_PrimaryKeyAndIdentityTest
>> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.008 sec
>> Running
>> org.apache.cayenne.jpa.itest.ch2._2_1_6_MappingDefaultsNonRelationshipTest
>> Tests run: 4, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.037 sec
>> Running org.apache.cayenne.jpa.itest.ch2._2_1_7_EntityRelationshipsTest
>> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.007 sec
>>
>> Results :
>>
>> Tests run: 20, Failures: 0, Errors: 0, Skipped: 0
>>
>> [INFO] [jar:jar {execution: default-jar}]
>> [INFO] Building jar: <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter2/target/jpa-chapter2-3.0-SNAPSHOT.jar
>> >
>> [INFO] [install:install {execution: default-install}]
>> [INFO] Installing <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter2/target/jpa-chapter2-3.0-SNAPSHOT.jar>
>> to
>> /home/jenkins/.m2/repository/org/apache/cayenne/itests/jpa-chapter2/3.0-SNAPSHOT/jpa-chapter2-3.0-SNAPSHOT.jar
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Building Integration Tests - JPA Chapter 3
>> [INFO]    task-segment: [clean, install]
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] [clean:clean {execution: default-clean}]
>> [INFO] [resources:resources {execution: default-resources}]
>> [INFO] Using 'UTF-8' encoding to copy filtered resources.
>> [INFO] Copying 1 resource
>> [INFO] [compiler:compile {execution: default-compile}]
>> [INFO] Compiling 9 source files to <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter3/target/classes
>> >
>> [INFO] [resources:testResources {execution: default-testResources}]
>> [INFO] Using 'UTF-8' encoding to copy filtered resources.
>> [INFO] Copying 1 resource
>> [INFO] [compiler:testCompile {execution: default-testCompile}]
>> [INFO] Compiling 5 source files to <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter3/target/test-classes
>> >
>> [WARNING] <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter3/src/test/java/org/apache/cayenne/jpa/itest/ch3/_3_6_1_QueryAPITest.java>:[30,22]
>> sun.java2d.pipe.SpanShapeRenderer is Sun proprietary API and may be removed
>> in a future release
>>
>> [WARNING] <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter3/src/test/java/org/apache/cayenne/jpa/itest/ch3/_3_6_1_QueryAPITest.java>:[30,22]
>> sun.java2d.pipe.SpanShapeRenderer is Sun proprietary API and may be removed
>> in a future release
>>
>> [INFO] [surefire:test {execution: default-test}]
>> [INFO] Surefire report directory: <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter3/target/surefire-reports
>> >
>> *** CayenneAgent starting...
>>
>> -------------------------------------------------------
>>  T E S T S
>> -------------------------------------------------------
>> Running
>> org.apache.cayenne.jpa.itest.ch3._3_1_1_EntityManagerTransactionTest
>> log4j:WARN No appenders could be found for logger
>> (org.apache.cayenne.jpa.Provider).
>> log4j:WARN Please initialize the log4j system properly.
>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.748 sec
>> Running org.apache.cayenne.jpa.itest.ch3._3_1_1_EntityManagerTest
>> Tests run: 12, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.135 sec
>> Running org.apache.cayenne.jpa.itest.ch3._3_6_1_QueryAPITest
>> Tests run: 8, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.031 sec
>> Running org.apache.cayenne.jpa.itest.ch3._3_6_6_SQLQueriesTest
>> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.005 sec
>> Running
>> org.apache.cayenne.jpa.itest.ch3._3_5_1_LifecycleCallbackMethodsTest
>> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.01 sec
>>
>> Results :
>>
>> Tests run: 25, Failures: 0, Errors: 0, Skipped: 0
>>
>> [INFO] [jar:jar {execution: default-jar}]
>> [INFO] Building jar: <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter3/target/jpa-chapter3-3.0-SNAPSHOT.jar
>> >
>> [INFO] [install:install {execution: default-install}]
>> [INFO] Installing <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter3/target/jpa-chapter3-3.0-SNAPSHOT.jar>
>> to
>> /home/jenkins/.m2/repository/org/apache/cayenne/itests/jpa-chapter3/3.0-SNAPSHOT/jpa-chapter3-3.0-SNAPSHOT.jar
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Building Integration Tests - JPA Chapter 5
>> [INFO]    task-segment: [clean, install]
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] [clean:clean {execution: default-clean}]
>> [INFO] [resources:resources {execution: default-resources}]
>> [INFO] Using 'UTF-8' encoding to copy filtered resources.
>> [INFO] Copying 1 resource
>> [INFO] [compiler:compile {execution: default-compile}]
>> [INFO] Compiling 2 source files to <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter5/target/classes
>> >
>> [INFO] [resources:testResources {execution: default-testResources}]
>> [INFO] Using 'UTF-8' encoding to copy filtered resources.
>> [INFO] Copying 1 resource
>> [INFO] [compiler:testCompile {execution: default-testCompile}]
>> [INFO] Compiling 3 source files to <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter5/target/test-classes
>> >
>> [INFO] [surefire:test {execution: default-test}]
>> [INFO] Surefire report directory: <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter5/target/surefire-reports
>> >
>> *** CayenneAgent starting...
>>
>> -------------------------------------------------------
>>  T E S T S
>> -------------------------------------------------------
>> Running
>> org.apache.cayenne.jpa.itest.ch5._5_5_2_ResourceLocalEntityManagerTest
>> Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.023 sec
>> Running org.apache.cayenne.jpa.itest.ch5._5_5_1_JtaEntityManagerTest
>> Apache OpenEJB 3.0    build: 20080408-04:13
>> http://openejb.apache.org/
>> log4j:WARN No appenders could be found for logger
>> (org.apache.cayenne.jpa.Provider).
>> log4j:WARN Please initialize the log4j system properly.
>> Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.802 sec
>> <<< FAILURE!
>> Running org.apache.cayenne.jpa.itest.ch5._5_4_EntityMangerFactoryTest
>> Tests run: 2, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.057 sec
>>
>> Results :
>>
>> Tests in error:
>>   testPersist(org.apache.cayenne.jpa.itest.ch5._5_5_1_JtaEntityManagerTest)
>>
>> Tests run: 5, Failures: 0, Errors: 1, Skipped: 0
>>
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] BUILD FAILURE
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] There are test failures.
>>
>> Please refer to <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter5/target/surefire-reports>
>> for the individual test results.
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Trace
>> org.apache.maven.BuildFailureException: There are test failures.
>>
>> Please refer to <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter5/target/surefire-reports>
>> for the individual test results.
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:715)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
>>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
>>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
>>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
>>         at
>> org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
>>         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.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)
>> Caused by: org.apache.maven.plugin.MojoFailureException: There are test
>> failures.
>>
>> Please refer to <
>> https://builds.apache.org/job/Cayenne-30/./jdk=JDK%201.6%20(latest),label=Ubuntu/ws/STABLE-3.0/itests/jpa-chapter5/target/surefire-reports>
>> for the individual test results.
>>         at
>> org.apache.maven.plugin.surefire.SurefirePlugin.execute(SurefirePlugin.java:629)
>>         at
>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
>>         at
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
>>         ... 17 more
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Total time: 1 minute 48 seconds
>> [INFO] Finished at: Fri Aug 31 11:24:39 UTC 2012
>> [INFO] Final Memory: 157M/402M
>> [INFO]
>> ------------------------------------------------------------------------
>> Build step 'Invoke top-level Maven targets' marked build as failure
>> Recording test results
>>

Reply via email to