I switched from hibernate 2 to 3. With 2 I used Spring framework to sort out all sorts of stuff for me, but now i want to do it myself with hibernate 3 .
I generated hbm.xml with xDoclet.
Everytime I'm trying to get my SessionFactory:
INFO: processing foreign key constraints
Error: An unknown exception occurred while creating an instance of type com.thefactore.phq.service.ProjectService
It not much info. But I can't seem to get my debug mode on. I placed log4j.properties in classpatch nect to hibernate.cfg.xml.
So i anybody can help?
Hibernate version:
Hibernate 3
Mapping documents:
Code:
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD//EN"
"c://dtd/hibernate-configuration-2.0.dtd">
<hibernate-configuration>
<session-factory name="java:/hibernate/HibernateFactory">
<property name="hibernate.show_sql">true</property>
<property name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
<property name="hibernate.connection.url">jdbc:jtds:sqlserver://localhost/***</property>
<property name="hibernate.connection.username">**</property>
<property name="hibernate.connection.password">**</property>
<property name="dialect">net.sf.hibernate.dialect.SQLServerDialect</property>
<mapping resource="com/thefactore/phq/vo/Project.hbm.xml"/>
</session-factory>
</hibernate-configuration>
Code:
<hibernate-mapping
>
<class
name="com.thefactore.phq.vo.Project"
table="t_jlist_project "
lazy="true"
dynamic-update="false"
dynamic-insert="false"
select-before-update="false"
optimistic-lock="version"
>
<cache usage="read-write" />
<id
name="projectId"
column="prj_pk"
type="java.lang.Integer"
>
<generator class="identity">
<!--
To add non XDoclet generator parameters, create a file named
hibernate-generator-params-Project.xml
containing the additional parameters and place it in your merge dir.
-->
</generator>
</id>
<property
name="name"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="prj_name"
/>
<property
name="active"
type="boolean"
update="true"
insert="true"
access="property"
column="prj_active"
/>
<property
name="clt"
type="java.lang.Integer"
update="true"
insert="true"
access="property"
column="prj_clt"
/>
<property
name="datestart"
type="java.util.Date"
update="true"
insert="true"
access="property"
column="prj_datestart"
/>
<property
name="manager"
type="java.lang.Integer"
update="true"
insert="true"
access="property"
column="prj_manager"
/>
<property
name="website"
type="java.lang.String"
update="true"
insert="true"
access="property"
column="prj_website"
/>
<!--
To add non XDoclet property mappings, create a file named
hibernate-properties-Project.xml
containing the additional properties and place it in your merge dir.
-->
</class>
</hibernate-mapping>
Name and version of the database you are using:I'm using MSDE
The generated SQL (show_sql=true):Debug level Hibernate log excerpt:Code:
egin
09:34:32,390 INFO ProjectService:23 - ProjectService() - Getting objectDAO
19-mrt-2005 9:34:32 org.hibernate.cfg.Configuration configure
INFO: configuring from resource: /hibernate.cfg.xml
19-mrt-2005 9:34:32 org.hibernate.cfg.Configuration getConfigurationInputStream
INFO: Configuration resource: /hibernate.cfg.xml
19-mrt-2005 9:34:32 org.hibernate.cfg.Configuration addResource
INFO: Mapping resource: com/thefactore/phq/vo/Project.hbm.xml
19-mrt-2005 9:34:32 org.hibernate.cfg.HbmBinder bindRootPersistentClassCommonValues
INFO: Mapping class: com.thefactore.phq.vo.Project -> t_jlist_project
19-mrt-2005 9:34:32 org.hibernate.cfg.Configuration doConfigure
INFO: Configured SessionFactory: java:/hibernate/HibernateFactory
19-mrt-2005 9:34:32 org.hibernate.cfg.Configuration secondPassCompile
INFO: processing extends queue
19-mrt-2005 9:34:32 org.hibernate.cfg.Configuration secondPassCompile
INFO: processing collection mappings
19-mrt-2005 9:34:32 org.hibernate.cfg.Configuration secondPassCompile
INFO: processing association property references
19-mrt-2005 9:34:32 org.hibernate.cfg.Configuration secondPassCompile
INFO: processing foreign key constraints
Error: An unknown exception occurred while creating an instance of type com.thefactore.phq.service.ProjectService
[/code]