-->
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: MapGenerator: NullPointerException in ReflectedComponent
PostPosted: Tue Apr 06, 2004 7:58 am 
Newbie

Joined: Mon Feb 23, 2004 8:30 am
Posts: 13
Location: Istanbul, Turkey
Hi,

I have a problem when using MapGenerator. I run:

Code:
java MapGenerator --output=Musteri.hbm.xml satis.Musteri


The trace of the exception:

Code:
java.lang.NullPointerException
   at net.sf.hibernate.tool.class2hbm.ReflectedComponent.getXMLas(ReflectedComponent.java:120)
   at net.sf.hibernate.tool.class2hbm.ReflectedComponent.getXML(ReflectedComponent.java:107)
   at net.sf.hibernate.tool.class2hbm.ReflectedClass.getXMLasSubclass(ReflectedClass.java:187)
   at net.sf.hibernate.tool.class2hbm.ReflectedClass.getXML(ReflectedClass.java:159)
   at net.sf.hibernate.tool.class2hbm.MapGenerator.getXML(MapGenerator.java:490)
   at net.sf.hibernate.tool.class2hbm.MapGenerator.writeXML(MapGenerator.java:139)
   at net.sf.hibernate.tool.class2hbm.MapGenerator.main(MapGenerator.java:134)
   at util.CodeGenerator.main(CodeGenerator.java:25)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:324)
   at com.intellij.rt.execution.application.AppMain.main(Unknown Source)


I debugged the code, the null pointer occurs there:

Code:
   private void getXMLas( int level, boolean isComposite ) {
      if( component != null ) {
         Integer x = (Integer )map.cycleBuster.get( component );


cycleBuster is a null reference.

Does anybody know, why might cycleBuster be null? Or do you have any other suggestion?

Thanks...

_________________
Mert Nuhoglu
http://jroller.com/page/mnuhoglu


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 06, 2004 6:41 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
MapGenerator / class2hbm is not the best tool to use. XDoclet is the primary candidate to use to generate mapping documents from POJOs (classes). It allows appropriate detail to be added to the java file so decent HBMs can be created from it.

If you can come up with a simple example then submit it to JIRA and someone will have a look at it.


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.