-->
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.  [ 9 posts ] 
Author Message
 Post subject: "Entity class not found" in Hibernate console on &
PostPosted: Thu Mar 29, 2007 9:12 am 
Newbie

Joined: Wed Nov 16, 2005 10:15 am
Posts: 7
Hi!

I ran into a Hibernate Tools problem - "entity class not found". SW versions are:

Hibernate Tools version: 3.2.0 beta9a

Hibernate version: 3.2.2

JDK version: 1.5.0

Name and version of the database I am using: MySQL 5

Here's what I've done:
1. I have added a configuration - provided the name for it, project name and the location of the cfg.xml file, all on the "general" tab, leaving everything else blank
2. On "classpath" tab I left the "Include default classpath from project" chekbox checked
3. On "mappings" tab I added nothing, since my mapping files are mentioned in the cfg.xml
4. I right-clicked on the name of the config and selected "Create session factory"
5. As the subject says, I got "...entity class not found: some.valid.classpath.ClassName" I would like to say "some.valid.classpath" is a directory inside my WEB-INF/classes directory and contains both the SomeClass(.class of course) and the appropriate "...hbm.xml" file.

The next thing I tried was to uncheck the checkbox "Include default classpath from project" on "classpath" tab, and added the mysqlconnector.jar and the relevant WEB-INF/classes directory containing the mapping and the .class files to the classpath (no, I didn't add the source path instead of the class path), but to no avail.

The next thing I tried was to comment out the resource mapping entries from the cfg.xml and added them in the "mappings" tab, but that didn't help either.

The web application itself works OK with those cfg and mapping files.

I also tried selecting "Run SchemaExport" from the context menu, but also got "entity class not found"...

After a couple of retries I also got a message from Eclipse saying it's out of memory and would it be OK to restart the IDE so I played along. After restart I tried the mentioned steps again, with the same result. The "out of memory" problem is probably a conseqence, not a cause, because I did nothing else inbetween.

Am I doing something wrong or is there maybe a workaround for this problem?

Help appreciated, thanks!

Alex


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 11:21 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
are you sure you are running Eclipse with a JDK 5 VM ?

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 4:27 pm 
Newbie

Joined: Wed Nov 16, 2005 10:15 am
Posts: 7
Yes, why?


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 29, 2007 5:09 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
because either that is the error or there is something missing in the classpath.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 1:19 am 
Newbie

Joined: Wed Nov 16, 2005 10:15 am
Posts: 7
JDK is 1.5.0.

As for the classpath, I tried both setting it manually and letting the tool use the default project classpath. The details are in the original post. Is there anything else I am missing?
I expected once I supplied the connector.jar and the WEB-INF/classes directory containing the actual class files, that would be it. Should there be anything else there in the classpath?

Alex


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 1:39 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
show me the actual classpath and the full stacktrace you get.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 3:06 am 
Newbie

Joined: Wed Nov 16, 2005 10:15 am
Posts: 7
Classpath (as shown in the "classapth" tab):

/HibernateTest/WebContent/WEB-INF/classes
c:/Progs/tomcat5520/common/lib/mysql-connector-java-3.1.13-bin.jar


When I go "Create SessionFactory", Hibernate console popup opens and says:

"Problem while executing Create
SessionFactory(org.hibernate.MappingException: entity class not found:
hr.gzaop.model.Group)

Reason:
org.hibernate.MappingException: entity class not found:
hr.gzaop.model.Group

Details:
org.hibernate.MappingException: entity class not found: hr.gzaop.model.Group
org.hibernate.MappingException: entity class not found: hr.gzaop.model.Group
java.lang.ClassNotFoundException: hr.gzaop.model.Group"


There is no other message, no stacktrace.

And
/HibernateTest/WebContent/WEB-INF/classes
contains
hr/gzaop/model/Group.class
and
hr/gzaop/model/Group.hbm.xml

Alex


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 4:20 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
very weird.

Please go into Help/About Eclipse SDK/Configuration Details

and tell me what java.version is set to.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 30, 2007 6:56 am 
Newbie

Joined: Wed Nov 16, 2005 10:15 am
Posts: 7
You are right, Max, and this was an eye opener - normally I start Eclipse either through a batch script or through a shortcut containing the -vm param.
But not this workspace - no -vm on this shortcut.

Sorry to have troubled you, and thanks a lot, I appreciate it!

Alex


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