-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 
Author Message
 Post subject: problem building caveatemptor with firebird 1.5 ss
PostPosted: Tue Nov 09, 2004 2:30 pm 
Newbie

Joined: Mon Nov 08, 2004 6:41 pm
Posts: 5
Location: Asuncion, Paraguay
Hibernate version: 2.1.6
database i'm using: firebird ss 1.5 under gentoo linux 2.6.8.1

The jdbc driver is in the lib directory.

My hibernate.cfg.xml

<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd">

<hibernate-configuration>
<session-factory>

<!-- Don't forget to copy your JDBC driver to the lib/ directory! -->

<!-- Settings for a local Firebird database.-->
<property name="dialect">net.sf.hibernate.dialect.FirebirdDialect</property>
<property name="connection.driver_class">org.firebirdsql.jdbc.FBDriver</property>
<property name="connection.url">
jdbc:firebirdsql://localhost:3050/mydb.fdb
</property>
<property name="connection.username">sysdba</property>
<property name="connection.password">8110humbi</property>





<!-- Use the C3P0 connection pool.
<property name="c3p0.min_size">3</property>
<property name="c3p0.max_size">5</property>
<property name="c3p0.timeout">1800</property>
-->

<!-- Use the Hibernate built-in pool for tests. -->
<property name="connection.pool_size">1</property>

<!-- Use EHCache but not the query cache. -->
<property name="cache.provider_class">net.sf.ehcache.hibernate.Provider</property>
<property name="cache.use_query_cache">false</property>
<property name="cache.use_minimal_puts">false</property>

<!-- Print SQL to stdout. -->
<property name="show_sql">false</property>

<!-- CaveatEmptor mapping files. -->
<mapping resource="org/hibernate/auction/model/User.hbm.xml"/>
<mapping resource="org/hibernate/auction/model/Item.hbm.xml"/>
<mapping resource="org/hibernate/auction/model/Category.hbm.xml"/>
<mapping resource="org/hibernate/auction/model/CategorizedItem.hbm.xml"/>
<mapping resource="org/hibernate/auction/model/Bid.hbm.xml"/>
<mapping resource="org/hibernate/auction/model/BillingDetails.hbm.xml"/>
<mapping resource="org/hibernate/auction/model/Comment.hbm.xml"/>
<mapping resource="org/hibernate/auction/persistence/audit/AuditLogRecord.hbm.xml"/>

</session-factory>
</hibernate-configuration>


When i run ant under the unpacked directory caveatemptor, this is the outpu:
goku2@onizuka-sensei Caveatemptor $ ant
Buildfile: build.xml

cleantestdb:

clean:
[delete] Deleting directory /home/goku2/eclipse_projects/Caveatemptor/build
[delete] Deleting directory /home/goku2/eclipse_projects/Caveatemptor/testout

compiletest:
[mkdir] Created dir: /home/goku2/eclipse_projects/Caveatemptor/build/standalone
[javac] Compiling 52 source files to /home/goku2/eclipse_projects/Caveatemptor/build/standalone
[copy] Copying 12 files to /home/goku2/eclipse_projects/Caveatemptor/build/standalone

junit:
[mkdir] Created dir: /home/goku2/eclipse_projects/Caveatemptor/testout
[junit] Running org.hibernate.auction.test.AllTests
[junit] Tests run: 6, Failures: 0, Errors: 6, Time elapsed: 1.408 sec
[junit] Test org.hibernate.auction.test.AllTests FAILED

BUILD SUCCESSFUL
Total time: 9 seconds

