-->
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.  [ 2 posts ] 
Author Message
 Post subject: hibernate w/derby on windows, build eg fails?
PostPosted: Mon Mar 14, 2005 12:24 pm 
Newbie

Joined: Mon Mar 14, 2005 12:06 pm
Posts: 6
I'm a newbie to Derby and Hibernate. I see exceptions when I run build eg. Is this OK?

Thanks.

Lou.

Hibernate version: version 3.0 beta 4, 11 February 2005

Mapping documents: \hibernate-3.0\etc\hibernate.properties

## Derby (Not supported!)

hibernate.dialect org.hibernate.dialect.DerbyDialect
hibernate.connection.driver_class org.apache.derby.jdbc.EmbeddedDriver
hibernate.connection.username
hibernate.connection.password
hibernate.connection.url jdbc:derby:/test;create=true

Full stack trace of any exception that occurs:

C:\Program Files\www.hibernate.org\hibernate-3.0\lib>ls d*
derby.jar dom4j-1.5.2.jar

C:\Program Files\www.hibernate.org\hibernate-3.0>build eg

C:\Program Files\www.hibernate.org\hibernate-3.0>set JDBC_DRIVER=jdbc/hsqldb.jar

C:\Program Files\www.hibernate.org\hibernate-3.0>java -cp "lib/ant-launcher-1.6.2.jar" org.apache.tools.ant.launch.Launcher -lib lib -Ddriver.jar=jdbc/hsqldb.jar eg
Buildfile: build.xml
[taskdef] Could not load definitions from resource checkstyletask.properties. It could not be found.
[taskdef] Could not load definitions from resource clovertasks. It could not be found.

