-->
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.  [ 3 posts ] 
Author Message
 Post subject: is this a SQL or Hibernate error?java.lang.ExceptionInInit
PostPosted: Wed Oct 01, 2003 11:00 am 
Newbie

Joined: Wed Oct 01, 2003 10:51 am
Posts: 5
[INFO] Environment - -Hibernate 2.0.2
[INFO] Environment - -loaded properties from resource hibernate.properties: {hibernate.connection.driver_class=COM.ibm.db2.jdbc.app.DB2Driver, hibernate.cglib.use_reflection_optimizer=true, hibernate.dialect=net.sf.hibernate.dialect.DB2Dialect, hibernate.connection.username=db2admin, hibernate.connection.url=jdbc:db2:strutsdb, hibernate.show_sql=true, hibernate.connection.password=db2admin, hibernate.connection.pool_size=20, hibernate.statement_cache.size=6}
[INFO] Environment - -using CGLIB reflection optimizer
[INFO] Environment - -JVM proxy support: true
[INFO] Configuration - -Mapping resource: com/ibm/hibernate_article/Job.hbm.xml
[INFO] Binder - -Mapping class: com.ibm.hibernate_article.Job -> JOB
[INFO] Configuration - -Mapping resource: com/ibm/hibernate_article/Product.hbm.xml
[INFO] Binder - -Mapping class: com.ibm.hibernate_article.Product -> PRODUCT
[INFO] Configuration - -Mapping resource: com/ibm/hibernate_article/Person.hbm.xml
[INFO] Binder - -Mapping class: com.ibm.hibernate_article.Person -> PERSON
[INFO] Configuration - -Mapping resource: com/ibm/hibernate_article/Timesheet.hbm.xml
[INFO] Binder - -Mapping class: com.ibm.hibernate_article.Timesheet -> TIMESHEET
[INFO] Configuration - -Mapping resource: com/ibm/hibernate_article/Lineitem.hbm.xml
[INFO] Binder - -Mapping class: com.ibm.hibernate_article.Lineitem -> LINEITEM
[INFO] Configuration - -Mapping resource: com/ibm/hibernate_article/Client.hbm.xml
[INFO] Binder - -Mapping class: com.ibm.hibernate_article.Client -> CLIENT
[INFO] Configuration - -processing one-to-many association mappings
[INFO] Binder - -Mapping collection: com.ibm.hibernate_article.Job.lineitems -> LINEITEM
[INFO] Binder - -Mapping collection: com.ibm.hibernate_article.Product.jobs -> JOB
[INFO] Binder - -Mapping collection: com.ibm.hibernate_article.Person.timesheets -> TIMESHEET
[INFO] Binder - -Mapping collection: com.ibm.hibernate_article.Timesheet.lineitems -> LINEITEM
[INFO] Binder - -Mapping collection: com.ibm.hibernate_article.Client.products -> PRODUCT
[INFO] Configuration - -processing foreign key constraints
[INFO] SessionFactoryImpl - -building session factory
[INFO] Dialect - -Using dialect: net.sf.hibernate.dialect.DB2Dialect
[INFO] DriverManagerConnectionProvider - -Hibernate connection pool size: 20
[INFO] DriverManagerConnectionProvider - -using driver: COM.ibm.db2.jdbc.app.DB2Driver at URL: jdbc:db2:strutsdb
[INFO] DriverManagerConnectionProvider - -connection properties: {user=db2admin, password=db2admin}
[INFO] PreparedStatementCache - -prepared statement cache size: 6
[INFO] SessionFactoryImpl - -Use outer join fetching: true
[INFO] SessionFactoryImpl - -Use scrollable result sets: true
[INFO] SessionFactoryImpl - -echoing all SQL to stdout
java.lang.ExceptionInInitializerError: java.lang.RuntimeException: couldn't get connection
at com.ibm.hibernate_article.HibernateTest.<clinit>(HibernateTest.java:54)
at java.lang.reflect.Constructor.newInstance(Native Method)
at junit.framework.TestSuite.addTestMethod(TestSuite.java:102)
at junit.framework.TestSuite.<init>(TestSuite.java:66)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.getTest(RemoteTestRunner.java:270)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:307)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:218)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:151)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 01, 2003 3:29 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
The ibm sample you looked, used Hibernate 1.2.4. You are using Hibernate 2.0.2. Please look at a more up to date tutorial.
http://www.hibernate.org/78.html is a good start


Top
 Profile  
 
 Post subject: Thanks, but ...
PostPosted: Wed Oct 01, 2003 3:36 pm 
Newbie

Joined: Wed Oct 01, 2003 10:51 am
Posts: 5
I am using the article as a shell, I got the original sample to work.

Here is what I see happening:
Middlegen generate something like this:
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<hibernate-mapping>

<!--
Created by Middlegen Hibernate plugin

http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/
-->

<class
name="com.ibm.hibernate_article.Product"
table="PRODUCT"
>

by taking out the part:
<!--
Created by Middlegen Hibernate plugin

http://boss.bekk.no/boss/middlegen/
http://hibernate.sourceforge.net/
-->
it now works.
Thanks again.


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