In the directory testout there's a txt named TEST-org.hibernate.auction.test.AllTests.txt whit this content:
Testsuite: org.hibernate.auction.test.AllTests
Tests run: 6, Failures: 0, Errors: 6, Time elapsed: 1.488 sec
------------- Standard Output ---------------
15:21:42,999 INFO Environment: Hibernate 2.1.6
15:21:43,002 INFO Environment: hibernate.properties not found
15:21:43,008 INFO Environment: using CGLIB reflection optimizer
15:21:43,016 INFO Configuration: configuring from resource: /hibernate.cfg.xml
15:21:43,016 INFO Configuration: Configuration resource: /hibernate.cfg.xml
15:21:43,190 INFO Configuration: Mapping resource: org/hibernate/auction/model/User.hbm.xml
15:21:43,335 INFO Binder: Mapping class: org.hibernate.auction.model.User -> USERS
15:21:43,736 INFO Configuration: Mapping resource: org/hibernate/auction/model/Item.hbm.xml
15:21:43,793 INFO Binder: Mapping class: org.hibernate.auction.model.Item -> ITEM
15:21:43,870 INFO Configuration: Mapping resource: org/hibernate/auction/model/Category.hbm.xml
15:21:43,902 INFO Binder: Mapping class: org.hibernate.auction.model.Category -> CATEGORY
15:21:43,908 INFO Configuration: Mapping resource: org/hibernate/auction/model/CategorizedItem.hbm.xml
15:21:43,933 INFO Binder: Mapping class: org.hibernate.auction.model.CategorizedItem -> CATEGORIZED_ITEM
15:21:43,952 INFO Configuration: Mapping resource: org/hibernate/auction/model/Bid.hbm.xml
15:21:43,968 INFO Binder: Mapping class: org.hibernate.auction.model.Bid -> BID
15:21:43,968 INFO Configuration: Mapping resource: org/hibernate/auction/model/BillingDetails.hbm.xml
15:21:44,014 INFO Binder: Mapping class: org.hibernate.auction.model.BillingDetails -> BILLING_DETAILS
15:21:44,074 INFO Binder: Mapping joined-subclass: org.hibernate.auction.model.CreditCard -> CREDIT_CARD
15:21:44,093 INFO Binder: Mapping joined-subclass: org.hibernate.auction.model.BankAccount -> BANK_ACCOUNT
15:21:44,094 INFO Configuration: Mapping resource: org/hibernate/auction/model/Comment.hbm.xml
15:21:44,126 INFO Binder: Mapping class: org.hibernate.auction.model.Comment -> COMMENTS
15:21:44,131 INFO Configuration: Mapping resource: org/hibernate/auction/persistence/audit/AuditLogRecord.hbm.xml
15:21:44,147 INFO Binder: Mapping class: org.hibernate.auction.persistence.audit.AuditLogRecord -> AUDIT_LOG
15:21:44,148 INFO Configuration: Configured SessionFactory: null
15:21:44,151 INFO Configuration: processing one-to-many association mappings
15:21:44,151 INFO Binder: Mapping collection: org.hibernate.auction.model.User.items -> ITEM
15:21:44,151 INFO Binder: Mapping collection: org.hibernate.auction.model.User.billingDetails -> BILLING_DETAILS
15:21:44,151 INFO Binder: Mapping collection: org.hibernate.auction.model.Item.categorizedItems -> CATEGORIZED_ITEM
15:21:44,152 INFO Binder: Mapping collection: org.hibernate.auction.model.Item.bids -> BID
15:21:44,152 INFO Binder: Mapping collection: org.hibernate.auction.model.Category.childCategories -> CATEGORY
15:21:44,152 INFO Binder: Mapping collection: org.hibernate.auction.model.Category.categorizedItems -> CATEGORIZED_ITEM
15:21:44,152 INFO Configuration: processing one-to-one association property references
15:21:44,152 INFO Configuration: processing foreign key constraints
15:21:44,186 INFO Dialect: Using dialect: net.sf.hibernate.dialect.FirebirdDialect
15:21:44,189 INFO SettingsFactory: Use outer join fetching: true
15:21:44,195 INFO DriverManagerConnectionProvider: Using Hibernate built-in connection pool (not for production use!)
15:21:44,195 INFO DriverManagerConnectionProvider: Hibernate connection pool size: 1
15:21:44,206 ERROR HibernateUtil: Building SessionFactory failed.
java.lang.NoClassDefFoundError: javax/resource/ResourceException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at net.sf.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:55)
at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:83)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:65)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1155)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:789)
at org.hibernate.auction.persistence.HibernateUtil.<clinit>(Unknown Source)
at org.hibernate.auction.test.TestCase.setUp(Unknown Source)
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 junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:289)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:523)
15:21:44,223 INFO DriverManagerConnectionProvider: cleaning up connection pool: null
------------- ---------------- ---------------

