Précédent   Forum du club des développeurs et IT Pro > Bases de données > Autres SGBD
Autres SGBD Vos questions sur les autres SGBD
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse
 
Outils de la discussion
Publicité
'
Vieux 14/07/2012, 11h50   #1
pcouas
Membre confirmé
 
Inscription : janvier 2007
Messages : 886
Détails du profil
Informations forums :
Inscription : janvier 2007
Messages : 886
Points : 264
Points : 264
Par défaut Object not found: SYSTEM_TABLE_CONSTRAINTS

Bonjour,

J'utilise HSQLDB 2.2.8 avec Unitilis 3.3 un framework de test qui utilise dbunit notament, et j'ai le message d'erreur de connection suivant :

Caused by: org.hsqldb.HsqlException: user lacks privilege or object not found: SYSTEM_TABLE_CONSTRAINTS

Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
 
 
  <testcase time="0.468" classname="com.example.EmployeeDao2Test" name="count2">
    <error message="Error inserting test data from DbUnit dataset for method public void com.example.EmployeeDao2Test.count2() throws com.example.IEmployeeDao$DataAccessException" type="org.unitils.core.UnitilsException">org.unitils.core.UnitilsException: Error inserting test DATA FROM DbUnit dataset FOR method public void com.example.EmployeeDao2Test.count2() throws com.example.IEmployeeDao$DataAccessException
	at org.unitils.dbunit.DbUnitModule.insertTestData(DbUnitModule.java:151)
	at org.unitils.dbunit.DbUnitModule$DbUnitListener.beforeTestMethod(DbUnitModule.java:477)
	at org.unitils.core.Unitils$UnitilsTestListener.beforeTestMethod(Unitils.java:242)
	at org.unitils.UnitilsJUnit4TestClassRunner$CustomTestMethodRunner.executeMethodBody(UnitilsJUnit4TestClassRunner.java:207)
	at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
	at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
	at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
	at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
	at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
	at org.unitils.UnitilsJUnit4TestClassRunner$CustomTestClassMethodsRunner.invokeTestMethod(UnitilsJUnit4TestClassRunner.java:141)
	at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
	at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
	at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
	at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
	at org.unitils.UnitilsJUnit4TestClassRunner.run(UnitilsJUnit4TestClassRunner.java:84)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:236)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:134)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:113)
	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.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:103)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:74)
Caused BY: org.unitils.core.UnitilsException: Unable TO CREATE DbUnit dataset FOR file EmployeeDaoTest.findsForTitleOnly.xml
	at org.unitils.dbunit.DbUnitModule.getDataSet(DbUnitModule.java:310)
	at org.unitils.dbunit.DbUnitModule.getTestDataSets(DbUnitModule.java:251)
	at org.unitils.dbunit.DbUnitModule.insertTestData(DbUnitModule.java:139)
	... 26 more
Caused BY: org.unitils.core.UnitilsException: Unable TO CREATE DbUnit dataset FOR input stream.
	at org.unitils.dbunit.DbUnitModule.getDataSet(DbUnitModule.java:334)
	at org.unitils.dbunit.DbUnitModule.getDataSet(DbUnitModule.java:307)
	... 28 more
Caused BY: org.unitils.core.UnitilsException: Error while updating DATABASE
	at org.unitils.DATABASE.DatabaseModule.updateDatabase(DatabaseModule.java:174)
	at org.unitils.DATABASE.DatabaseModule.createDataSource(DatabaseModule.java:237)
	at org.unitils.DATABASE.DatabaseModule.getDataSource(DatabaseModule.java:116)
	at org.unitils.dbunit.DbUnitModule.getDataSet(DbUnitModule.java:326)
	... 29 more
Caused BY: org.unitils.core.UnitilsException: Error while executing statement: SELECT CONSTRAINT_NAME FROM INFORMATION_SCHEMA.SYSTEM_TABLE_CONSTRAINTS WHERE CONSTRAINT_TYPE = &apos;FOREIGN KEY&apos; AND TABLE_NAME = &apos;DB_VERSION&apos; AND CONSTRAINT_SCHEMA = &apos;PUBLIC&apos;
	at org.unitils.core.dbsupport.SQLHandler.getItemsAsStringSet(SQLHandler.java:215)
	at org.unitils.core.dbsupport.HsqldbDbSupport.getForeignKeyConstraintNames(HsqldbDbSupport.java:163)
	at org.unitils.dbmaintainer.structure.impl.DefaultConstraintsDisabler.removeForeignKeyConstraints(DefaultConstraintsDisabler.java:70)
	at org.unitils.dbmaintainer.structure.impl.DefaultConstraintsDisabler.disableConstraints(DefaultConstraintsDisabler.java:56)
	at org.unitils.dbmaintainer.DBMaintainer.updateDatabase(DBMaintainer.java:207)
	at org.unitils.DATABASE.DatabaseModule.updateDatabase(DatabaseModule.java:171)
	... 32 more
