-->
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 generate NullPointerException problem
PostPosted: Tue Jan 18, 2005 1:19 am 
Newbie

Joined: Tue Jan 18, 2005 1:12 am
Posts: 3
when i run the hbm2java, it prints the error message.

This is my mapping document:
Mapping documents:
<?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>
<!--
Created by the Middlegen Hibernate plugin 2.1

http://boss.bekk.no/boss/middlegen/
http://www.hibernate.org/
-->

<class
name="org.hibernate.sample.Contact"
table="contact"
>
<meta attribute="class-description" inherit="false">
@hibernate.class
table="contact"
</meta>

<id
name="id"
type="java.lang.Long"
column="id"
>
<meta attribute="field-description">
@hibernate.id
generator-class="assigned"
type="java.lang.Long"
column="id"


</meta>
<generator class="assigned" />
</id>

<property
name="type"
type="java.lang.String"
column="type"
/>
<!-- <meta attribute="field-description">
@hibernate.property
column="type"
</meta>
</property> -->
<property
name="content"
type="java.lang.String"
column="content"
length="40"
/>
<!-- <meta attribute="field-description">
@hibernate.property
column="content"
length="40"
</meta>
</property>

Associations -->

<!-- bi-directional many-to-one association to User -->
<many-to-one
name="user"
class="org.hibernate.sample.User"
not-null="true"
>
<meta attribute="field-description">
@hibernate.many-to-one
not-null="true"
@hibernate.column name="user_id"
</meta>
<column name="user_id" />
</many-to-one>

</class>
</hibernate-mapping>



Full stack trace of any exception that occurs:
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)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 18, 2005 1:55 am 
Newbie

Joined: Tue Jan 18, 2005 1:12 am
Posts: 3
i think there is no error in the mapping document.
I have try a lot of .xml document.All have the same error message.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 18, 2005 3:28 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
are you using the latest hibernateext ? (it looks like an old bug)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 18, 2005 5:57 am 
Newbie

Joined: Tue Jan 18, 2005 1:12 am
Posts: 3
Thank you, i use hibernate-extensions-2.1.3.
isn't it the latest version?


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.