-->
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.  [ 2 posts ] 
Author Message
 Post subject: Error after processing foreign key and logging problem
PostPosted: Sat Mar 19, 2005 5:11 am 
Newbie

Joined: Sat Mar 19, 2005 4:59 am
Posts: 1
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]


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 25, 2005 12:36 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
USe your debugguer. Thats proably the mlost efficient way to find why your class cannot be instanciated.

_________________
Emmanuel


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