-->
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.  [ 3 posts ] 
Author Message
 Post subject: NullPointerException when run Hibernate Code Generation
PostPosted: Wed Jul 28, 2010 3:14 pm 
Newbie

Joined: Wed Jul 28, 2010 1:38 pm
Posts: 4
Dear all

I'm struggling with a crucial problem when trying to generate code by re-engineering from a MySQL DB. It was running once but now terminates with a NPE and unfortunately no message. I even was at that point where I transfered database objects to my webapp. Setup: Eclipse Galileo 3.5 with GWT and Hibernate plug-in.

I can connect to the DB and define the reveng.xml file by using the console configuration. I've put the relevant parameters on 'Main' and 'Exporters' tab in the 'Run' dialog. But then, when I finally run the Code Generation I receive a pop-up reporting:

'Exception while generating code. Reason: java.lang.NullPointerException'

No stack trace, no error log. I've found a topic on Google where exactly this issue was raised and refers to a problem if the output directory doesn't exist (http://opensource.atlassian.com/projects/hibernate/browse/HBX-589). But this was solved a long time ago and does not solve my problem since the directory exists in my file system.

I set up a new Eclipse Helios 3.6 environment and reinstalled necessary software, same result, same error. I'm quite confident that I've put the correct files to the class path and copied also the right files to the lib. But, nevertheless, it might be that I have deleted something from the class path in my Eclipse Galileo configuration and forgot to include it in the new Helios configuration.

Is there anywhere a documentation, aside from the Hibernate doc, where I can match my current setup with a setup how it should look like? Can anybody help please? It seems that there is some global setting corrupted (or I however did something wrong :-)). I'm at my wits' end... and going nuts...

Thanks and best,

Carsten


Top
 Profile  
 
 Post subject: Re: NullPointerException when run Hibernate Code Generation
PostPosted: Thu Jul 29, 2010 9:46 am 
Newbie

Joined: Wed Jul 28, 2010 1:38 pm
Posts: 4
Hi

I'm getting desperate...!

Now, I've set up a brand new MySQL installation since I suspected the database instance to be corrupt. I again installed the latest Eclipse Helios JEE 3.6 bundle and the latest Hibernate Tools nightly build... Console configuration, reverse engineering file... everything looks fine. But then when running code generation: NullPointerException

I'm running out of ideas...

Please can someone help me fixing this problem? Maybe by asking the right questions?

Many thanks!

Carsten


Top
 Profile  
 
 Post subject: Re: NullPointerException when run Hibernate Code Generation
PostPosted: Thu Jul 29, 2010 12:14 pm 
Newbie

Joined: Wed Jul 28, 2010 1:38 pm
Posts: 4
Solved the problem!

It was a wrong database scheme... There was a missing primary key in one of the tables and this seems to confuse the Code Generation tool when validating. I found out through generating code only for some of the tables and it worked. Once I added that table with missing PK the reverse engineering failed.

Anyway, there should be a more meaningful error message than a NPE prompted. Maybe an issue for a next release.

Best,

Carsten


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