Caused BY: java.sql.SQLSyntaxErrorException: user lacks privilege OR object NOT found: SYSTEM_TABLE_CONSTRAINTS
	at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
	at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
	at org.hsqldb.jdbc.JDBCStatement.fetchResult(Unknown Source)
	at org.hsqldb.jdbc.JDBCStatement.executeQuery(Unknown Source)
	at org.apache.commons.dbcp.DelegatingStatement.executeQuery(DelegatingStatement.java:208)
	at org.unitils.core.dbsupport.SQLHandler.getItemsAsStringSet(SQLHandler.java:207)
	... 37 more
Caused BY: org.hsqldb.HsqlException: user lacks privilege OR object NOT found: SYSTEM_TABLE_CONSTRAINTS
	at org.hsqldb.error.Error.error(Unknown Source)
	at org.hsqldb.error.Error.error(Unknown Source)
	at org.hsqldb.SchemaManager.getTable(Unknown Source)
	at org.hsqldb.ParserDQL.readTableName(Unknown Source)
	at org.hsqldb.ParserDQL.readTableOrSubquery(Unknown Source)
	at org.hsqldb.ParserDQL.XreadTableReference(Unknown Source)
	at org.hsqldb.ParserDQL.XreadFromClause(Unknown Source)
	at org.hsqldb.ParserDQL.XreadTableExpression(Unknown Source)
	at org.hsqldb.ParserDQL.XreadQuerySpecification(Unknown Source)
	at org.hsqldb.ParserDQL.XreadSimpleTable(Unknown Source)
	at org.hsqldb.ParserDQL.XreadQueryPrimary(Unknown Source)
	at org.hsqldb.ParserDQL.XreadQueryTerm(Unknown Source)
	at org.hsqldb.ParserDQL.XreadQueryExpressionBody(Unknown Source)
	at org.hsqldb.ParserDQL.XreadQueryExpression(Unknown Source)
	at org.hsqldb.ParserDQL.compileCursorSpecification(Unknown Source)
	at org.hsqldb.ParserCommand.compilePart(Unknown Source)
	at org.hsqldb.ParserCommand.compileStatements(Unknown Source)
	at org.hsqldb.Session.executeDirectStatement(Unknown Source)
	at org.hsqldb.Session.execute(Unknown Source)
	... 41 more
</error>
    <system-err>log4j:WARN No appenders could be found FOR logger (org.unitils.core.ConfigurationLoader).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
</system-err>
  </testcase>
</testsuite>
 
 
ebean.properties file
 
## Specific Log levels (none, summary, binding, sql)
ebean.logging.iud=sql
ebean.logging.query=sql
ebean.logging.sqlquery=sql
 
## Log level for txn begin, commit and rollback (none, debug, verbose)
ebean.logging.txnCommit=none
 
 
 
## -------------------------------------------------------------
## DataSources (If using default Ebean DataSourceFactory)
## ------------------------------------------------------------- 
 
#DEFINI ebean.server
datasource.DEFAULT=hsqldb
 
datasource.hsqldb.username=SA
datasource.hsqldb.password=
datasource.hsqldb.databaseUrl=jdbc:hsqldb:mem:unitils-example
datasource.hsqldb.databaseDriver=org.hsqldb.jdbcDriver
datasource.hsqldb.minConnections=1
datasource.hsqldb.maxConnections=25
datasource.hsqldb.heartbeatsql=SELECT COUNT(1) FROM INFORMATION_SCHEMA.SYSTEM_CATALOGS
datasource.hsqldb.isolationlevel=read_committed
 
___________________
unitilis properties file
# comments documenting these unitils configuration properties removed for
# brevity. look for commenting in unitils-default.properties in the root of the
# unitils jar if needed.
 
unitils.modules=DATABASE,dbunit,easymock,inject
 
unitils.module.hibernate.enabled=false
unitils.module.spring.enabled=false
 
# these placeholders are set in avaje.properties
#gere la configuration DBUNIT
DATABASE.driverClassName=org.hsqldb.jdbcDriver
DATABASE.url=jdbc:hsqldb:mem:unitils-example
DATABASE.schemaNames=PUBLIC
DATABASE.userName=SA
DATABASE.password=
DATABASE.dialect=hsqldb
 
# unitils will construct the test database using the ddl file found in this
# directory
dbMaintainer.fileScriptSource.scripts.location=src/main/resources
 
updateDataBaseSchema.enabled=true
sequenceUpdater.sequencevalue.lowestacceptable=100
 
dataSetStructureGenerator.xsd.dirName=src/test/resources/dataset-schema
 
____
DDL file
SET SCHEMA PUBLIC;   
CREATE TABLE EMPLOYEES(ID INTEGER NOT NULL PRIMARY KEY,NAME VARCHAR(20),TITLE VARCHAR(20),SALARY DOUBLE)
Auriez vous une idee de mon soucis ?
Merci d'avance Philippe


Regards
Philippe
pcouas est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 15/07/2012, 09h41   #2
pcouas
Membre confirmé
 
Inscription : janvier 2007
Messages : 886
Détails du profil
Informations forums :
Inscription : janvier 2007
Messages : 886
Points : 264
Points : 264
UNITILIS ou DBUNIT ne semble pas prendre en compte HSQDB 2.x
pcouas est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse
Outils de la discussion

Navigation rapide


Fuseau horaire GMT +2. Il est actuellement 14h14.


 
 
 
 
Partenaires

Hébergement Web