|
|
ERROR org.hibernate.util.JDBCExceptionReporter
Hello, I have a problem and I hope that you help me
Configuration project:
-STS 2.5.2
-java 1.6
-roo 1.1.1
-postgres 8.4
-windows 7
My database have two tables: worker, companydatabase instrospect return:
lt;database name=quot;publicquot;gt; lt;option key=quot;includedTablesquot; value=quot;worker,companyquot;/gt; lt;table name=quot;companyquot;gt; lt;column name=quot;idquot; primaryKey=quot;truequot; required=quot;truequot; size=quot;10quot; type=quot;4,serialquot;/gt; lt;column name=quot;namequot; primaryKey=quot;falsequot; required=quot;truequot; size=quot;50quot; type=quot;12,varcharquot;/gt; lt;column name=quot;versionquot; primaryKey=quot;falsequot; required=quot;falsequot; size=quot;10quot; type=quot;4,int4quot;/gt; lt;foreign-key foreignTable=quot;workerquot; name=quot;fk_worker_companyquot; onDelete=quot;nonequot; onUpdate=quot;nonequot;gt;lt;option key=quot;exportedquot; value=quot;truequot;/gt;lt;reference foreign=quot;company_idquot; local=quot;idquot;/gt; lt;/foreign-keygt; lt;unique name=quot;pk_companyquot;gt;lt;unique-column name=quot;idquot;/gt; lt;/uniquegt; lt;unique name=quot;uq_company_namequot;gt;lt;unique-column name=quot;namequot;/gt; lt;/uniquegt; lt;/tablegt; lt;table name=quot;workerquot;gt; lt;column name=quot;idquot; primaryKey=quot;truequot; required=quot;truequot; size=quot;10quot; type=quot;4,serialquot;/gt; lt;column name=quot;namequot; primaryKey=quot;falsequot; required=quot;truequot; size=quot;50quot; type=quot;12,varcharquot;/gt; lt;column name=quot;company_idquot; primaryKey=quot;falsequot; required=quot;truequot; size=quot;10quot; type=quot;4,int4quot;/gt; lt;column name=quot;versionquot; primaryKey=quot;falsequot; required=quot;falsequot; size=quot;10quot; type=quot;4,int4quot;/gt; lt;foreign-key foreignTable=quot;companyquot; name=quot;fk_worker_companyquot; onDelete=quot;nonequot; onUpdate=quot;nonequot;gt;lt;option key=quot;exportedquot; value=quot;falsequot;/gt;lt;reference foreign=quot;idquot; local=quot;company_idquot;/gt; lt;/foreign-keygt; lt;unique name=quot;pk_workerquot;gt;lt;unique-column name=quot;idquot;/gt; lt;/uniquegt; lt;/tablegt;
lt;/databasegt;
My problem is: the command perform tests return this:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building companyApp
[INFO] task-segment: [test]
[INFO] ------------------------------------------------------------------------
[INFO] [aspectj:compile {execution: default}]
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] [compiler:compile {execution: default-compile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [aspectj:test-compile {execution: default}]
[INFO] [resources:testResources {execution: default-testResources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 0 resource
[INFO] [compiler:testCompile {execution: default-testCompile}]
[INFO] Nothing to compile - all classes are up to date
[INFO] [surefire:test {execution: default-test}]
[INFO] Surefire report directory: C:\proyectos\companyApp\target\surefire-reports
-------------------------------------------------------T E S T S
-------------------------------------------------------
Running company.CompanyIntegrationTest
Tests run: 9, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 5.047 sec
Running company.WorkerIntegrationTest
2011-02-15 12:58:35,942 [main] ERROR org.hibernate.util.JDBCExceptionReporter - Batch entry 0 insert into public.worker (company_id, name, version, id) values (NULL, 'name_0', '0', '260') was aborted. Call getNextException to see the cause.
2011-02-15 12:58:35,943 [main] ERROR org.hibernate.util.JDBCExceptionReporter - ERROR: el valor null para la columna «company_id» viola la restricción not null
2011-02-15 12:58:35,945 [main] ERROR org.hibernate.event.def.AbstractFlushingEventListe ner - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationExcepti on: Could not execute JDBC batch update
Tests run: 9, Failures: 0, Errors: 8, Skipped: 0, Time elapsed: 0.36 sec lt;lt;lt; FAILURE!
Results :
Tests in error: testFlush(company.WorkerIntegrationTest) testMerge(company.WorkerIntegrationTest) testPersist(company.WorkerIntegrationTest) testRemove(company.WorkerIntegrationTest) testCountWorkers(company.WorkerIntegrationTest) testFindWorker(company.WorkerIntegrationTest) testFindAllWorkers(company.WorkerIntegrationTest) testFindWorkerEntries(company.WorkerIntegrationTes t)
Tests run: 18, Failures: 0, Errors: 8, Skipped: 0
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.
Please refer to C:\proyectos\companyApp\target\surefire-reports for the individual test results.
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 10 seconds
[INFO] Finished at: Tue Feb 15 12:58:36 VET 2011
[INFO] Final Memory: 22M/55M
[INFO] ------------------------------------------------------------------------ |
|