eg:
[echo] remember to place your JDBC driver in the lib directory
[java] 07:22:49,877 INFO Environment:451 - Hibernate 3.0 beta 4
[java] 07:22:49,957 INFO Environment:469 - loaded properties from resource hibernate.properties: {hibernate.order_updates=true, hibernate.default_batch_fetch_size=8, hibernate.connection.driver_class=org.apache.derby.jdbc.EmbeddedDriver, hibernate.cglib.use_reflection_optimizer=true, hibernate.cache.provider_class=org.hibernate.cache.HashtableCacheProvider, hibernate.max_fetch_depth=1, hibernate.dialect=org.hibernate.dialect.DerbyDialect, hibernate.jdbc.use_streams_for_binary=true, hibernate.query.substitutions=true 1, false 0, yes 'Y', no 'N', hibernate.proxool.pool_alias=pool1, hibernate.connection.username=, hibernate.cache.region_prefix=hibernate.test, hibernate.connection.url=jdbc:derby:/test;create=true, hibernate.connection.password=, hibernate.jdbc.batch_versioned_data=true, hibernate.connection.pool_size=1}
[java] 07:22:49,997 INFO Environment:496 - using java.io streams to persist binary types
[java] 07:22:49,997 INFO Environment:497 - using CGLIB reflection optimizer
[java] 07:22:50,478 INFO Environment:527 - using JDK 1.4 java.sql.Timestamp handling
[java] 07:22:50,488 INFO Configuration:456 - Mapping resource: org/hibernate/auction/AuctionItem.hbm.xml
[java] 07:22:51,239 INFO HbmBinder:439 - Mapping class: org.hibernate.auction.AuctionItem -> AuctionItem
[java] 07:22:51,369 INFO Configuration:456 - Mapping resource: org/hibernate/auction/Bid.hbm.xml
[java] 07:22:51,609 INFO HbmBinder:439 - Mapping class: org.hibernate.auction.Bid -> Bid
[java] 07:22:51,659 INFO HbmBinder:350 - Mapping subclass: org.hibernate.auction.BuyNow -> Bid
[java] 07:22:51,659 INFO Configuration:456 - Mapping resource: org/hibernate/auction/User.hbm.xml
[java] 07:22:52,010 INFO HbmBinder:439 - Mapping class: org.hibernate.auction.User -> AuctionUser
[java] 07:22:52,020 INFO Configuration:832 - processing extends queue
[java] 07:22:52,020 INFO Configuration:836 - processing collection mappings
[java] 07:22:52,020 INFO HbmBinder:1731 - Mapping collection: org.hibernate.auction.AuctionItem.bids -> Bid
[java] 07:22:52,090 INFO HbmBinder:1731 - Mapping collection: org.hibernate.auction.User.bids -> Bid
[java] 07:22:52,090 INFO HbmBinder:1731 - Mapping collection: org.hibernate.auction.User.auctions -> AuctionItem
[java] 07:22:52,100 INFO Configuration:845 - processing association property references
[java] 07:22:52,100 INFO Configuration:872 - processing foreign key constraints
[java] 07:22:52,330 INFO Dialect:86 - Using dialect: org.hibernate.dialect.DerbyDialect
[java] 07:22:52,350 INFO SettingsFactory:86 - Maximum outer join fetch depth: 1
[java] 07:22:52,350 INFO SettingsFactory:89 - Default batch fetch size: 8
[java] 07:22:52,350 INFO SettingsFactory:93 - Generate SQL with comments: disabled
[java] 07:22:52,350 INFO SettingsFactory:97 - Order SQL updates by primary key: enabled
[java] 07:22:52,350 INFO SettingsFactory:267 - Query translator: org.hibernate.hql.classic.ClassicQueryTranslatorFactory
[java] 07:22:52,360 INFO SettingsFactory:105 - Query language substitutions: {no='N', true=1, yes='Y', false=0}
[java] 07:22:52,360 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
[java] 07:22:52,370 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 1
[java] 07:22:52,370 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
[java] 07:22:52,841 INFO DriverManagerConnectionProvider:80 - using driver: org.apache.derby.jdbc.EmbeddedDriver at URL: jdbc:derby:/test;create=true
[java] 07:22:52,841 INFO DriverManagerConnectionProvider:86 - connection properties: {user=, password=****}
[java] 07:23:09,976 INFO SettingsFactory:154 - Scrollable result sets: enabled
[java] 07:23:09,976 INFO SettingsFactory:162 - JDBC3 getGeneratedKeys(): enabled
[java] 07:23:09,976 INFO TransactionFactoryFactory:31 - Using default transaction strategy (direct JDBC transactions)
[java] 07:23:09,986 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
[java] 07:23:09,986 INFO SettingsFactory:174 - Automatic flush during beforeCompletion(): disabled
[java] 07:23:09,986 INFO SettingsFactory:177 - Automatic session close at end of transaction: disabled
[java] 07:23:09,986 INFO SettingsFactory:254 - Cache provider: org.hibernate.cache.HashtableCacheProvider
[java] 07:23:09,986 INFO SettingsFactory:185 - Second-level cache: enabled
[java] 07:23:09,986 INFO SettingsFactory:190 - Optimize cache for minimal puts: disabled
[java] 07:23:09,986 INFO SettingsFactory:194 - Cache region prefix: hibernate.test
[java] 07:23:09,986 INFO SettingsFactory:197 - Structured second-level cache entries: enabled
[java] 07:23:09,986 INFO SettingsFactory:201 - Query cache: disabled
[java] 07:23:09,986 INFO SettingsFactory:212 - Statistics: disabled
[java] 07:23:09,986 INFO SettingsFactory:216 - Deleted entity synthetic identifier rollback: disabled
[java] 07:23:10,166 INFO SessionFactoryImpl:142 - building session factory
[java] 07:23:10,917 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
[java] 07:23:10,927 INFO Dialect:86 - Using dialect: org.hibernate.dialect.DerbyDialect
[java] 07:23:10,927 INFO Configuration:832 - processing extends queue
[java] 07:23:10,927 INFO Configuration:836 - processing collection mappings
[java] 07:23:10,927 INFO Configuration:845 - processing association property references
[java] 07:23:10,937 INFO Configuration:872 - processing foreign key constraints
[java] 07:23:10,937 INFO Configuration:832 - processing extends queue
[java] 07:23:10,937 INFO Configuration:836 - processing collection mappings
[java] 07:23:10,947 INFO Configuration:845 - processing association property references
[java] 07:23:10,947 INFO Configuration:872 - processing foreign key constraints
[java] 07:23:10,967 INFO SchemaExport:100 - Running hbm2ddl schema export
[java] 07:23:10,967 INFO SchemaExport:121 - exporting generated schema to database
[java] 07:23:10,967 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
[java] 07:23:10,967 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 1
[java] 07:23:10,967 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
[java] 07:23:10,967 INFO DriverManagerConnectionProvider:80 - using driver: org.apache.derby.jdbc.EmbeddedDriver at URL: jdbc:derby:/test;create=true
[java] 07:23:10,967 INFO DriverManagerConnectionProvider:86 - connection properties: {user=, password=****}
[java] 07:23:10,987 DEBUG SchemaExport:136 - alter table AuctionItem drop constraint FK522A9BD61107FE9B
[java] 07:23:11,238 DEBUG SchemaExport:142 - Unsuccessful: alter table AuctionItem drop constraint FK522A9BD61107FE9B
[java] 07:23:11,238 DEBUG SchemaExport:143 - 'ALTER TABLE' cannot be performed on 'AUCTIONITEM' because it does not exist.
[java] 07:23:11,238 DEBUG SchemaExport:136 - alter table AuctionItem drop constraint FK522A9BD6F65B1FAF
[java] 07:23:11,248 DEBUG SchemaExport:142 - Unsuccessful: alter table AuctionItem drop constraint FK522A9BD6F65B1FAF
[java] 07:23:11,248 DEBUG SchemaExport:143 - 'ALTER TABLE' cannot be performed on 'AUCTIONITEM' because it does not exist.
[java] 07:23:11,248 DEBUG SchemaExport:136 - alter table Bid drop constraint FK104DDEE6E7E98
[java] 07:23:11,248 DEBUG SchemaExport:142 - Unsuccessful: alter table Bid drop constraint FK104DDEE6E7E98
[java] 07:23:11,248 DEBUG SchemaExport:143 - 'ALTER TABLE' cannot be performed on 'BID' because it does not exist.
[java] 07:23:11,248 DEBUG SchemaExport:136 - alter table Bid drop constraint FK104DDF43A3910
[java] 07:23:11,258 DEBUG SchemaExport:142 - Unsuccessful: alter table Bid drop constraint FK104DDF43A3910
[java] 07:23:11,258 DEBUG SchemaExport:143 - 'ALTER TABLE' cannot be performed on 'BID' because it does not exist.
[java] 07:23:11,258 DEBUG SchemaExport:136 - drop table AuctionItem
[java] 07:23:11,268 DEBUG SchemaExport:142 - Unsuccessful: drop table AuctionItem
[java] 07:23:11,268 DEBUG SchemaExport:143 - 'DROP TABLE' cannot be performed on 'AUCTIONITEM' because it does not exist.
[java] 07:23:11,268 DEBUG SchemaExport:136 - drop table AuctionUser
[java] 07:23:11,268 DEBUG SchemaExport:142 - Unsuccessful: drop table AuctionUser
[java] 07:23:11,268 DEBUG SchemaExport:143 - 'DROP TABLE' cannot be performed on 'AUCTIONUSER' because it does not exist.
[java] 07:23:11,268 DEBUG SchemaExport:136 - drop table Bid
[java] 07:23:11,268 DEBUG SchemaExport:142 - Unsuccessful: drop table Bid
[java] 07:23:11,278 DEBUG SchemaExport:143 - 'DROP TABLE' cannot be performed on 'BID' because it does not exist.
[java] 07:23:11,278 DEBUG SchemaExport:136 - drop table hibernate_unique_key
[java] 07:23:11,278 DEBUG SchemaExport:142 - Unsuccessful: drop table hibernate_unique_key
[java] 07:23:11,278 DEBUG SchemaExport:143 - 'DROP TABLE' cannot be performed on 'HIBERNATE_UNIQUE_KEY' because it does not exist.
[java] 07:23:11,278 DEBUG SchemaExport:154 - create table AuctionItem (
[java] id bigint not null,
[java] description varchar(255),
[java] ends timestamp,
[java] condition integer,
[java] seller bigint not null,
[java] successfulBid bigint,
[java] primary key (id)
[java] )
[java] 07:23:12,349 DEBUG SchemaExport:154 - create table AuctionUser (id bigint not null, userName varchar(255) not null, "password" varchar(255), email varchar(255), firstName varchar(255), "initial" char(1), lastName varchar(255), primary key (id))
[java] 07:23:13,361 DEBUG SchemaExport:154 - create table Bid (id bigint not null, isBuyNow char(1) not null, amount float not null, "datetime" timestamp not null, bidder bigint not null, item bigint not null, primary key (id))
[java] 07:23:14,993 DEBUG SchemaExport:154 - alter table AuctionItem add constraint FK522A9BD61107FE9B foreign key (seller) references AuctionUser
[java] 07:23:15,584 DEBUG SchemaExport:154 - alter table AuctionItem add constraint FK522A9BD6F65B1FAF foreign key (successfulBid) references Bid
[java] 07:23:16,155 DEBUG SchemaExport:154 - alter table Bid add constraint FK104DDEE6E7E98 foreign key (item) references AuctionItem
[java] 07:23:16,725 DEBUG SchemaExport:154 - alter table Bid add constraint FK104DDF43A3910 foreign key (bidder) references AuctionUser
[java] 07:23:17,246 DEBUG SchemaExport:154 - create table hibernate_unique_key (
[java] next_hi integer
[java] )
[java] 07:23:18,198 DEBUG SchemaExport:154 - insert into hibernate_unique_key values ( 0 )
[java] 07:23:18,368 INFO SchemaExport:166 - schema export complete
[java] 07:23:18,368 WARN JDBCExceptionReporter:34 - SQL Warning: 10000, SQLState: 01J01
[java] 07:23:18,368 WARN JDBCExceptionReporter:35 - Database '/test' not created, connection made to existing database instead.
[java] 07:23:18,368 INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc:derby:/test;create=true
[java] 07:23:18,368 INFO SessionFactoryImpl:368 - Checking 0 named queries
[java] Setting up some test data
[java] 07:23:18,398 INFO DriverManagerConnectionProvider:147 - cleaning up connection pool: jdbc:derby:/test;create=true
[java] 07:23:18,608 WARN JDBCExceptionReporter:34 - SQL Warning: 10000, SQLState: 01J01
[java] 07:23:18,608 WARN JDBCExceptionReporter:35 - Database '/test' not created, connection made to existing database instead.
[java] Viewing all auction item objects
[java] Auction: 32770 - auction item 2, ends: 2005-03-12 07:23:18.638, bids: [izi $1.0 (buy now), izi $1.5, 1E1 $1.0, izi $0.5, 1E1 $0.0]
[java] Auction: 32768 - auction item 0, ends: 2005-03-12 07:23:18.638, bids: []
[java] Auction: 32769 - auction item 1, ends: 2005-03-12 07:23:18.638, bids: [izi $0.5, 1E1 $0.0]

