-->
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: Can't generate classes
PostPosted: Wed Aug 11, 2004 5:05 pm 
Newbie

Joined: Wed Aug 11, 2004 4:48 pm
Posts: 12
Version
2.1.6

Mapping

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 2.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd">
<hibernate-mapping>
<class name="com.dti.tests.Location" table="TRACK">
<id name="id" type="int" column="ID">
<meta attribute="scope-set">protected</meta>
<generator class="native"/>
</id>
<property name="description" type="string" not-null="true"/>
<property name="active" type="int" not-null="true"/>
</class>
</hibernate-mapping>


Exception trace

INFO: Generating 3 in generated
java.lang.NullPointerException
at net.sf.hibernate.tool.hbm2java.BasicRenderer.isPropertySet(BasicRende
rer.java:611)
at net.sf.hibernate.tool.hbm2java.BasicRenderer.generateConcreteEmptyCla
sses(BasicRenderer.java:332)
at net.sf.hibernate.tool.hbm2java.BasicRenderer.render(BasicRenderer.jav
a:59)
at net.sf.hibernate.tool.hbm2java.Generator.write(Generator.java:138)
at net.sf.hibernate.tool.hbm2java.Generator.writeRecur(Generator.java:11
5)
at net.sf.hibernate.tool.hbm2java.Generator.generate(Generator.java:104)

at net.sf.hibernate.tool.hbm2java.CodeGenerator.main(CodeGenerator.java:
125)


Hello!

I'm just trying generate classes from mapping. Stuck completely.
Tryed to do that with ant and batch file. Result is the same.

I'm REALLY new to that stuff, so probably i'm mising something obvious.
My log4 is not configured. There is no hibernate config file.
Situation seems to be simple, but nothing work for me!

It doesn't wanna work on sample files either!

Please help!

WBR
Mike


Top
 Profile  
 
 Post subject: Generating classes from mapping
PostPosted: Wed Aug 11, 2004 6:02 pm 
Newbie

Joined: Tue Aug 10, 2004 6:35 pm
Posts: 1
I found a possible bug in 2.1.6 yesterday night. Generation does not work if the property generate-concrete-empty-classes is not set explicitly.

Just use a system config.xml file like this one to start the generation (if you use command line, --config=yourpath/config.xml or if you use ant config="yourpath/config.xml"

<codegen>
<generate renderer="net.sf.hibernate.tool.hbm2java.BasicRenderer">
<param name="generate-concrete-empty-classes">false</param>
</generate>
</codegen>

Good luck.

Daniel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 11, 2004 6:30 pm 
Newbie

Joined: Wed Aug 11, 2004 4:48 pm
Posts: 12
Sounds sensible.

I also thought something like that, but checked it with value="true", because i'm not sure about parameter meating.

I haven't any IDE on comp. and do not wanna spend a lot of time on debugging. So, after quick source rewiew, i guessed that config file must be present, or something like that. Presence of the file doesn't fix the problem, because property was set to true.

Will try it with false.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 11, 2004 9:30 pm 
Newbie

Joined: Wed Aug 11, 2004 4:48 pm
Posts: 12
Now it work! Thanks a lot.


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.