-->
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.  [ 4 posts ] 
Author Message
 Post subject: hbm2java erros in hibernate-tools-3
PostPosted: Tue Jan 17, 2006 7:24 pm 
Newbie

Joined: Thu Jan 27, 2005 7:43 pm
Posts: 8
Hibernate version: 3.0.2

Mapping documents:3.0

Full stack trace of any exception that occurs:

I have upgraded from hibernate-2.1 to hibernate-3.0.2
now I'm trying to upgrade to new hibernate tools
here is my new build.xml:
Code:
     <target name="hbm2java">

        <taskdef name="hibernatetool"
   classname="org.hibernate.tool.ant.HibernateToolTask"
                   classpathref="project.class.path"/> 

        <hibernatetool destdir="${gen-src}" >
           <configuration  propertyfile="${etc}/hibernate.properties">
           <fileset dir="${src}">
   <include name="**/*.hbm.xml" />
           </fileset>
           </configuration>

           <hbm2java/>
         </hibernatetool>

    </target>


I have tried to use "HibernateTools-3.1.0.beta2" and got following exception:

[hibernatetool] (hbm2x.template 94 ) Method getJavaTypeNam
e threw exception for reference $pojo in template pojo/PojoFields.vm at [10,37]

[hibernatetool] (hbm2x.template 94 ) Method get threw exce
ption for reference $templates in template pojo/Pojo.vm at [10,1]

BUILD FAILED
C:\development\eclipse\workspace\nms\nmss\build.xml:431: org.hibernate.tool.hbm2
x.ExporterException: MethodInvocationException while processing template Pojo. I
nvocation of method 'get' in class org.hibernate.tool.hbm2x.TemplateHelper$Temp
lates threw exception class org.hibernate.tool.hbm2x.ExporterException : MethodI
nvocationException while processing template pojo/PojoFields.vm. Invocation of m
ethod 'getJavaTypeName' in class org.hibernate.tool.hbm2x.pojo.EntityPOJOClass
threw exception class org.hibernate.tool.hbm2x.ExporterException : Could not res
olve type without exception for org.hibernate.mapping.Property(parameters) Value
: org.hibernate.mapping.Array(com.crossbeamsys.nms.task.TaskDO.parameters)


now when I try to use "hibernate-tools-3.1.0.alpha5" it works, but
for my id define as:
Code:
<id name="id" type="long" column="deviceid" unsaved-value="-1">


I get generated "Long" instead of "long",

1. why is that?

2. also, in hibernate-tools 2 I could define the following

Code:
hbm2java config="${build-src}/codegen.cfg.xml" output="${gen-src}"


which allowed me to use codegen.cfg.xml and define meta tags, now I don't see anywhere in the doc on how to do that.

3. Also tried "hibernate-tools-3.0.0.alpha4a", but here I'm getting
java.lang.ExceptionInInitializerError

PLEASE HELP!!!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 18, 2006 4:07 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Could not res
olve type without exception for org.hibernate.mapping.Property(parameters) Value
: org.hibernate.mapping.Array(com.crossbeamsys.nms.task.TaskDO.parameters)


so you haven't specified type for the com.crossbeamsys.nms.task.TaskDO.parameters - fix that.

the cfg.xml option is not available anymore, put the <meta> names in the top of your hbm.xml files.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 19, 2006 3:08 pm 
Newbie

Joined: Thu Jan 27, 2005 7:43 pm
Posts: 8
well,

nothing has changed since I've done an upgrade
and it worked fine before.
the type attribute is not even listed for this type def:

it should be of type "com.test.task.TaskParameter"

and what's also wierd is that if I use "hibernate-tools-3.1.0.alpha5" it build fine, but in place of "com.test.task.TaskParameter" I get null
like this: "private null[] parameters;"

Code:
        <!-- The parameters property -->
<array name="parameters" table="taskParametersTable" cascade="all">

            <key column="taskId"/>
            <index column="hibernateIndex" type="int"/>

           <composite-element 
                class="com.test.task.TaskParameter">

                <!-- The parameter name property -->
                <property name="name" type="string" length="80" not-null="true">
                    <meta attribute="field-description">
                        The parameter name.  This name will be understood by the
                        Task Execution MDB.
                    </meta>
                </property>

                <!-- The parameter value property -->
                <property name="value" type="string" length="80" not-
                        null="true">
                    <meta attribute="field-description">
                        The parameter value.
                    </meta>
                </property>
            </composite-element>
        </array>


what am I missing here?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jan 19, 2006 6:10 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
report it jira with a failing testcase.

_________________
Max
Don't forget to rate


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