Oh, mein Fehler. Habe vergessen die Datenbank zu starten. Hier nun mal das Stacktrace, welches ich eigentlich meinte:
Code:
init:
deps-jar:
compile:
run:
12:55:07,172 INFO Environment:514 - Hibernate 3.2.5
12:55:07,182 INFO Environment:532 - loaded properties from resource hibernate.properties: {<hibernate-configuration>=, <session-factory>=, <mapping=resource="de/flabben/table/definition/tag.hbm.xml" />, "-//Hibernate/Hibernate=Configuration DTD 3.0//EN", </session-factory>=, <?xml=version="1.0" encoding="utf-8"?>, hibernate.bytecode.use_reflection_optimizer=false, </hibernate-configuration>=, <!--=mapping files -->, "http=//hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">, <!DOCTYPE=hibernate-configuration PUBLIC, <property=name="hibernate.show_sql">true</property>}
12:55:07,187 INFO Environment:681 - Bytecode provider name : cglib
12:55:07,191 INFO Environment:598 - using JDK 1.4 java.sql.Timestamp handling
12:55:07,244 INFO Configuration:1426 - configuring from resource: /hibernate.cfg.xml
12:55:07,245 INFO Configuration:1403 - Configuration resource: /hibernate.cfg.xml
12:55:07,487 INFO Configuration:553 - Reading mappings from resource : de/flabben/table/definition/article.hbm.xml
12:55:07,592 INFO HbmBinder:300 - Mapping class: de.flabben.table.Article -> article
12:55:07,622 INFO Configuration:553 - Reading mappings from resource : de/flabben/table/definition/author.hbm.xml
12:55:07,660 INFO HbmBinder:300 - Mapping class: de.flabben.table.Author -> author
12:55:07,662 INFO Configuration:553 - Reading mappings from resource : de/flabben/table/definition/category.hbm.xml
12:55:07,696 INFO HbmBinder:300 - Mapping class: de.flabben.table.Category -> category
12:55:07,698 INFO Configuration:553 - Reading mappings from resource : de/flabben/table/definition/comment.hbm.xml
12:55:07,715 INFO HbmBinder:300 - Mapping class: de.flabben.table.Comment -> comment
12:55:07,716 INFO Configuration:553 - Reading mappings from resource : de/flabben/table/definition/tag.hbm.xml
12:55:07,730 INFO HbmBinder:300 - Mapping class: de.flabben.table.Tag -> tag
12:55:07,750 INFO Configuration:1541 - Configured SessionFactory: null
12:55:07,751 DEBUG InitSessionFactory:118 - classic factory
12:55:07,823 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in connection pool (not for production use!)
12:55:07,824 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 20
12:55:07,824 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
12:55:07,842 INFO DriverManagerConnectionProvider:80 - using driver: org.postgresql.Driver at URL: jdbc:postgresql://localhost/flabben
12:55:07,843 INFO DriverManagerConnectionProvider:86 - connection properties: {user=jpieper, password=****}
12:55:07,910 INFO SettingsFactory:89 - RDBMS: PostgreSQL, version: 8.2.6
12:55:07,912 INFO SettingsFactory:90 - JDBC driver: PostgreSQL Native Driver, version: PostgreSQL 8.2 JDBC3 with SSL (build 506)
12:55:07,930 INFO Dialect:152 - Using dialect: org.hibernate.dialect.PostgreSQLDialect
12:55:07,938 INFO TransactionFactoryFactory:34 - Transaction strategy: org.hibernate.transaction.JDBCTransactionFactory
12:55:07,943 INFO TransactionManagerLookupFactory:33 - No TransactionManagerLookup configured (in JTA environment, use of read-write or transactional second-level cache is not recommended)
12:55:07,944 INFO SettingsFactory:143 - Automatic flush during beforeCompletion(): disabled
12:55:07,944 INFO SettingsFactory:147 - Automatic session close at end of transaction: disabled
12:55:07,945 INFO SettingsFactory:154 - JDBC batch size: 15
12:55:07,946 INFO SettingsFactory:157 - JDBC batch updates for versioned data: disabled
12:55:07,947 INFO SettingsFactory:162 - Scrollable result sets: enabled
12:55:07,947 INFO SettingsFactory:170 - JDBC3 getGeneratedKeys(): disabled
12:55:07,948 INFO SettingsFactory:178 - Connection release mode: auto
12:55:07,949 INFO SettingsFactory:205 - Default batch fetch size: 1
12:55:07,950 INFO SettingsFactory:209 - Generate SQL with comments: disabled
12:55:07,951 INFO SettingsFactory:213 - Order SQL updates by primary key: disabled
12:55:07,952 INFO SettingsFactory:217 - Order SQL inserts for batching: disabled
12:55:07,952 INFO SettingsFactory:386 - Query translator: org.hibernate.hql.ast.ASTQueryTranslatorFactory
12:55:07,955 INFO ASTQueryTranslatorFactory:24 - Using ASTQueryTranslatorFactory
12:55:07,955 INFO SettingsFactory:225 - Query language substitutions: {}
12:55:07,956 INFO SettingsFactory:230 - JPA-QL strict compliance: disabled
12:55:07,957 INFO SettingsFactory:235 - Second-level cache: enabled
12:55:07,957 INFO SettingsFactory:239 - Query cache: disabled
12:55:07,958 INFO SettingsFactory:373 - Cache provider: org.hibernate.cache.NoCacheProvider
12:55:07,959 INFO SettingsFactory:254 - Optimize cache for minimal puts: disabled
12:55:07,959 INFO SettingsFactory:263 - Structured second-level cache entries: disabled
12:55:07,963 INFO SettingsFactory:283 - Echoing all SQL to stdout
12:55:07,964 INFO SettingsFactory:290 - Statistics: disabled
12:55:07,965 INFO SettingsFactory:294 - Deleted entity synthetic identifier rollback: disabled
12:55:07,966 INFO SettingsFactory:309 - Default entity-mode: pojo
12:55:07,969 INFO SettingsFactory:313 - Named query checking : enabled
12:55:08,006 INFO SessionFactoryImpl:161 - building session factory
12:55:08,313 INFO SessionFactoryObjectFactory:82 - Not binding factory to JNDI, no JNDI name configured
12:55:08,410 DEBUG SQL:401 - select nextval ('flabben.author_author_id_seq')
Hibernate: select nextval ('flabben.author_author_id_seq')
12:55:08,452 DEBUG SQL:401 - select nextval ('flabben.category_category_id_seq')
Hibernate: select nextval ('flabben.category_category_id_seq')
12:55:08,454 DEBUG SQL:401 - select nextval ('flabben.tag_tag_id_seq')
Hibernate: select nextval ('flabben.tag_tag_id_seq')
12:55:08,456 DEBUG SQL:401 - select nextval ('flabben.article_article_id_seq')
Hibernate: select nextval ('flabben.article_article_id_seq')
12:55:08,458 DEBUG SQL:401 - select nextval ('flabben.comment_comment_id_seq')
Hibernate: select nextval ('flabben.comment_comment_id_seq')
12:55:08,468 DEBUG SQL:401 - insert into flabben.author (author_name, author_login, author_password, author_email, author_id) values (?, ?, ?, ?, ?)
Hibernate: insert into flabben.author (author_name, author_login, author_password, author_email, author_id) values (?, ?, ?, ?, ?)
12:55:08,473 DEBUG SQL:401 - insert into flabben.category (category_name, category_id) values (?, ?)
Hibernate: insert into flabben.category (category_name, category_id) values (?, ?)
12:55:08,476 DEBUG SQL:401 - insert into flabben.tag (tag_name, tag_id) values (?, ?)
Hibernate: insert into flabben.tag (tag_name, tag_id) values (?, ?)
12:55:08,482 DEBUG SQL:401 - insert into flabben.article (article_title, article_content, article_date, category_id, author_id, article_id) values (?, ?, ?, ?, ?, ?)
Hibernate: insert into flabben.article (article_title, article_content, article_date, category_id, author_id, article_id) values (?, ?, ?, ?, ?, ?)
12:55:08,613 WARN JDBCExceptionReporter:77 - SQL Error: 0, SQLState: null
12:55:08,614 ERROR JDBCExceptionReporter:78 - Batch-Eintrag 0 insert into flabben.article (article_title, article_content, article_date, category_id, author_id, article_id) values (Testartikel, Dies ist ein kleiner, aber feiner Testartikel, 2008-01-26 12:55:08.455000 +01:00:00, 1, 1, 5) wurde abgebrochen. Rufen Sie 'getNextException' auf, um die Ursache zu erfahren.
12:55:08,616 WARN JDBCExceptionReporter:77 - SQL Error: 0, SQLState: 23503
12:55:08,619 ERROR JDBCExceptionReporter:78 - FEHLER: Einfügen oder Aktualisieren in Tabelle »article« verletzt Fremdschlüssel-Constraint »article_author_id_fkey«
Detail: Schlüssel (author_id)=(1) ist nicht in Tabelle »author« vorhanden.
12:55:08,625 ERROR AbstractFlushingEventListener:301 - Could not synchronize database state with session
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:71)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:92)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87)
at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:222)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2224)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at de.flabben.application.Main.main(Main.java:69)
Caused by: java.sql.BatchUpdateException: Batch-Eintrag 0 insert into flabben.article (article_title, article_content, article_date, category_id, author_id, article_id) values (Testartikel, Dies ist ein kleiner, aber feiner Testartikel, 2008-01-26 12:55:08.455000 +01:00:00, 1, 1, 5) wurde abgebrochen. Rufen Sie 'getNextException' auf, um die Ursache zu erfahren.
at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2534)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1317)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:350)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2596)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
... 15 more
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:253)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:92)
at org.hibernate.jdbc.AbstractBatcher.prepareStatement(AbstractBatcher.java:87)
at org.hibernate.jdbc.AbstractBatcher.prepareBatchStatement(AbstractBatcher.java:222)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2224)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:338)
at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:106)
at de.flabben.application.Main.main(Main.java:69)
Caused by: java.sql.BatchUpdateException: Batch-Eintrag 0 insert into flabben.article (article_title, article_content, article_date, category_id, author_id, article_id) values (Testartikel, Dies ist ein kleiner, aber feiner Testartikel, 2008-01-26 12:55:08.455000 +01:00:00, 1, 1, 5) wurde abgebrochen. Rufen Sie 'getNextException' auf, um die Ursache zu erfahren.
at org.postgresql.jdbc2.AbstractJdbc2Statement$BatchResultHandler.handleError(AbstractJdbc2Statement.java:2534)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1317)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:350)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeBatch(AbstractJdbc2Statement.java:2596)
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48)
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:246)
... 15 more
BUILD SUCCESSFUL (total time: 2 seconds)