Testcase: testItemData took 1.445 sec
Caused an ERROR
null
java.lang.ExceptionInInitializerError
at org.hibernate.auction.persistence.HibernateUtil.<clinit>(Unknown Source)
at org.hibernate.auction.test.TestCase.setUp(Unknown Source)
Caused by: java.lang.NoClassDefFoundError: javax/resource/ResourceException
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at net.sf.hibernate.connection.DriverManagerConnectionProvider.configure(DriverManagerConnectionProvider.java:55)
at net.sf.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:83)
at net.sf.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:65)
at net.sf.hibernate.cfg.Configuration.buildSettings(Configuration.java:1155)
at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:789)
... 13 more

Testcase: testPlaceBid took 0.001 sec
Caused an ERROR
null
java.lang.NoClassDefFoundError
at org.hibernate.auction.test.TestCase.setUp(Unknown Source)

Testcase: testAuditLog took 0 sec
Caused an ERROR
null
java.lang.NoClassDefFoundError
at org.hibernate.auction.test.TestCase.setUp(Unknown Source)

Testcase: testCompositeQuery took 0 sec
Caused an ERROR
null
java.lang.NoClassDefFoundError
at org.hibernate.auction.test.TestCase.setUp(Unknown Source)

Testcase: testDeletionFromItem took 0 sec
Caused an ERROR
null
java.lang.NoClassDefFoundError
at org.hibernate.auction.test.TestCase.setUp(Unknown Source)

Testcase: testDeletionFromCategory took 0 sec
Caused an ERROR
null
java.lang.NoClassDefFoundError
at org.hibernate.auction.test.TestCase.setUp(Unknown Source)

Please help me!! :)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 09, 2004 2:31 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
Copy jta.jar to your classpath.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 09, 2004 4:59 pm 
Newbie

