-->
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.  [ 5 posts ] 
Author Message
 Post subject: Can't get the custom reverse engineering strategy to work!
PostPosted: Tue Mar 01, 2011 6:45 am 
Beginner
Beginner

Joined: Tue Dec 21, 2010 5:26 am
Posts: 25
Hi,

I can't get the reverse engineering to work. I'm using the Eclipse plugin. If I enter: org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy
into the 'reveng.strategy' field or nothing at all it works. BUT when I enter my custom strategy class I get the following error:
Code:
org.hibernate.console.HibernateConsoleRuntimeException: Could not create or find my.package.CustomRevEngStrategy with one argument delegate constructor
Could not create or find my.package.CustomRevEngStrategy with one argument delegate constructor
  java.lang.ClassNotFoundException: my.package.CustomRevEngStrategy
  my.package.CustomRevEngStrategy
    java.lang.ClassNotFoundException: my.package.CustomRevEngStrategy
    my.package.CustomRevEngStrategy


As if my class didn't have the (explicitly required) contructor wich calls the super with a delegate... How is this meant to work?


Top
 Profile  
 
 Post subject: Re: Can't get the custom reverse engineering strategy to work!
PostPosted: Wed Mar 02, 2011 6:36 am 
Senior
Senior

Joined: Tue Aug 04, 2009 7:45 am
Posts: 124
I guess your strategy class is not in Console configuration class path?


Top
 Profile  
 
 Post subject: Re: Can't get the custom reverse engineering strategy to work!
PostPosted: Wed Mar 02, 2011 7:21 am 
Beginner
Beginner

Joined: Tue Dec 21, 2010 5:26 am
Posts: 25
And what does that mean? I tried packing the class into a jar and put it right next to the other hibernate jars. Plus, adding it to the build path, so it appears under "Referenced Libraries" in Eclipse...


Top
 Profile  
 
 Post subject: Re: Can't get the custom reverse engineering strategy to work!
PostPosted: Thu Mar 03, 2011 3:24 am 
Beginner
Beginner

Joined: Tue Dec 21, 2010 5:26 am
Posts: 25
That is exactly what is was. But when you look at my previous post you'll see that this is not something that can be considered common knowledge. Since I created this configuration once when starting on my hibernate project, I quickly forgot about it. Because it always gets chosen automatically when reverse engineering. Plus, it didn't matter if I worked in different Eclipse projects.

How is someone supposed to know that this (one time only seen) configuration:
  • uses the class path of the very first project you set it to (so the source file needs to be copied to there)
  • it is a class path problem in the first place, since the error message clearly suggests that a required constructor was missing! Which is total BS since it is impossible to extend the DelegatingReverseEngineeringStrategy without having a proper constructor present!

So thanks again for directing me to the right path. But again, this was way more complicated that it needed to be. If only the sites explaining the custom reverse engineering strategy would include these facts.

Because again, I don't think it is that uncommon to have more than one Eclipse project for which you didn't create a sepparate Hibernate Configuration. (Which would be always exactly the same anyway, except for the project's class path of course)


Top
 Profile  
 
 Post subject: Re: Can't get the custom reverse engineering strategy to work!
PostPosted: Sun Apr 10, 2011 3:57 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
X5-599 wrote:
That is exactly what is was. But when you look at my previous post you'll see that this is not something that can be considered common knowledge. Since I created this configuration once when starting on my hibernate project, I quickly forgot about it. Because it always gets chosen automatically when reverse engineering. Plus, it didn't matter if I worked in different Eclipse projects.

How is someone supposed to know that this (one time only seen) configuration:
  • uses the class path of the very first project you set it to (so the source file needs to be copied to there)
  • it is a class path problem in the first place, since the error message clearly suggests that a required constructor was missing! Which is total BS since it is impossible to extend the DelegatingReverseEngineeringStrategy without having a proper constructor present!

So thanks again for directing me to the right path. But again, this was way more complicated that it needed to be. If only the sites explaining the custom reverse engineering strategy would include these facts.

Because again, I don't think it is that uncommon to have more than one Eclipse project for which you didn't create a sepparate Hibernate Configuration. (Which would be always exactly the same anyway, except for the project's class path of course)


The error message says constrictor could not be found since the class could not be found.

And I'm sorry you missed that console configurations have a class path associated with them but if you think about it how should we choose the class path if not by having it on the console configuration launch? Should we just choose to use a new class path based on your current selection instead ?that would lead to even more confusion. Don't you think ?

_________________
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.  [ 5 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.