Hi,
I have a code which connects to hsqldb for retrieving data , but Hibernate is not able to connect to Hsqldb , following is the detailed output from logs
The application stops at 'opening new JDBC connection'
This problem occurs only when i am running the applicaton from an executable jar file
The application runs fine if i run it through Eclipse.....
Can you please help me as to what could be the problem?
LOGS :
D:\SPOC_Projects\SPOC\target\dist>java -jar spoc.jar
16:15:02,306 INFO Environment:500 - Hibernate 3.2.0
16:15:02,322 INFO Environment:533 - hibernate.properties not found
16:15:02,322 INFO Environment:667 - Bytecode provider name : cglib
16:15:02,337 INFO Environment:584 - using JDK 1.4 java.sql.Timestamp handling
16:15:02,415 INFO Configuration:1350 - configuring from resource: /hibernate.cf
g.xml
16:15:02,415 INFO Configuration:1327 - Configuration resource: /hibernate.cfg.x
ml
16:15:02,759 DEBUG DTDEntityResolver:38 - trying to resolve system-id [http://hi
bernate.sourceforge.net/hibernate-configuration-3.0.dtd]
16:15:02,759 DEBUG DTDEntityResolver:40 - recognized hibernate namespace; attemp
ting to resolve on classpath under org/hibernate/
16:15:02,759 DEBUG DTDEntityResolver:50 - located [http://hibernate.sourceforge.
net/hibernate-configuration-3.0.dtd] in classpath
16:15:02,821 DEBUG Configuration:1311 - connection.driver_class=org.hsqldb.jdbcD
river
16:15:02,821 DEBUG Configuration:1311 - connection.url=jdbc:hsqldb:hsql://localh
ost
16:15:02,821 DEBUG Configuration:1311 - connection.username=sa
16:15:02,821 DEBUG Configuration:1311 - connection.password=
16:15:02,821 DEBUG Configuration:1311 - connection.pool_size=1
16:15:02,821 DEBUG Configuration:1311 - dialect=org.hibernate.dialect.HSQLDialec
t
16:15:02,821 DEBUG Configuration:1311 - current_session_context_class=thread
16:15:02,837 DEBUG Configuration:1311 - show_sql=true
16:15:02,837 DEBUG Configuration:1311 - cache.provider_class=org.hibernate.cache
.NoCacheProvider
16:15:02,837 DEBUG Configuration:1311 - show_sql=true
16:15:02,837 DEBUG Configuration:1311 - hbm2ddl.auto=update
16:15:02,837 DEBUG Configuration:1510 - null<-org.dom4j.tree.DefaultAttribute@1e
859c0 [Attribute: name resource value "com/ullink/spoc/dao/PlugStat.hbm.xml"]
16:15:02,837 INFO Configuration:507 - Reading mappings from resource: com/ullin
k/spoc/dao/PlugStat.hbm.xml
16:15:02,852 DEBUG DTDEntityResolver:38 - trying to resolve system-id [http://hi
bernate.sourceforge.net/hibernate-mapping-3.0.dtd]
16:15:02,852 DEBUG DTDEntityResolver:40 - recognized hibernate namespace; attemp
ting to resolve on classpath under org/hibernate/
16:15:02,852 DEBUG DTDEntityResolver:50 - located [http://hibernate.sourceforge.
net/hibernate-mapping-3.0.dtd] in classpath
16:15:03,008 INFO HbmBinder:300 - Mapping class: com.ullink.spoc.dao.PlugStatus
-> PlugStatus
16:15:03,040 DEBUG HbmBinder:1270 - Mapped property: PlugStatus_id -> PlugStatus_id
16:15:03,055 DEBUG HbmBinder:1270 - Mapped property: Plugstatus_Date -> Plugstatus_Date
16:15:03,055 DEBUG HbmBinder:1270 - Mapped property: Plat_Type -> Plat_Type
16:15:03,055 DEBUG HbmBinder:1270 - Mapped property: Plat_Name -> Plat_Name
16:15:03,055 DEBUG HbmBinder:1270 - Mapped property: Plugin_Name -> Plugin_Name
16:15:03,055 DEBUG HbmBinder:1270 - Mapped property: Plugin_Status -> Plugin_Status
16:15:03,055 DEBUG Configuration:1510 - null<-org.dom4j.tree.DefaultAttribute@14
7c5fc [Attribute: name resource value "com/ullink/spoc/dao/ConnectionInfo.hbm.xml"]
16:15:03,055 INFO Configuration:507 - Reading mappings from resource: com/ullink/spoc/dao/ConnectionInfo.hbm.xml
16:15:03,055 DEBUG DTDEntityResolver:38 - trying to resolve system-id [http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd]
16:15:03,055 DEBUG DTDEntityResolver:40 - recognized hibernate namespace; attempting to resolve on classpath under org/hibernate/
16:15:03,071 DEBUG DTDEntityResolver:50 - located [http://hibernate.sourceforge.
net/hibernate-mapping-3.0.dtd] in classpath
16:15:03,133 INFO HbmBinder:300 - Mapping class: com.ullink.spoc.dao.Connection
Info -> ConnectionInfo
16:15:03,133 DEBUG HbmBinder:1270 - Mapped property: Conn_cd -> Conn_cd
16:15:03,133 DEBUG HbmBinder:1270 - Mapped property: PlatType -> PlatType
16:15:03,133 DEBUG HbmBinder:1270 - Mapped property: PlatName -> PlatName
16:15:03,133 DEBUG HbmBinder:1270 - Mapped property: Host -> Host
16:15:03,133 DEBUG HbmBinder:1270 - Mapped property: Port -> Port
16:15:03,133 DEBUG HbmBinder:1270 - Mapped property: UserName -> UserName
16:15:03,133 DEBUG HbmBinder:1270 - Mapped property: Password -> Password
16:15:03,133 INFO Configuration:1465 - Configured SessionFactory: null
16:15:03,149 DEBUG Configuration:1466 - properties: {java.vendor=Sun Microsystems Inc., show_sql=true, hibernate.connection.url=jdbc:hsqldb:hsql://localhost, sun.management.compiler=HotSpot Client Compiler, os.name=Windows XP, hbm2ddl.auto=
update, sun.boot.class.path=D:\jdk1.5.0_07\jre\lib\rt.jar;D:\jdk1.5.0_0\jre\lib\i18n.jar;D:\jdk1.5.0_07\jre\lib\sunrsasign.jar;D:\jdk1.5.0_07\jre\lib\jsse.jar;
D:\jdk1.5.0_07\jre\lib\jce.jar;D:\jdk1.5.0_07\jre\lib\charsets.jar;D:\jdk1.5.0_0
7\jre\classes, hibernate.current_session_context_class=thread, sun.desktop=windows, java.vm.specification.vendor=Sun Microsystems Inc., java.runtime.version=1.5.0_07-b03, hibernate.cache.provider_class=org.hibernate.cache.NoCacheProvider, u
ser.name=hlakhani, connection.driver_class=org.hsqldb.jdbcDriver, current_session_context_class=thread, user.language=en, sun.boot.library.path=D:\jdk1.5.0_07\j
re\bin, dialect=org.hibernate.dialect.HSQLDialect, java.version=1.5.0_07, user.timezone=GMT+05:30, sun.arch.data.model=32, java.endorsed.dirs=D:\jdk1.5.0_07\jre
\lib\endorsed, sun.cpu.isalist=, sun.jnu.encoding=Cp1252, file.encoding.pkg=sun.io, file.separator=\, java.specification.name=Java Platform API Specification, java.class.version=49.0, user.country=US, connection.url=jdbc:hsqldb:hsql://local
host, java.home=D:\jdk1.5.0_07\jre, java.vm.info=mixed mode, sharing, os.version=5.1, path.separator=;, connection.password=, java.vm.version=1.5.0_07-b03, hibe
rnate.connection.password=, user.variant=, java.awt.printerjob=sun.awt.windows.W
PrinterJob, sun.io.unicode.encoding=UnicodeLittle, awt.toolkit=sun.awt.windows.W
Toolkit, hibernate.connection.username=sa, user.home=C:\Documents and Settings\hlakhani, java.specification.vendor=Sun Microsystems Inc., hibernate.hbm2ddl.auto
=update, java.library.path=D:\jdk1.5.0_07\bin;.;C:\WINDOWS\system32;C:\WINDOWS;D
:\jdk1.5.0_07\bin;D:\oracle\ora92\bin;C:\Program Files\Oracle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\Syst
em32\Wbem;C:\WINDOWS\system32\gs\gs8.13\bin;D:\apache-ant-1.6.1\bin, java.vendor.url=http://java.sun.com/, hibernate.connection.driver_class=org.hsqldb.jdbcDriv
er, connection.username=sa, java.vm.vendor=Sun Microsystems Inc., hibernate.dialect=org.hibernate.dialect.HSQLDialect, java.runtime.name=Java(TM) 2 Runtime Envi
ronment, Standard Edition, java.class.path=spoc.jar, hibernate.bytecode.use_refl
ection_optimizer=false, java.vm.specification.name=Java Virtual Machine Specification, java.vm.specification.version=1.0, sun.cpu.endian=little, sun.os.patch.le
vel=Service Pack 2, connection.pool_size=1, java.io.tmpdir=C:\DOCUME~1\hlakhani\
LOCALS~1\Temp\, java.vendor.url.bug=http://java.sun.com/cgi-bin/bugreport.cgi, o
s.arch=x86, java.awt.graphicsenv=sun.awt.Win32GraphicsEnvironment, java.ext.dirs=D:\jdk1.5.0_07\jre\lib\ext, user.dir=D:\SPOC_Projects\SPOC\target\dist, line.se
parator=, java.vm.name=Java HotSpot(TM) Client VM, cache.provider_class=org.hibernate.ca
che.NoCacheProvider, file.encoding=Cp1252, java.specification.version=1.5, hiber
nate.show_sql=true, hibernate.connection.pool_size=1}
16:15:03,149 DEBUG Configuration:1209 - Preparing to build session factory with filters : {}
16:15:03,149 DEBUG Configuration:1044 - processing extends queue
16:15:03,149 DEBUG Configuration:1048 - processing collection mappings
16:15:03,149 DEBUG Configuration:1059 - processing native query and ResultSetMapping mappings
16:15:03,149 DEBUG Configuration:1067 - processing association property references
16:15:03,149 DEBUG Configuration:1089 - processing foreign key constraints
16:15:03,258 INFO DriverManagerConnectionProvider:41 - Using Hibernate built-in
connection pool (not for production use!)
16:15:03,258 INFO DriverManagerConnectionProvider:42 - Hibernate connection pool size: 1
16:15:03,258 INFO DriverManagerConnectionProvider:45 - autocommit mode: false
16:15:03,258 INFO DriverManagerConnectionProvider:80 - using driver: org.hsqldb.jdbcDriver at URL: jdbc:hsqldb:hsql://localhost
16:15:03,258 INFO DriverManagerConnectionProvider:83 - connection properties: {user=sa, password=}
16:15:03,258 DEBUG DriverManagerConnectionProvider:93 - total checked-out connections: 0
16:15:03,274 DEBUG DriverManagerConnectionProvider:109 - opening new JDBC connection
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:3.2
Mapping documents:
Code between sessionFactory.openSession() and session.close():
Full stack trace of any exception that occurs:
Name and version of the database you are using:
The generated SQL (show_sql=true):
Debug level Hibernate log excerpt:
Problems with Session and transaction handling?
Read this:
http://hibernate.org/42.html