Joined: Mon Nov 08, 2004 6:41 pm
Posts: 5
Location: Asuncion, Paraguay
Ok, i did that.. it was a silly error. sorry.. al the jars al in the lib directory.. This is te result i got:
Testsuite: org.hibernate.auction.test.AllTests
Tests run: 6, Failures: 0, Errors: 6, Time elapsed: 7.766 sec
------------- Standard Output ---------------
17:44:00,637 INFO Environment: Hibernate 2.1.6
17:44:00,640 INFO Environment: hibernate.properties not found
17:44:00,646 INFO Environment: using CGLIB reflection optimizer
17:44:00,656 INFO Configuration: configuring from resource: /hibernate.cfg.xml
17:44:00,656 INFO Configuration: Configuration resource: /hibernate.cfg.xml
17:44:00,905 INFO Configuration: Mapping resource: org/hibernate/auction/model/User.hbm.xml
17:44:01,137 INFO Binder: Mapping class: org.hibernate.auction.model.User -> USERS
17:44:01,555 INFO Configuration: Mapping resource: org/hibernate/auction/model/Item.hbm.xml
17:44:01,626 INFO Binder: Mapping class: org.hibernate.auction.model.Item -> ITEM
17:44:01,649 INFO Configuration: Mapping resource: org/hibernate/auction/model/Category.hbm.xml
17:44:01,697 INFO Binder: Mapping class: org.hibernate.auction.model.Category -> CATEGORY
17:44:01,701 INFO Configuration: Mapping resource: org/hibernate/auction/model/CategorizedItem.hbm.xml
17:44:01,753 INFO Binder: Mapping class: org.hibernate.auction.model.CategorizedItem -> CATEGORIZED_ITEM
17:44:01,769 INFO Configuration: Mapping resource: org/hibernate/auction/model/Bid.hbm.xml
17:44:01,809 INFO Binder: Mapping class: org.hibernate.auction.model.Bid -> BID
17:44:01,810 INFO Configuration: Mapping resource: org/hibernate/auction/model/BillingDetails.hbm.xml
17:44:01,878 INFO Binder: Mapping class: org.hibernate.auction.model.BillingDetails -> BILLING_DETAILS
17:44:01,932 INFO Binder: Mapping joined-subclass: org.hibernate.auction.model.CreditCard -> CREDIT_CARD
17:44:01,939 INFO Binder: Mapping joined-subclass: org.hibernate.auction.model.BankAccount -> BANK_ACCOUNT
17:44:01,940 INFO Configuration: Mapping resource: org/hibernate/auction/model/Comment.hbm.xml
17:44:01,962 INFO Binder: Mapping class: org.hibernate.auction.model.Comment -> COMMENTS
17:44:01,966 INFO Configuration: Mapping resource: org/hibernate/auction/persistence/audit/AuditLogRecord.hbm.xml
17:44:01,994 INFO Binder: Mapping class: org.hibernate.auction.persistence.audit.AuditLogRecord -> AUDIT_LOG
17:44:01,994 INFO Configuration: Configured SessionFactory: null
17:44:01,995 INFO Configuration: processing one-to-many association mappings
17:44:01,995 INFO Binder: Mapping collection: org.hibernate.auction.model.User.items -> ITEM
17:44:01,996 INFO Binder: Mapping collection: org.hibernate.auction.model.User.billingDetails -> BILLING_DETAILS
17:44:01,996 INFO Binder: Mapping collection: org.hibernate.auction.model.Item.categorizedItems -> CATEGORIZED_ITEM
17:44:01,996 INFO Binder: Mapping collection: org.hibernate.auction.model.Item.bids -> BID
17:44:01,996 INFO Binder: Mapping collection: org.hibernate.auction.model.Category.childCategories -> CATEGORY
17:44:01,996 INFO Binder: Mapping collection: org.hibernate.auction.model.Category.categorizedItems -> CATEGORIZED_ITEM
17:44:01,996 INFO Configuration: processing one-to-one association property references
17:44:01,996 INFO Configuration: processing foreign key constraints
17:44:02,031 INFO Dialect: Using dialect: net.sf.hibernate.dialect.FirebirdDialect
17:44:02,031 INFO SettingsFactory: Use outer join fetching: true
17:44:02,041 INFO DriverManagerConnectionProvider: Using Hibernate built-in connection pool (not for production use!)
17:44:02,041 INFO DriverManagerConnectionProvider: Hibernate connection pool size: 1
17:44:02,054 INFO DriverManagerConnectionProvider: using driver: org.firebirdsql.jdbc.FBDriver at URL: jdbc:firebirdsql://localhost:3050/mydb.fdb
17:44:02,055 INFO DriverManagerConnectionProvider: connection properties: {user=sysdba, password=8110humbi}
17:44:02,066 INFO TransactionManagerLookupFactory: No TransactionManagerLookup configured (in JTA environment, use of process level read-write cache is not recommended)
17:44:02,345 INFO SettingsFactory: Use scrollable result sets: false
17:44:02,346 INFO SettingsFactory: Use JDBC3 getGeneratedKeys(): false
17:44:02,346 INFO SettingsFactory: Optimize cache for minimal puts: false
17:44:02,346 INFO SettingsFactory: Query language substitutions: {}
17:44:02,346 INFO SettingsFactory: cache provider: net.sf.ehcache.hibernate.Provider
17:44:02,351 INFO Configuration: instantiating and configuring caches
17:44:02,390 INFO SessionFactoryImpl: building session factory
17:44:03,566 INFO SessionFactoryObjectFactory: Not binding factory to JNDI, no JNDI name configured
17:44:03,566 INFO Dialect: Using dialect: net.sf.hibernate.dialect.FirebirdDialect
17:44:03,566 INFO Configuration: processing one-to-many association mappings
17:44:03,566 INFO Configuration: processing one-to-one association property references
17:44:03,567 INFO Configuration: processing foreign key constraints
17:44:03,567 INFO Configuration: processing one-to-many association mappings
17:44:03,567 INFO Configuration: processing one-to-one association property references
17:44:03,567 INFO Configuration: processing foreign key constraints
17:44:03,572 INFO SchemaExport: Running hbm2ddl schema export
17:44:03,572 INFO SchemaExport: exporting generated schema to database
17:44:03,572 INFO DriverManagerConnectionProvider: Using Hibernate built-in connection pool (not for production use!)
17:44:03,572 INFO DriverManagerConnectionProvider: Hibernate connection pool size: 1
17:44:03,572 INFO DriverManagerConnectionProvider: using driver: org.firebirdsql.jdbc.FBDriver at URL: jdbc:firebirdsql://localhost:3050/mydb.fdb
17:44:03,573 INFO DriverManagerConnectionProvider: connection properties: {user=sysdba, password=8110humbi}
17:44:03,721 ERROR SchemaExport: Unsuccessful: create table AUDIT_LOG (AUDIT_LOG_ID numeric(18,0) not null, MESSAGE varchar(255) not null, ENTITY_ID numeric(18,0) not null, ENTITY_CLASS varchar(255) not null, USER_ID numeric(18,0) not null, CREATED timestamp not null, primary key (AUDIT_LOG_ID))
17:44:03,721 ERROR SchemaExport: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -104
Token unknown - line 1, char 62
MESSAGE
17:44:03,745 ERROR SchemaExport: Unsuccessful: create table CATEGORY (CATEGORY_ID numeric(18,0) not null, VERSION integer not null, NAME varchar(255) not null, CREATED timestamp not null, PARENT_CATEGORY_ID numeric(18,0), primary key (CATEGORY_ID), unique (NAME, PARENT_CATEGORY_ID))
17:44:03,745 ERROR SchemaExport: GDS Exception. 335544351. unsuccessful metadata update
key size too big for index RDB$913
17:44:03,833 ERROR SchemaExport: Unsuccessful: alter table COMMENTS add constraint FK3_ITEM_ID foreign key (ITEM_ID) references ITEM
17:44:03,833 ERROR SchemaExport: Resource Exception. unsuccessful metadata update
object ITEM is in use
Reason: unsuccessful metadata update
object ITEM is in use
17:44:03,840 ERROR SchemaExport: Unsuccessful: alter table COMMENTS add constraint FK2_FROM_USER_ID foreign key (FROM_USER_ID) references USERS
17:44:03,841 ERROR SchemaExport: Resource Exception. unsuccessful metadata update
object USERS is in use
Reason: unsuccessful metadata update
object USERS is in use
17:44:03,848 ERROR SchemaExport: Unsuccessful: alter table CREDIT_CARD add constraint FK1_CREDIT_CARD_ID foreign key (CREDIT_CARD_ID) references BILLING_DETAILS
17:44:03,848 ERROR SchemaExport: Resource Exception. unsuccessful metadata update
object BILLING_DETAILS is in use
Reason: unsuccessful metadata update
object BILLING_DETAILS is in use
17:44:03,857 ERROR SchemaExport: Unsuccessful: alter table BILLING_DETAILS add constraint FK1_USER_ID foreign key (USER_ID) references USERS
17:44:03,857 ERROR SchemaExport: Resource Exception. unsuccessful metadata update
object USERS is in use
Reason: unsuccessful metadata update
object USERS is in use
17:44:03,864 ERROR SchemaExport: Unsuccessful: alter table BANK_ACCOUNT add constraint FK1_BANK_ACCOUNT_ID foreign key (BANK_ACCOUNT_ID) references BILLING_DETAILS
17:44:03,864 ERROR SchemaExport: Resource Exception. unsuccessful metadata update
object BILLING_DETAILS is in use
Reason: unsuccessful metadata update
object BILLING_DETAILS is in use
17:44:03,872 ERROR SchemaExport: Unsuccessful: alter table CATEGORIZED_ITEM add constraint FK1C7A5407A8EEBDC7 foreign key (ITEM_ID) references ITEM
17:44:03,872 ERROR SchemaExport: Resource Exception. unsuccessful metadata update
object ITEM is in use
Reason: unsuccessful metadata update
object ITEM is in use
17:44:03,874 ERROR SchemaExport: Unsuccessful: alter table CATEGORIZED_ITEM add constraint FK1C7A5407DBFCB7FC foreign key (CATEGORY_ID) references CATEGORY
17:44:03,874 ERROR SchemaExport: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -607
Invalid command
"REFERENCES table" without "(column)" requires PRIMARY KEY on referenced table
17:44:03,876 ERROR SchemaExport: Unsuccessful: alter table CATEGORY add constraint FK1_PARENT_CATEGORY_ID foreign key (PARENT_CATEGORY_ID) references CATEGORY
17:44:03,876 ERROR SchemaExport: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -607
Invalid command
"REFERENCES table" without "(column)" requires PRIMARY KEY on referenced table
17:44:03,884 ERROR SchemaExport: Unsuccessful: alter table ITEM add constraint FK1_APPROVED_BY_USER_ID foreign key (APPROVED_BY_USER_ID) references USERS
17:44:03,884 ERROR SchemaExport: Resource Exception. unsuccessful metadata update
object USERS is in use
Reason: unsuccessful metadata update
object USERS is in use
17:44:03,893 ERROR SchemaExport: Unsuccessful: alter table ITEM add constraint FK2_SELLER_ID foreign key (SELLER_ID) references USERS
17:44:03,893 ERROR SchemaExport: Resource Exception. unsuccessful metadata update
object USERS is in use
Reason: unsuccessful metadata update
object USERS is in use
17:44:03,901 ERROR SchemaExport: Unsuccessful: alter table ITEM add constraint FK3_SUCCESSFUL_BID_ID foreign key (SUCCESSFUL_BID_ID) references BID
17:44:03,901 ERROR SchemaExport: Resource Exception. unsuccessful metadata update
object BID is in use
Reason: unsuccessful metadata update
object BID is in use
17:44:03,909 ERROR SchemaExport: Unsuccessful: alter table USERS add constraint FK1_DEFAULT_BILLING_DETAILS_ID foreign key (DEFAULT_BILLING_DETAILS_ID) references BILLING_DETAILS
17:44:03,910 ERROR SchemaExport: Resource Exception. unsuccessful metadata update
object BILLING_DETAILS is in use
Reason: unsuccessful metadata update
object BILLING_DETAILS is in use
17:44:03,918 ERROR SchemaExport: Unsuccessful: alter table BID add constraint FK2_BIDDER_ID foreign key (BIDDER_ID) references USERS
17:44:03,918 ERROR SchemaExport: Resource Exception. unsuccessful metadata update
object USERS is in use
Reason: unsuccessful metadata update
object USERS is in use
17:44:03,926 ERROR SchemaExport: Unsuccessful: alter table BID add constraint FK1_ITEM_ID foreign key (ITEM_ID) references ITEM
17:44:03,926 ERROR SchemaExport: Resource Exception. unsuccessful metadata update
object ITEM is in use
Reason: unsuccessful metadata update
object ITEM is in use
17:44:03,927 INFO SchemaExport: schema export complete
17:44:03,930 INFO DriverManagerConnectionProvider: cleaning up connection pool: jdbc:firebirdsql://localhost:3050/mydb.fdb
Running test...
17:44:04,184 WARN JDBCExceptionReporter: SQL Error: 335544569, SQLState: HY000
17:44:04,184 ERROR JDBCExceptionReporter: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -204
Table unknown
CATEGORY
At line 1, column 13.
17:44:04,191 WARN JDBCExceptionReporter: SQL Error: 335544569, SQLState: HY000
17:44:04,191 ERROR JDBCExceptionReporter: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -204
Table unknown
CATEGORY
At line 1, column 13.
17:44:04,194 ERROR JDBCExceptionReporter: could not insert: [org.hibernate.auction.model.Category#1]
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -204
Table unknown
CATEGORY
At line 1, column 13.
at org.firebirdsql.jdbc.AbstractPreparedStatement.<init>(AbstractPreparedStatement.java:91)
at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:34)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:682)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:232)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:257)
at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:61)
at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:56)
at net.sf.hibernate.impl.BatcherImpl.prepareBatchStatement(BatcherImpl.java:109)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:460)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2418)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2371)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2240)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at org.hibernate.auction.persistence.HibernateUtil.commitTransaction(Unknown Source)
at org.hibernate.auction.test.TestCaseWithData.initData(Unknown Source)
at org.hibernate.auction.test.ItemTest.testItemData(Unknown Source)
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 junit.framework.TestCase.runTest(TestCase.java:154)
at org.hibernate.auction.test.TestCase.runTest(Unknown Source)
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 junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:289)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:523)
at
org.firebirdsql.gds.GDSException: Dynamic SQL Error
SQL error code = -204
Table unknown
CATEGORY
At line 1, column 13.
at org.firebirdsql.jgds.GDS_Impl.readStatusVector(GDS_Impl.java:1758)
at org.firebirdsql.jgds.GDS_Impl.receiveResponse(GDS_Impl.java:1711)
at org.firebirdsql.jgds.GDS_Impl.isc_dsql_prepare(GDS_Impl.java:1223)
at org.firebirdsql.jca.FBManagedConnection.prepareSQL(FBManagedConnection.java:746)
at org.firebirdsql.jdbc.AbstractConnection.prepareSQL(AbstractConnection.java:934)
at org.firebirdsql.jdbc.AbstractStatement.prepareFixedStatement(AbstractStatement.java:1027)
at org.firebirdsql.jdbc.AbstractPreparedStatement.prepareFixedStatement(AbstractPreparedStatement.java:843)
at org.firebirdsql.jdbc.AbstractPreparedStatement.<init>(AbstractPreparedStatement.java:86)
at org.firebirdsql.jdbc.FBPreparedStatement.<init>(FBPreparedStatement.java:34)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:682)
at org.firebirdsql.jdbc.AbstractConnection.prepareStatement(AbstractConnection.java:232)
at net.sf.hibernate.impl.BatcherImpl.getPreparedStatement(BatcherImpl.java:257)
at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:61)
at net.sf.hibernate.impl.BatcherImpl.prepareStatement(BatcherImpl.java:56)
at net.sf.hibernate.impl.BatcherImpl.prepareBatchStatement(BatcherImpl.java:109)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:460)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2418)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2371)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2240)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at org.hibernate.auction.persistence.HibernateUtil.commitTransaction(Unknown Source)
at org.hibernate.auction.test.TestCaseWithData.initData(Unknown Source)
at org.hibernate.auction.test.ItemTest.testItemData(Unknown Source)
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 junit.framework.TestCase.runTest(TestCase.java:154)
at org.hibernate.auction.test.TestCase.runTest(Unknown Source)
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 junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:289)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:523)
17:44:04,199 ERROR SessionImpl: Could not synchronize database state with session
net.sf.hibernate.JDBCException: could not insert: [org.hibernate.auction.model.Category#1]
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:478)
at net.sf.hibernate.persister.EntityPersister.insert(EntityPersister.java:442)
at net.sf.hibernate.impl.ScheduledInsertion.execute(ScheduledInsertion.java:29)
at net.sf.hibernate.impl.SessionImpl.executeAll(SessionImpl.java:2418)
at net.sf.hibernate.impl.SessionImpl.execute(SessionImpl.java:2371)
at net.sf.hibernate.impl.SessionImpl.flush(SessionImpl.java:2240)
at net.sf.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:61)
at org.hibernate.auction.persistence.HibernateUtil.commitTransaction(Unknown Source)
at org.hibernate.auction.test.TestCaseWithData.initData(Unknown Source)
at org.hibernate.auction.test.ItemTest.testItemData(Unknown Source)
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 junit.framework.TestCase.runTest(TestCase.java:154)
at org.hibernate.auction.test.TestCase.runTest(Unknown Source)
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 junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:289)
at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:523)
Caused by: org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544569. Dynamic SQL Error
SQL error code = -204
Table unknown
CATEGORY
At line 1, column 13.
at ...... .and so on!! :S


