Hi everyone,
I'm new to Hibernate and I suspect that I'm doing some very silly schoolboy error in trying to follow
this tutorial.
I'm upto section the titled
"1.2.6. Loading and storing objects", specifically the line that tells you to run this command:
Code:
C:\hibernateTutorial\>ant run -Daction=store
When I do this, I'm greeted with the following exception stack trace:
Code:
C:\java\HibernateProject>ant run -Daction=store
Buildfile: build.xml
clean:
[delete] Deleting directory C:\java\HibernateProject\bin
[mkdir] Created dir: C:\java\HibernateProject\bin
copy-resources:
[copy] Copying 2 files to C:\java\HibernateProject\bin
[copy] Copied 2 empty directories to 1 empty directory under C:\java\HibernateProject\bin
compile:
[javac] Compiling 3 source files to C:\java\HibernateProject\bin
run:
[java] log4j:WARN No appenders could be found for logger (org.hibernate.cfg.Environment).
[java] log4j:WARN Please initialize the log4j system properly.
[java] Exception in thread "main" org.hibernate.exception.JDBCConnectionException: Cannot open connection
[java] at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:74)
[java] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
[java] at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
[java] at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:426)
[java] at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:144)
[java] at org.hibernate.jdbc.JDBCContext.connection(JDBCContext.java:119)
[java] at org.hibernate.transaction.JDBCTransaction.begin(JDBCTransaction.java:57)
[java] at org.hibernate.impl.SessionImpl.beginTransaction(SessionImpl.java:1326)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[java] at java.lang.reflect.Method.invoke(Method.java:585)
[java] at org.hibernate.context.ThreadLocalSessionContext$TransactionProtectionWrapper.invoke(ThreadLocalSessionContext.java:301)
[java] at $Proxy0.beginTransaction(Unknown Source)
[java] at events.EventManager.createAndStoreEvent(Unknown Source)
[java] at events.EventManager.main(Unknown Source)
[java] Caused by: java.sql.SQLException: socket creation error
[java] at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
[java] at org.hsqldb.jdbc.jdbcConnection.<init>(Unknown Source)
[java] at org.hsqldb.jdbcDriver.getConnection(Unknown Source)
[java] at org.hsqldb.jdbcDriver.connect(Unknown Source)
[java] at java.sql.DriverManager.getConnection(DriverManager.java:525)
[java] at java.sql.DriverManager.getConnection(DriverManager.java:140)
[java] at org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:110)
[java] at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:423)
[java] ... 12 more
[java] Java Result: 1
BUILD SUCCESSFUL
Total time: 8 seconds
I believe up to this point I've been following the tutorial to the letter so I'm a bit stumped.
I scanned through the FAQs and did a search across the forums for this partricular issue, but could not seem to find it (most likely it's there somewhere but presented in different words).
Any help would be greatly appreciated. I use Hibernate at work and I'm just trying to do some self-study to learn how a simple project is set-up.
Thank you :-)