[java] Viewing all auction item info
[java] 07:23:19,149 WARN JDBCExceptionReporter:57 - SQL Error: 20000, SQLState: 42X04
[java] 07:23:19,149 ERROR JDBCExceptionReporter:58 - Column 'AUCTIONITE0_.ENDS' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'AUCTIONITE0_.ENDS' is not a column in the target table.
[java] 07:23:19,159 WARN JDBCExceptionReporter:57 - SQL Error: 20000, SQLState: 42X04
[java] 07:23:19,179 ERROR JDBCExceptionReporter:58 - Column 'AUCTIONITE0_.ENDS' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'AUCTIONITE0_.ENDS' is not a column in the target table.
[java] Exception in thread "main" org.hibernate.exception.SQLGrammarException: could not execute query
[java] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:59)
[java] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
[java] at org.hibernate.loader.Loader.doList(Loader.java:1420)
[java] at org.hibernate.loader.Loader.list(Loader.java:1400)
[java] at org.hibernate.hql.classic.QueryTranslatorImpl.list(QueryTranslatorImpl.java:876)
[java] at org.hibernate.impl.SessionImpl.list(SessionImpl.java:831)
[java] at org.hibernate.impl.QueryImpl.list(QueryImpl.java:74)
[java] at org.hibernate.auction.Main.viewAllAuctionsFast(Main.java:43)
[java] at org.hibernate.auction.Main.main(Main.java:369)
[java] Caused by: SQL Exception: Column 'AUCTIONITE0_.ENDS' is not in any table in the FROM list or it appears within a join specification and is outside the scope of the join specification or it appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'AUCTIONITE0_.ENDS' is not a column in the target table.
[java] at org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java)
[java] at org.apache.derby.impl.jdbc.TransactionResourceImpl.wrapInSQLException(TransactionResourceImpl.java)
[java] at org.apache.derby.impl.jdbc.TransactionResourceImpl.handleException(TransactionResourceImpl.java)
[java] at org.apache.derby.impl.jdbc.EmbedConnection.handleException(EmbedConnection.java)
[java] at org.apache.derby.impl.jdbc.ConnectionChild.handleException(ConnectionChild.java)
[java] at org.apache.derby.impl.jdbc.EmbedPreparedStatement.<init>(EmbedPreparedStatement.java)
[java] at org.apache.derby.impl.jdbc.EmbedPreparedStatement20.<init>(EmbedPreparedStatement20.java)
[java] at org.apache.derby.impl.jdbc.EmbedPreparedStatement30.<init>(EmbedPreparedStatement30.java)
[java] at org.apache.derby.jdbc.Driver30.newEmbedPreparedStatement(Driver30.java)
[java] at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java)
[java] at org.apache.derby.impl.jdbc.EmbedConnection.prepareStatement(EmbedConnection.java)
[java] at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:356)
[java] at org.hibernate.jdbc.AbstractBatcher.getPreparedStatement(AbstractBatcher.java:307)
[java] at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:86)
[java] at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1065)
[java] at org.hibernate.loader.Loader.doQuery(Loader.java:356)
[java] at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:199)
[java] at org.hibernate.loader.Loader.doList(Loader.java:1417)
[java] ... 6 more


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 18, 2005 5:10 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Dery is quite buggy. There was a thread on that subject AFAIR

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.