Top
 Profile  
 
 Post subject:
PostPosted: Tue Nov 09, 2004 6:35 pm 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
I didn't test this on every database supported by Hibernate. Please read the error messages and change the appropriate setting. In this case, not all tables could be created, as some length limitation for field size declaration was hit. Decrease the field size in the mapping files.

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Nov 11, 2004 11:48 am 
Newbie

Joined: Mon Nov 08, 2004 6:41 pm
Posts: 5
Location: Asuncion, Paraguay
There was some issues between firebird and two mapping xmls.
1) There is a property named message in the
Caveatemptor/src/java/org/hibernate/auction/persistence
AuditLogRecord.hbm.xml mapping file, and schemaexport created this sql for firebird
create table AUDIT_LOG (
AUDIT_LOG_ID numeric(18,0) not null,
MESSAGE varchar(255) not null,
ENTITY_ID numeric(18,0) not null,
ENTITY_CLASS varchar(255) not null,
USER_ID numeric(18,0) not null,
CREATED timestamp not null,
primary key (AUDIT_LOG_ID)
);
The thing is that firebird has some kind of reserved word named message, so this sql returns an error.
So i changed message to message_text in the mapping xml and the property name from message to messageText:
create table AUDIT_LOG (
....
MESSAGE_TEXT varchar(255) not null,
....
);
and
<hibernate-mapping>



<class name="org.hibernate.auction.persistence.audit.AuditLogRecord"

table="AUDIT_LOG">
......
<property name="messageText"

type="string"

column="MESSAGE_TEXT"

length="255"

not-null="true"

access="field"/>
......
</hibernate-mapping>
Problem solved.

2) Other problem was the unique constraint in the sql. The Firebird error was: key size too big or something for unique (NAME, PARENT_CATEGORY_ID).
this is the sql to create table:
create table CATEGORY (
CATEGORY_ID numeric(18,0) not null,
VERSION integer not null,
NAME varchar(255) not null,
CREATED timestamp not null,
PARENT_CATEGORY_ID numeric(18,0),
primary key (CATEGORY_ID),
unique (NAME, PARENT_CATEGORY_ID)
);
I removed the unique (NAME, PARENT_CATEGORY_ID) constraint and no error where reported.
In the Category.cfg.xml i also remove unique-key="UNIQUE_NAME_AT_LEVEL" atribute of the property element named "name" and property element "parentCategory"

Problem solved but there are some issues.
The unique restriction is not longer suported because of this change.
I'll try to solve this but for the moment this will work.

Thanks Chistian,,!
P.D. HIA is awesome!!

Sorry for my english.. :>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.